From 6a67d0b0a44e8ecfcd396c9a2fe63dce5ad8d0cf Mon Sep 17 00:00:00 2001 From: xuwu / luna Date: Thu, 26 Sep 2024 03:41:30 -0800 Subject: [PATCH] Handheld Nozzle & World gen Fix --- .../9236c1b9c6a03951599201d1a94da43170753f4b | 7 +- .../assets/create_dd/lang/en_ud.json | 2 +- .../assets/create_dd/lang/en_us.json | 2 +- .../models/item/handheld_nozzle.json | 3 + .../uwu/lopyluna/create_dd/DesireUtil.java | 12 +- .../handheld_nozzle/HandheldNozzleItem.java | 314 ++++++++++++++++++ .../HandheldNozzleRenderer.java | 82 +++++ .../portable_fan/PortableFanItem.java | 113 ------- .../create_dd/events/RemapHelperDesires.java | 3 +- .../infrastructure/config/DCommon.java | 19 ++ .../infrastructure/config/DEquipment.java | 10 +- .../infrastructure/config/DServer.java | 4 +- .../infrastructure/config/DWorldGen.java | 28 ++ .../infrastructure/config/DesiresConfigs.java | 12 +- .../gui/DesiresBaseConfigScreen.java | 12 +- .../create_dd/registry/DesiresItems.java | 9 +- .../registry/DesiresOreFeaturesEntries.java | 15 + .../models/item/handheld_nozzle/gear.json | 67 ++++ .../item/handheld_nozzle/glow_green.json | 22 ++ .../models/item/handheld_nozzle/glow_red.json | 22 ++ .../models/item/handheld_nozzle/item.json | 224 +++++++++++++ .../create_dd/textures/block/signal_glow.png | Bin 0 -> 662 bytes 22 files changed, 841 insertions(+), 141 deletions(-) create mode 100644 src/generated/resources/assets/create_dd/models/item/handheld_nozzle.json create mode 100644 src/main/java/uwu/lopyluna/create_dd/content/items/equipment/handheld_nozzle/HandheldNozzleItem.java create mode 100644 src/main/java/uwu/lopyluna/create_dd/content/items/equipment/handheld_nozzle/HandheldNozzleRenderer.java delete mode 100644 src/main/java/uwu/lopyluna/create_dd/content/items/equipment/portable_fan/PortableFanItem.java create mode 100644 src/main/java/uwu/lopyluna/create_dd/infrastructure/config/DCommon.java create mode 100644 src/main/java/uwu/lopyluna/create_dd/infrastructure/config/DWorldGen.java create mode 100644 src/main/resources/assets/create_dd/models/item/handheld_nozzle/gear.json create mode 100644 src/main/resources/assets/create_dd/models/item/handheld_nozzle/glow_green.json create mode 100644 src/main/resources/assets/create_dd/models/item/handheld_nozzle/glow_red.json create mode 100644 src/main/resources/assets/create_dd/models/item/handheld_nozzle/item.json create mode 100644 src/main/resources/assets/create_dd/textures/block/signal_glow.png diff --git a/src/generated/resources/.cache/9236c1b9c6a03951599201d1a94da43170753f4b b/src/generated/resources/.cache/9236c1b9c6a03951599201d1a94da43170753f4b index 0426568b..f3f48a3c 100644 --- a/src/generated/resources/.cache/9236c1b9c6a03951599201d1a94da43170753f4b +++ b/src/generated/resources/.cache/9236c1b9c6a03951599201d1a94da43170753f4b @@ -1,4 +1,4 @@ -// 1.19.2 2024-09-20T00:40:01.7352221 Registrate Provider for create_dd [Recipes, Advancements, Loot tables, Tags (blocks), Tags (items), Tags (fluids), Tags (entity_types), Blockstates, Item models, Lang (en_us/en_ud)] +// 1.19.2 2024-09-25T22:38:45.6336296 Registrate Provider for create_dd [Recipes, Advancements, Loot tables, Tags (blocks), Tags (items), Tags (fluids), Tags (entity_types), Blockstates, Item models, Lang (en_us/en_ud)] 9452bed2fb7ba829ea35644054add91456d3f5d9 assets/create_dd/blockstates/amethyst_block_pillar.json 64dc32722d3ad05720fa9a200df1de7179cfd890 assets/create_dd/blockstates/basalt_pillar.json 5fd6e80fe77786dd8fd0c5cfd6d866b44365aa96 assets/create_dd/blockstates/blackstone_pillar.json @@ -421,8 +421,8 @@ af62e1b2187e70334a3e36986b368feac281d63d assets/create_dd/blockstates/yellow_pad 2736c91b94b9dd34ed0a702b4b538e6d63bc5c73 assets/create_dd/blockstates/yellow_padded_rubber_stairs.json 7ac56fd4064658532ee94e7c8def9f604e9528aa assets/create_dd/blockstates/yellow_padded_tiled_rubber.json 9952df2744c1791ecccc84a34a105cffe18b76d9 assets/create_dd/blockstates/yellow_velvet_block.json -57fc28b9068d0e6252d949c1bf8efdd99eec9be5 assets/create_dd/lang/en_ud.json -f2e7bb6d1d7ef9d9377ba45ef2c5d187250f13d8 assets/create_dd/lang/en_us.json +a9a33c97acd05119ee88ca95c4459b0721455e4f assets/create_dd/lang/en_ud.json +9c37824fe7eb9a659797112be1b5fa4de7163aeb assets/create_dd/lang/en_us.json 186464982087eb2dd6aa9a5bf09cdb29e6326c49 assets/create_dd/models/block/amethyst_block_pillar.json 37f5da0e49555aed59846ec90f8286e737feb179 assets/create_dd/models/block/amethyst_block_pillar_horizontal.json c9845fd31f14aa8e1a83ffc67249b5486a8ff5cc assets/create_dd/models/block/basalt_pillar.json @@ -1356,6 +1356,7 @@ a3ee268f5a05d4aed2b7908d15725fe9cd7c02a3 assets/create_dd/models/item/green_padd 8aeff01cfb946289d0fefa1f0352196a399cba13 assets/create_dd/models/item/green_padded_tiled_rubber.json 646125c8505149b02bb25fd7bcd511f85b53c617 assets/create_dd/models/item/green_velvet_block.json 82e9049994856d02a4e9b1dd22e5034ceadbb05a assets/create_dd/models/item/handheld_block_zapper.json +756a7b1519e73d3a2134711481d2c7dbca57c7b7 assets/create_dd/models/item/handheld_nozzle.json 9bf067add92f1dacfa85e22d064b7bb61e223bbf assets/create_dd/models/item/haunting_sail.json 994076ecbe15fa52cca5b0f205547c76dc513475 assets/create_dd/models/item/hazard_block.json a17807cc3f3109b35d6c5d9b3677a4d926221d33 assets/create_dd/models/item/helm.json diff --git a/src/generated/resources/assets/create_dd/lang/en_ud.json b/src/generated/resources/assets/create_dd/lang/en_ud.json index 6305c62b..d4744f48 100644 --- a/src/generated/resources/assets/create_dd/lang/en_ud.json +++ b/src/generated/resources/assets/create_dd/lang/en_ud.json @@ -486,6 +486,7 @@ "item.create_dd.handheld_block_zapper.tooltip.condition2": "ʞɔoןᗺ ʇɐ ʞɔıןƆ-ᴚ", "item.create_dd.handheld_block_zapper.tooltip.condition3": "buıʞɐǝuS ǝןıɥʍ ʞɔıןƆ-ᴚ", "item.create_dd.handheld_block_zapper.tooltip.summary": "˙ǝɔuɐʇsıp ɐ ɯoɹɟ ‾buıdɐɔspuɐן‾ ǝןɐɔs-ǝbɹɐן ɹoɟ ןooʇ ‾ǝpoɯ ǝʌıʇɐǝɹƆ‾", + "item.create_dd.handheld_nozzle": "ǝןzzoN pןǝɥpuɐH", "item.create_dd.incomplete_abstruse_mechanism": "ɯsıuɐɥɔǝW ǝsnɹʇsqⱯ ǝʇǝןdɯoɔuI", "item.create_dd.incomplete_calculation_mechanism": "ɯsıuɐɥɔǝW uoıʇɐןnɔןɐƆ ǝʇǝןdɯoɔuI", "item.create_dd.incomplete_infernal_mechanism": "ɯsıuɐɥɔǝW ןɐuɹǝɟuI ǝʇǝןdɯoɔuI", @@ -500,7 +501,6 @@ "item.create_dd.kinetic_mechanism": "ɯsıuɐɥɔǝW ɔıʇǝuıʞ", "item.create_dd.lapis_lazuli_shard": "pɹɐɥS ıןnzɐꞀ sıdɐꞀ", "item.create_dd.music_disc_waltz_of_the_flowers": "ɔsıᗡ ɔısnW", - "item.create_dd.portable_fan": "uɐℲ ǝןqɐʇɹoԀ", "item.create_dd.pumpkin_milkshake_bucket": "ʇǝʞɔnᗺ ǝʞɐɥsʞןıW uıʞdɯnԀ", "item.create_dd.raw_rubber": "ɹǝqqnᴚ ʍɐᴚ", "item.create_dd.refined_radiance": "ǝɔuɐıpɐᴚ pǝuıɟǝᴚ", diff --git a/src/generated/resources/assets/create_dd/lang/en_us.json b/src/generated/resources/assets/create_dd/lang/en_us.json index 4cf7466c..c110ea53 100644 --- a/src/generated/resources/assets/create_dd/lang/en_us.json +++ b/src/generated/resources/assets/create_dd/lang/en_us.json @@ -486,6 +486,7 @@ "item.create_dd.handheld_block_zapper.tooltip.condition2": "R-Click at Block", "item.create_dd.handheld_block_zapper.tooltip.condition3": "R-Click while Sneaking", "item.create_dd.handheld_block_zapper.tooltip.summary": "_Creative mode_ tool for large-scale _landscaping_ from a distance.", + "item.create_dd.handheld_nozzle": "Handheld Nozzle", "item.create_dd.incomplete_abstruse_mechanism": "Incomplete Abstruse Mechanism", "item.create_dd.incomplete_calculation_mechanism": "Incomplete Calculation Mechanism", "item.create_dd.incomplete_infernal_mechanism": "Incomplete Infernal Mechanism", @@ -500,7 +501,6 @@ "item.create_dd.kinetic_mechanism": "Kinetic Mechanism", "item.create_dd.lapis_lazuli_shard": "Lapis Lazuli Shard", "item.create_dd.music_disc_waltz_of_the_flowers": "Music Disc", - "item.create_dd.portable_fan": "Portable Fan", "item.create_dd.pumpkin_milkshake_bucket": "Pumpkin Milkshake Bucket", "item.create_dd.raw_rubber": "Raw Rubber", "item.create_dd.refined_radiance": "Refined Radiance", diff --git a/src/generated/resources/assets/create_dd/models/item/handheld_nozzle.json b/src/generated/resources/assets/create_dd/models/item/handheld_nozzle.json new file mode 100644 index 00000000..b265f8a0 --- /dev/null +++ b/src/generated/resources/assets/create_dd/models/item/handheld_nozzle.json @@ -0,0 +1,3 @@ +{ + "parent": "create_dd:item/handheld_nozzle/item" +} \ No newline at end of file diff --git a/src/main/java/uwu/lopyluna/create_dd/DesireUtil.java b/src/main/java/uwu/lopyluna/create_dd/DesireUtil.java index ae9c556c..cdc95977 100644 --- a/src/main/java/uwu/lopyluna/create_dd/DesireUtil.java +++ b/src/main/java/uwu/lopyluna/create_dd/DesireUtil.java @@ -22,21 +22,25 @@ public class DesireUtil { public static boolean randomChance(int chance) { int newChance = Mth.clamp(chance, 0, 100); - return RANDOM.nextInt(1, 100) <= newChance; + return newChance != 0 && RANDOM.nextInt(1, 100) <= newChance; } public static boolean randomChance(int chance, Level level) { int newChance = Mth.clamp(chance, 0, 100); - return level.getRandom().nextInt(1, 100) <= newChance; + return newChance != 0 && level.getRandom().nextInt(1, 100) <= newChance; } public static boolean randomChance(double chance) { int newChance = Mth.clamp(((int) chance * 100), 0, 100); - return RANDOM.nextInt(1, 100) <= newChance; + return newChance != 0 && RANDOM.nextInt(1, 100) <= newChance; } public static boolean randomChance(double chance, Level level) { int newChance = Mth.clamp(((int) chance * 100), 0, 100); - return level.getRandom().nextInt(1, 100) <= newChance; + return newChance != 0 && level.getRandom().nextInt(1, 100) <= newChance; + } + + public static boolean tickDelay(int percentage, Level level ) { + return level.getGameTime() % percentage != 0; } diff --git a/src/main/java/uwu/lopyluna/create_dd/content/items/equipment/handheld_nozzle/HandheldNozzleItem.java b/src/main/java/uwu/lopyluna/create_dd/content/items/equipment/handheld_nozzle/HandheldNozzleItem.java new file mode 100644 index 00000000..6e1d3999 --- /dev/null +++ b/src/main/java/uwu/lopyluna/create_dd/content/items/equipment/handheld_nozzle/HandheldNozzleItem.java @@ -0,0 +1,314 @@ +package uwu.lopyluna.create_dd.content.items.equipment.handheld_nozzle; + +import com.simibubi.create.AllSoundEvents; +import com.simibubi.create.content.equipment.armor.BacktankUtil; +import com.simibubi.create.content.kinetics.fan.AirCurrent; +import com.simibubi.create.foundation.item.render.SimpleCustomRenderer; +import com.simibubi.create.foundation.utility.VecHelper; +import net.minecraft.MethodsReturnNonnullByDefault; +import net.minecraft.core.particles.ParticleTypes; +import net.minecraft.nbt.CompoundTag; +import net.minecraft.network.chat.Component; +import net.minecraft.sounds.SoundSource; +import net.minecraft.util.Mth; +import net.minecraft.world.InteractionHand; +import net.minecraft.world.InteractionResultHolder; +import net.minecraft.world.entity.Entity; +import net.minecraft.world.entity.LivingEntity; +import net.minecraft.world.entity.item.ItemEntity; +import net.minecraft.world.entity.player.Player; +import net.minecraft.world.item.Item; +import net.minecraft.world.item.ItemStack; +import net.minecraft.world.level.ClipContext; +import net.minecraft.world.level.Level; +import net.minecraft.world.phys.AABB; +import net.minecraft.world.phys.BlockHitResult; +import net.minecraft.world.phys.HitResult; +import net.minecraft.world.phys.Vec3; +import net.minecraftforge.api.distmarker.Dist; +import net.minecraftforge.api.distmarker.OnlyIn; +import net.minecraftforge.client.extensions.common.IClientItemExtensions; +import org.jetbrains.annotations.NotNull; +import uwu.lopyluna.create_dd.infrastructure.config.DesiresConfigs; + +import javax.annotation.ParametersAreNonnullByDefault; +import java.util.ArrayList; +import java.util.List; +import java.util.function.Consumer; + +import static uwu.lopyluna.create_dd.DesireUtil.randomChance; +import static uwu.lopyluna.create_dd.registry.DesireTiers.Drill; + +@ParametersAreNonnullByDefault +@MethodsReturnNonnullByDefault +@SuppressWarnings("all") +public class HandheldNozzleItem extends Item { + + private final List pushingEntities = new ArrayList<>(); + + public HandheldNozzleItem(Properties properties) { + super(properties); + } + + public boolean getIsBlowing(CompoundTag nbt) { + return nbt.getBoolean("isBlowing"); + } + public boolean getIsActive(CompoundTag nbt) { + return nbt.getBoolean("isActive"); + } + public void setIsBlowing(CompoundTag nbt, boolean value) { + nbt.putBoolean("isBlowing", value); + } + public void setIsActive(CompoundTag nbt, boolean value) { + nbt.putBoolean("isActive", value); + } + + @Override + public InteractionResultHolder use(Level level, Player player, InteractionHand hand) { + ItemStack itemStack = player.getItemInHand(hand); + CompoundTag nbt = itemStack.getOrCreateTag(); + + if (player.isShiftKeyDown()) { + if (!level.isClientSide) { + setIsBlowing(nbt, !getIsBlowing(nbt)); + player.displayClientMessage(Component.literal("Mode switched to: " + (getIsBlowing(nbt) ? "Blowing" : "Vacuuming")), true); + level.playSound(null, player.blockPosition(), AllSoundEvents.CONFIRM.getMainEvent(), SoundSource.PLAYERS, 1.0F, 1.0F); + } + } else { + if (!level.isClientSide) { + setIsActive(nbt, !getIsActive(nbt)); + player.displayClientMessage(Component.literal(getName(itemStack).getString() + ": " + (getIsActive(nbt) ? "Activated" : "De-Activated") ), true); + level.playSound(null, player.blockPosition(), getIsActive(nbt) ? AllSoundEvents.CONFIRM.getMainEvent() : AllSoundEvents.DENY.getMainEvent(), SoundSource.PLAYERS, 1.0F, 1.0F); + + } + } + return InteractionResultHolder.sidedSuccess(itemStack, level.isClientSide()); + } + + @Override + public boolean onEntitySwing(ItemStack stack, LivingEntity entity) { + return true; + } + + @Override + @OnlyIn(Dist.CLIENT) + public void initializeClient(Consumer consumer) { + consumer.accept(SimpleCustomRenderer.create(this, new HandheldNozzleRenderer())); + } + + @Override + public boolean isBarVisible(@NotNull ItemStack stack) { + return BacktankUtil.isBarVisible(stack, maxUses()); + } + + @Override + public int getBarWidth(@NotNull ItemStack stack) { + return BacktankUtil.getBarWidth(stack, maxUses()); + } + + @Override + public int getBarColor(@NotNull ItemStack stack) { + return BacktankUtil.getBarColor(stack, maxUses()); + } + + + public static int maxUses() { + return Drill.getUses(); + } + + @Override + public void inventoryTick(ItemStack pStack, Level pLevel, Entity pEntity, int pSlotId, boolean pIsSelected) { + super.inventoryTick(pStack, pLevel, pEntity, pSlotId, pIsSelected); + float range = DesiresConfigs.server().equipment.handheldNozzleRange.getF(); + float rangeP = DesiresConfigs.server().equipment.handheldNozzleRangePlayer.getF(); + float speedLimit = DesiresConfigs.server().equipment.handheldNozzleSpeedLimit.getF(); + CompoundTag nbt = pStack.getOrCreateTag(); + + if (pEntity instanceof Player pPlayer) { + if (pIsSelected || (pPlayer.getOffhandItem() == pStack && pSlotId == 0 && !(pIsSelected && pSlotId == 0 && pPlayer.getMainHandItem() == pStack))) { + if (!pPlayer.getTags().contains("self")) { + pPlayer.addTag("self"); + } + + if (!(getIsActive(nbt) && !pPlayer.isShiftKeyDown())) return; + + Vec3 center = getCenterPos(pPlayer); + + if (!pLevel.isClientSide) { + handleEntityInteractions(pLevel, pPlayer, center, range, nbt, speedLimit); + handlePlayerInteractions(pPlayer, rangeP, nbt, speedLimit); + } + if (pLevel.isClientSide) { + generateParticles(pLevel, pPlayer, range, rangeP, nbt); + } + + } else { + if (pPlayer.getTags().contains("self")) { + pushingEntities.clear(); + pPlayer.removeTag("self"); + } + } + } + } + + private void handleEntityInteractions(Level pLevel, Player pPlayer, Vec3 center, float range, CompoundTag nbt, float speedLimit) { + pushingEntities.removeIf(entity -> entity == null); + pushingEntities.removeIf(entity -> !entity.isAlive()); + if (range != 0) { + AABB bb = new AABB(center, center).inflate(range); + List entitiesToRemove = new ArrayList<>(); + + for (Entity entity : pLevel.getEntitiesOfClass(Entity.class, bb)) { + if (entity == null && !entity.isAlive()) + continue; + + Vec3 diff = getCenterPos(entity).subtract(center); + double distance = diff.length(); + + if (entity.noPhysics || entity.isInvulnerable() || entity.isSpectator() || entity.isMultipartEntity() || isGETEntitySize(entity, 1.95F, 2.2F) || isGETEntityVolume(entity, 1.95F, 2.2F) || + distance > range || (!getIsBlowing(nbt) && distance <= 1.5) || entity.isShiftKeyDown() || AirCurrent.isPlayerCreativeFlying(entity) || entity.equals(pPlayer)) { + entitiesToRemove.add(entity); + continue; + } + + if (!pushingEntities.contains(entity)) { + pushingEntities.add(entity); + } + + Vec3 pushVec = diff.normalize().scale((range - distance) * (getIsBlowing(nbt) ? 1 : -1)); + float forceFactor = (entity instanceof ItemEntity) ? 1 / 128f : 1 / 32f; + Vec3 force = pushVec.scale(forceFactor * 0.5); + + entity.push(force.x, force.y, force.z); + entity.fallDistance = 0; + entity.hurtMarked = true; + + Vec3 currentMovement = entity.getDeltaMovement(); + if (currentMovement.length() > speedLimit) { + Vec3 limitedMovement = currentMovement.normalize().scale(speedLimit); + entity.setDeltaMovement(limitedMovement); + } + } + + pushingEntities.removeAll(entitiesToRemove); + } else { + pushingEntities.clear(); + } + } + + public boolean isGETEntitySize(Entity entity, float width, float height) { + return entity.getBbWidth() >= width || entity.getBbHeight() >= height; + } + public boolean isGETEntityVolume(Entity entity, float width, float height) { + return entity.getBbWidth() + entity.getBbHeight() >= width + height; + } + + private void handlePlayerInteractions(Player pPlayer, float rangeP, CompoundTag nbt, float speedLimit) { + Vec3 cursorPos = getBlockSideLookingAt(pPlayer, rangeP); + if (rangeP != 0 && cursorPos != null && pPlayer != null && pPlayer.isAlive()) { + Vec3 diffP = getCenterPos(pPlayer).subtract(cursorPos); + double distanceP = diffP.length(); + Vec3 lookVec = pPlayer.getLookAngle(); + Vec3 pushForce = lookVec.scale(-0.025); + + if (!(distanceP > rangeP || pPlayer.isShiftKeyDown() || AirCurrent.isPlayerCreativeFlying(pPlayer))) { + if (!(!getIsBlowing(nbt) && distanceP < 1.5f)) { + Vec3 pushVecP = diffP.normalize().scale((rangeP - distanceP) * (getIsBlowing(nbt) ? 1 : -1)); + + pPlayer.setDeltaMovement(pPlayer.getDeltaMovement().add(pushVecP.scale(1 / 32f))); + pPlayer.setDeltaMovement(pPlayer.getDeltaMovement().add(pushForce)); + pPlayer.fallDistance = 0; + pPlayer.hurtMarked = true; + + Vec3 currentMovement = pPlayer.getDeltaMovement(); + if (currentMovement.length() > speedLimit) { + Vec3 limitedMovement = currentMovement.normalize().scale(speedLimit); + pPlayer.setDeltaMovement(limitedMovement); + } + } + } + } + } + + private void generateParticles(Level pLevel, Player pPlayer, float range, float rangeP, CompoundTag nbt) { + Vec3 center = getCenterPos(pPlayer); + Vec3 cursorPos = getBlockSideLookingAt(pPlayer, rangeP); + + if (range != 0) { + if (randomChance(getIsBlowing(nbt) ? 90 : 60, pLevel)) { + Vec3 start = VecHelper.offsetRandomly(center, pLevel.random, getIsBlowing(nbt) ? 1 : range / 2); + Vec3 motionBlow = start.subtract(center) + .normalize() + .scale(Mth.clamp(range * 0.5, 0, 0.5f)); + Vec3 motionPull = center.subtract(start) + .normalize() + .scale(Mth.clamp(range, 0.5f, 1.0f)); + + Vec3 motion = getIsBlowing(nbt) ? motionBlow : motionPull; + + pLevel.addParticle(ParticleTypes.POOF, start.x, start.y, start.z, motion.x, motion.y, motion.z); + } + } + + if (pLevel.random.nextInt(Mth.clamp(((int) rangeP), 1, 2)) == 0) { + if (cursorPos != null) { + Vec3 playerPos = getCenterPos(pPlayer).add(0, pPlayer.getEyeHeight(), 0); + Vec3 direction = cursorPos.subtract(playerPos).normalize(); + double distance = playerPos.distanceTo(cursorPos); + if (distance > rangeP) distance = rangeP; + + int particleCount = (int) (distance * 0.25); + for (int i = 0; i < particleCount; i++) { + double progress = (double) i / particleCount; + Vec3 beamCorePos = playerPos.add(direction.scale(progress * distance)); + Vec3 randomOffset = new Vec3( + (pLevel.random.nextDouble() - 0.5) * 4, + (pLevel.random.nextDouble() - 0.5) * 4, + (pLevel.random.nextDouble() - 0.5) * 4 + ); + Vec3 particlePos = beamCorePos.add(randomOffset); + Vec3 motion = direction.scale(getIsBlowing(nbt) ? 0.5 : -0.5) + .normalize() + .scale(Mth.clamp(range, 0.5f, 1.0f)); + pLevel.addParticle(ParticleTypes.POOF, particlePos.x, particlePos.y, particlePos.z, motion.x, motion.y, motion.z); + } + } + } + } + + public static Vec3 getCenterPos(Entity entity) { + AABB boundingBox = entity.getBoundingBox(); + + double centerX = (boundingBox.minX + boundingBox.maxX) / 2.0; + double centerY = (boundingBox.minY + boundingBox.maxY) / 2.0; + double centerZ = (boundingBox.minZ + boundingBox.maxZ) / 2.0; + + return new Vec3(centerX, centerY, centerZ); + } + + public static Vec3 getBlockSideLookingAt(Player player, double maxRange) { + + Vec3 eyePosition = player.getEyePosition(1.0F); + Vec3 lookDirection = player.getLookAngle(); + Vec3 endPosition = eyePosition.add(lookDirection.scale(maxRange)); + + BlockHitResult hitResult = player.level.clip(new ClipContext( + eyePosition, + endPosition, + ClipContext.Block.OUTLINE, + ClipContext.Fluid.NONE, + player)); + + if (hitResult.getType() == HitResult.Type.BLOCK) { + return hitResult.getLocation(); + } + + return null; + } + + private boolean canSee(Entity entity, Vec3 pos, Level level) { + ClipContext context = new ClipContext(getCenterPos(entity), pos, + ClipContext.Block.COLLIDER, ClipContext.Fluid.NONE, entity); + return pos.equals(level.clip(context).getLocation()); + } +} \ No newline at end of file diff --git a/src/main/java/uwu/lopyluna/create_dd/content/items/equipment/handheld_nozzle/HandheldNozzleRenderer.java b/src/main/java/uwu/lopyluna/create_dd/content/items/equipment/handheld_nozzle/HandheldNozzleRenderer.java new file mode 100644 index 00000000..bd416220 --- /dev/null +++ b/src/main/java/uwu/lopyluna/create_dd/content/items/equipment/handheld_nozzle/HandheldNozzleRenderer.java @@ -0,0 +1,82 @@ +package uwu.lopyluna.create_dd.content.items.equipment.handheld_nozzle; + +import com.jozufozu.flywheel.core.PartialModel; +import com.jozufozu.flywheel.util.AnimationTickHolder; +import com.jozufozu.flywheel.util.transform.TransformStack; +import com.mojang.blaze3d.vertex.PoseStack; +import com.simibubi.create.foundation.item.render.CustomRenderedItemModel; +import com.simibubi.create.foundation.item.render.CustomRenderedItemModelRenderer; +import com.simibubi.create.foundation.item.render.PartialItemModelRenderer; +import com.simibubi.create.foundation.render.RenderTypes; +import com.simibubi.create.foundation.utility.Couple; +import com.simibubi.create.foundation.utility.DyeHelper; +import net.minecraft.client.Minecraft; +import net.minecraft.client.player.LocalPlayer; +import net.minecraft.client.renderer.LightTexture; +import net.minecraft.client.renderer.MultiBufferSource; +import net.minecraft.client.renderer.block.model.ItemTransforms; +import net.minecraft.client.resources.model.BakedModel; +import net.minecraft.nbt.CompoundTag; +import net.minecraft.util.Mth; +import net.minecraft.world.item.DyeColor; +import net.minecraft.world.item.ItemStack; +import net.minecraft.world.phys.Vec3; +import uwu.lopyluna.create_dd.DesireUtil; + +import static java.lang.Math.max; +import static uwu.lopyluna.create_dd.DesireUtil.randomChance; + +public class HandheldNozzleRenderer extends CustomRenderedItemModelRenderer { + protected static final PartialModel ITEM = new PartialModel(DesireUtil.asResource("item/handheld_nozzle/item")); + protected static final PartialModel GREEN = new PartialModel(DesireUtil.asResource("item/handheld_nozzle/glow_green")); + protected static final PartialModel RED = new PartialModel(DesireUtil.asResource("item/handheld_nozzle/glow_red")); + protected static final PartialModel GEAR = new PartialModel(DesireUtil.asResource("item/handheld_nozzle/gear")); + + private static final Vec3 GEAR_ROTATION_OFFSET = new Vec3(0, -3 / 16f, 1 / 16f); + + @Override + protected void render(ItemStack stack, CustomRenderedItemModel model, PartialItemModelRenderer renderer, ItemTransforms.TransformType transformType, + PoseStack ms, MultiBufferSource buffer, int light, int overlay) { + + if (!(stack.getItem() instanceof HandheldNozzleItem item)) + return; + CompoundTag nbt = stack.getOrCreateTag(); + + TransformStack stacker = TransformStack.cast(ms); + float worldTime = AnimationTickHolder.getRenderTime(); + LocalPlayer player = Minecraft.getInstance().player; + assert player != null; + boolean mainHand = player.getMainHandItem() == stack; + boolean offHand = player.getOffhandItem() == stack; + boolean flag1 = (mainHand || offHand) && item.getIsActive(nbt); + boolean flag2 = (mainHand || offHand) && item.getIsBlowing(nbt); + + renderer.render(ITEM.get(), light); + + ms.pushPose(); + Couple couple = DyeHelper.DYE_TABLE.get(flag1 ? DyeColor.LIME : DyeColor.RED); + int brightColor = couple.getFirst(); + int darkColor = couple.getSecond(); + int color = randomChance(10) ? darkColor : brightColor; + + float multiplier = -Mth.sin(worldTime * .25f % 360); + int lightIntensity = (int) (15 * Mth.clamp(multiplier, 0.5, 1)); + int glowLight = LightTexture.pack(lightIntensity, max(lightIntensity, 4)); + BakedModel glow = flag1 ? GREEN.get() : RED.get(); + buffer.getBuffer(RenderTypes.getAdditive()).color(color); + renderer.render(glow, RenderTypes.getAdditive(), glowLight); + + ms.popPose(); + + ms.pushPose(); + float angle = worldTime * (flag1 ? 10 : .5f) % 360; + stacker.translate(GEAR_ROTATION_OFFSET) + .rotateZ(flag2 ? angle : -angle) + .translateBack(GEAR_ROTATION_OFFSET); + renderer.render(GEAR.get(), light); + ms.popPose(); + + + + } +} \ No newline at end of file diff --git a/src/main/java/uwu/lopyluna/create_dd/content/items/equipment/portable_fan/PortableFanItem.java b/src/main/java/uwu/lopyluna/create_dd/content/items/equipment/portable_fan/PortableFanItem.java deleted file mode 100644 index b2636f3c..00000000 --- a/src/main/java/uwu/lopyluna/create_dd/content/items/equipment/portable_fan/PortableFanItem.java +++ /dev/null @@ -1,113 +0,0 @@ -package uwu.lopyluna.create_dd.content.items.equipment.portable_fan; - -import com.simibubi.create.AllSoundEvents; -import net.minecraft.MethodsReturnNonnullByDefault; -import net.minecraft.network.chat.Component; -import net.minecraft.sounds.SoundSource; -import net.minecraft.world.InteractionHand; -import net.minecraft.world.InteractionResultHolder; -import net.minecraft.world.entity.Entity; -import net.minecraft.world.entity.LivingEntity; -import net.minecraft.world.entity.player.Player; -import net.minecraft.world.item.Item; -import net.minecraft.world.item.ItemStack; -import net.minecraft.world.item.UseAnim; -import net.minecraft.world.level.Level; -import net.minecraft.world.phys.AABB; -import net.minecraft.world.phys.Vec3; - -import javax.annotation.ParametersAreNonnullByDefault; -import java.util.List; - -@ParametersAreNonnullByDefault -@MethodsReturnNonnullByDefault -@SuppressWarnings({"deprecation"}) -public class PortableFanItem extends Item { - private FanMode mode = FanMode.VACUUMING; - private boolean isActive = false; - - public PortableFanItem(Properties properties) { - super(properties); - } - - public enum FanMode { - VACUUMING, - BLOWING - } - - @Override - public InteractionResultHolder use(Level level, Player player, InteractionHand hand) { - ItemStack itemStack = player.getItemInHand(hand); - - if (player.isShiftKeyDown()) { - if (!level.isClientSide) { - mode = (mode == FanMode.VACUUMING) ? FanMode.BLOWING : FanMode.VACUUMING; - player.displayClientMessage(Component.literal("Mode switched to: " + mode), true); - level.playSound(null, player.blockPosition(), AllSoundEvents.CONFIRM.getMainEvent(), SoundSource.PLAYERS, 1.0F, 1.0F); - } - } else { - player.startUsingItem(hand); - isActive = true; - } - return InteractionResultHolder.sidedSuccess(itemStack, level.isClientSide()); - } - - @Override - public void onUseTick(Level level, LivingEntity entity, ItemStack stack, int count) { - if (entity instanceof Player player) { - if (isActive && !player.isShiftKeyDown()) { - if (mode == FanMode.VACUUMING) { - handleVacuuming(level, player); - } else { - handleBlowing(level, player); - } - } - } - } - - @Override - public void releaseUsing(ItemStack stack, Level level, LivingEntity entity, int timeLeft) { - isActive = false; - } - - @Override - public int getUseDuration(ItemStack stack) { - return 72000; - } - - @Override - public UseAnim getUseAnimation(ItemStack stack) { - return UseAnim.NONE; - } - - private void handleVacuuming(Level level, Player player) { - Vec3 playerPos = player.position(); - AABB range = new AABB(playerPos.subtract(16, 16, 16), playerPos.add(16, 16, 16)); // 16-block range - List entities = level.getEntities(player, range); - - for (Entity entity : entities) { - double distance = playerPos.distanceTo(entity.position()); - - if (distance <= 2.0) { - continue; - } - - Vec3 direction = playerPos.subtract(entity.position()).normalize(); - double strength = Math.max(0, (1 - (distance / 16)) * 0.5); - entity.push(direction.x * strength, direction.y * strength, direction.z * strength); - } - } - - private void handleBlowing(Level level, Player player) { - Vec3 playerPos = player.position(); - AABB range = new AABB(playerPos.subtract(16, 16, 16), playerPos.add(16, 16, 16)); - List entities = level.getEntities(player, range); - - for (Entity entity : entities) { - Vec3 direction = entity.position().subtract(playerPos).normalize(); - double distance = playerPos.distanceTo(entity.position()); - double strength = Math.max(0, (1 - (distance / 16)) * 0.5); - entity.push(direction.x * strength, direction.y * strength, direction.z * strength); - } - } -} \ No newline at end of file diff --git a/src/main/java/uwu/lopyluna/create_dd/events/RemapHelperDesires.java b/src/main/java/uwu/lopyluna/create_dd/events/RemapHelperDesires.java index 87c21566..7be6ee40 100644 --- a/src/main/java/uwu/lopyluna/create_dd/events/RemapHelperDesires.java +++ b/src/main/java/uwu/lopyluna/create_dd/events/RemapHelperDesires.java @@ -38,7 +38,8 @@ public class RemapHelperDesires { reMap.put("incomplete_inductive_mechanism", INCOMPLETE_KINETIC_MECHANISM.getId()); reMap.put("lapis_alloy", BURY_BLEND.getId()); - reMap.put("magnet", PORTABLE_FAN.getId()); + reMap.put("magnet", HANDHELD_NOZZLE.getId()); + reMap.put("portable_fan", HANDHELD_NOZZLE.getId()); reMap.put("block_zapper", BLOCK_ZAPPER.getId()); } diff --git a/src/main/java/uwu/lopyluna/create_dd/infrastructure/config/DCommon.java b/src/main/java/uwu/lopyluna/create_dd/infrastructure/config/DCommon.java new file mode 100644 index 00000000..adf04849 --- /dev/null +++ b/src/main/java/uwu/lopyluna/create_dd/infrastructure/config/DCommon.java @@ -0,0 +1,19 @@ +package uwu.lopyluna.create_dd.infrastructure.config; + + +import com.simibubi.create.foundation.config.ConfigBase; + +@SuppressWarnings("unused") +public class DCommon extends ConfigBase { + + public final DWorldGen worldGen = nested(0, DWorldGen::new, Comments.worldGen); + + @Override + public String getName() { + return "common"; + } + + private static class Comments { + static String worldGen = "Modify Create's impact on your terrain"; + } +} diff --git a/src/main/java/uwu/lopyluna/create_dd/infrastructure/config/DEquipment.java b/src/main/java/uwu/lopyluna/create_dd/infrastructure/config/DEquipment.java index ffdadf19..12cfe385 100644 --- a/src/main/java/uwu/lopyluna/create_dd/infrastructure/config/DEquipment.java +++ b/src/main/java/uwu/lopyluna/create_dd/infrastructure/config/DEquipment.java @@ -7,7 +7,11 @@ public class DEquipment extends ConfigBase { //Plans to change this //public final ConfigInt maxSymmetryWandRange = i(50, 10, "maxSymmetryWandRange", Comments.symmetryRange);* -// public final ConfigInt excavationDrillMaximumBlocks = i(64, "excavationDrillMaximumBlocks", Comments.excavationDrillMaximumBlocks);* + public final ConfigInt excavationDrillMaximumBlocks = i(64, "excavationDrillMaximumBlocks", Comments.excavationDrillMaximumBlocks); + public final ConfigFloat handheldNozzleRangePlayer = f(8, 1, 512, "handheldNozzleRangePlayer", Comments.handheldNozzleRangePlayer); + public final ConfigFloat handheldNozzleRange = f(16, 1, 512, "handheldNozzleRange", Comments.handheldNozzleRange); + public final ConfigFloat handheldNozzleSpeedLimit = f(2, 0, 512, "handheldNozzleSpeedLimit", Comments.handheldNozzleRange); + // public final ConfigInt deforestingSawMaximumBlocks = i(128, "deforestingSawMaximumBlocks", Comments.deforestingSawMaximumBlocks);* // public final ConfigInt backpackRange = i(4, 1, "backpackRange", Comments.backpackRange);* // public final ConfigInt zapperUndoLogLength = i(5, 0, "zapperUndoLogLength", Comments.zapperUndoLogLength); @@ -19,6 +23,10 @@ public String getName() { private static class Comments { //static String symmetryRange = "The Maximum Distance to an active mirror for the symmetry wand to trigger."; + static String handheldNozzleRange = + "The Maximum Distance at which a Hand Held Nozzle can push/pull Entities."; + static String handheldNozzleRangePlayer = + "The Maximum Distance at which a Hand Held Nozzle can push/pull your Player."; static String excavationDrillMaximumBlocks = "The Maximum Amount of Blocks a Excavation Drill can Handle."; static String deforestingSawMaximumBlocks = diff --git a/src/main/java/uwu/lopyluna/create_dd/infrastructure/config/DServer.java b/src/main/java/uwu/lopyluna/create_dd/infrastructure/config/DServer.java index 03b061a8..1e819165 100644 --- a/src/main/java/uwu/lopyluna/create_dd/infrastructure/config/DServer.java +++ b/src/main/java/uwu/lopyluna/create_dd/infrastructure/config/DServer.java @@ -7,13 +7,13 @@ public class DServer extends ConfigBase { public final ConfigGroup World = group(0, "World", "World"); public final ConfigInt chanceForOreStone = i(25, 1, 100, "chanceForOreStone", Comments.chanceForOreStone); - public final ConfigInt chanceForArtificialOreStone = i(5, 1, 100, "chanceForArtificialOreStone", Comments.chanceForArtificialOreStone); + public final ConfigInt chanceForArtificialOreStone = i(5, 0, 100, "chanceForArtificialOreStone", Comments.chanceForArtificialOreStone); public final ConfigGroup infrastructure = group(0, "infrastructure", Comments.infrastructure); public final DRecipes recipes = nested(0, DRecipes::new, Comments.recipes); public final DKinetics kinetics = nested(0, DKinetics::new, Comments.kinetics); public final DLogistics logistics = nested(0, DLogistics::new, Comments.logistics); - //public final DEquipment equipment = nested(0, DEquipment::new, Comments.equipment);* + public final DEquipment equipment = nested(0, DEquipment::new, Comments.equipment); @Override public String getName() { diff --git a/src/main/java/uwu/lopyluna/create_dd/infrastructure/config/DWorldGen.java b/src/main/java/uwu/lopyluna/create_dd/infrastructure/config/DWorldGen.java new file mode 100644 index 00000000..15c22d92 --- /dev/null +++ b/src/main/java/uwu/lopyluna/create_dd/infrastructure/config/DWorldGen.java @@ -0,0 +1,28 @@ +package uwu.lopyluna.create_dd.infrastructure.config; + +import com.simibubi.create.foundation.config.ConfigBase; +import net.minecraftforge.common.ForgeConfigSpec; +import uwu.lopyluna.create_dd.registry.DesiresOreFeaturesEntries; + +@SuppressWarnings("unused") +public class DWorldGen extends ConfigBase { + + public static final int FORCED_UPDATE_VERSION = 2; + + public final ConfigBase.ConfigBool disable = b(false, "disableWorldGen", Comments.disable); + + @Override + public void registerAll(ForgeConfigSpec.Builder builder) { + super.registerAll(builder); + DesiresOreFeaturesEntries.fillConfig(builder); + } + + @Override + public String getName() { + return "worldgen.v" + FORCED_UPDATE_VERSION; + } + + private static class Comments { + static String disable = "Prevents all worldgen added by Create from taking effect"; + } +} diff --git a/src/main/java/uwu/lopyluna/create_dd/infrastructure/config/DesiresConfigs.java b/src/main/java/uwu/lopyluna/create_dd/infrastructure/config/DesiresConfigs.java index 4ea063a0..d7f4523f 100644 --- a/src/main/java/uwu/lopyluna/create_dd/infrastructure/config/DesiresConfigs.java +++ b/src/main/java/uwu/lopyluna/create_dd/infrastructure/config/DesiresConfigs.java @@ -21,16 +21,15 @@ public class DesiresConfigs { private static final Map CONFIGS = new EnumMap<>(ModConfig.Type.class); + private static DCommon common; private static DClient client; private static DServer server; - public static DClient client() { - return client; - } + public static DClient client() { return client; } - public static DServer server() { - return server; - } + public static DCommon common() { return common; } + + public static DServer server() { return server; } public static ConfigBase byType(ModConfig.Type type) { return CONFIGS.get(type); @@ -51,6 +50,7 @@ private static T register(Supplier factory, ModConfig. public static void register(ModLoadingContext context) { client = register(DClient::new, ModConfig.Type.CLIENT); + common = register(DCommon::new, ModConfig.Type.COMMON); server = register(DServer::new, ModConfig.Type.SERVER); for (Entry pair : CONFIGS.entrySet()) diff --git a/src/main/java/uwu/lopyluna/create_dd/infrastructure/gui/DesiresBaseConfigScreen.java b/src/main/java/uwu/lopyluna/create_dd/infrastructure/gui/DesiresBaseConfigScreen.java index 3f7b7b2c..44e33b2f 100644 --- a/src/main/java/uwu/lopyluna/create_dd/infrastructure/gui/DesiresBaseConfigScreen.java +++ b/src/main/java/uwu/lopyluna/create_dd/infrastructure/gui/DesiresBaseConfigScreen.java @@ -37,8 +37,8 @@ public class DesiresBaseConfigScreen extends DesiresConfigScreen { static { DEFAULTS.put(MOD_ID, (base) -> base - .withTitles("Client Settings", "Gameplay Settings") - .withSpecs(DesiresConfigs.client().specification, DesiresConfigs.server().specification) + .withTitles("Client Settings", "World Generation Settings", "Gameplay Settings") + .withSpecs(DesiresConfigs.client().specification, DesiresConfigs.common().specification, DesiresConfigs.server().specification) ); } @@ -102,16 +102,20 @@ public void searchForSpecsInModContainer() { } - public DesiresBaseConfigScreen withSpecs(@Nullable ForgeConfigSpec client, @Nullable ForgeConfigSpec server) { + public DesiresBaseConfigScreen withSpecs(@Nullable ForgeConfigSpec client, ForgeConfigSpec common, @Nullable ForgeConfigSpec server) { clientSpec = client; + commonSpec = common; serverSpec = server; return this; } - public DesiresBaseConfigScreen withTitles(@Nullable String client, @Nullable String server) { + public DesiresBaseConfigScreen withTitles(@Nullable String client, String common, @Nullable String server) { if (client != null) clientTitle = client; + if (common != null) + commonTitle = common; + if (server != null) serverTitle = server; diff --git a/src/main/java/uwu/lopyluna/create_dd/registry/DesiresItems.java b/src/main/java/uwu/lopyluna/create_dd/registry/DesiresItems.java index aa19a7b7..cefaa8ac 100644 --- a/src/main/java/uwu/lopyluna/create_dd/registry/DesiresItems.java +++ b/src/main/java/uwu/lopyluna/create_dd/registry/DesiresItems.java @@ -26,7 +26,7 @@ import uwu.lopyluna.create_dd.content.items.equipment.deforester_saw.DeforesterSawItem; import uwu.lopyluna.create_dd.content.items.equipment.excavation_drill.ExcavationDrillItem; import uwu.lopyluna.create_dd.content.items.equipment.gilded_rose_tools.*; -import uwu.lopyluna.create_dd.content.items.equipment.portable_fan.PortableFanItem; +import uwu.lopyluna.create_dd.content.items.equipment.handheld_nozzle.HandheldNozzleItem; import uwu.lopyluna.create_dd.content.items.materials.ChromaticCompound; import uwu.lopyluna.create_dd.content.items.materials.RefinedRadiance; import uwu.lopyluna.create_dd.content.items.materials.ShadowSteel; @@ -314,10 +314,9 @@ public class DesiresItems { .tag(DesiresTags.AllItemTags.CROSSBOW.tag) .register(); - public static final ItemEntry PORTABLE_FAN = REGISTRATE.item("portable_fan", PortableFanItem::new) - .tab(() -> DesiresCreativeModeTabs.BETA_CREATIVE_TAB) - .model((c, p) -> {}) - //.model(AssetLookup.itemModelWithPartials()) + public static final ItemEntry HANDHELD_NOZZLE = REGISTRATE.item("handheld_nozzle", HandheldNozzleItem::new) + .tab(() -> DesiresCreativeModeTabs.BASE_CREATIVE_TAB) + .model(AssetLookup.itemModelWithPartials()) .properties(p -> p.rarity(Rarity.UNCOMMON)) .register(); diff --git a/src/main/java/uwu/lopyluna/create_dd/registry/DesiresOreFeaturesEntries.java b/src/main/java/uwu/lopyluna/create_dd/registry/DesiresOreFeaturesEntries.java index 418ad38c..ace97bdf 100644 --- a/src/main/java/uwu/lopyluna/create_dd/registry/DesiresOreFeaturesEntries.java +++ b/src/main/java/uwu/lopyluna/create_dd/registry/DesiresOreFeaturesEntries.java @@ -4,10 +4,13 @@ import com.simibubi.create.foundation.utility.Couple; import com.simibubi.create.infrastructure.worldgen.OreFeatureConfigEntry; import net.minecraft.tags.BiomeTags; +import net.minecraftforge.common.ForgeConfigSpec; import uwu.lopyluna.create_dd.DesireUtil; import java.util.Objects; +import static uwu.lopyluna.create_dd.DesiresCreate.MOD_ID; + @SuppressWarnings({"unused", "SameParameterValue"}) public class DesiresOreFeaturesEntries { @@ -28,4 +31,16 @@ private static OreFeatureConfigEntry create(String name, int clusterSize, float } public static void init() {} + + + public static void fillConfig(ForgeConfigSpec.Builder builder) { + OreFeatureConfigEntry.ALL + .forEach((id, entry) -> { + if (id.getNamespace().equals(MOD_ID)) { + builder.push(entry.getName()); + entry.addToConfig(builder); + builder.pop(); + } + }); + } } diff --git a/src/main/resources/assets/create_dd/models/item/handheld_nozzle/gear.json b/src/main/resources/assets/create_dd/models/item/handheld_nozzle/gear.json new file mode 100644 index 00000000..25fb4edd --- /dev/null +++ b/src/main/resources/assets/create_dd/models/item/handheld_nozzle/gear.json @@ -0,0 +1,67 @@ +{ + "credit": "Made with Blockbench", + "parent": "create_dd:item/handheld_nozzle/item", + "texture_size": [32, 32], + "textures": { + "11": "create_dd:block/industrial_fan_cogwheel", + "particle": "create:block/contraption_controls_frame" + }, + "elements": [ + { + "name": "Cog", + "from": [7, 1, 7], + "to": [9, 9, 11], + "rotation": {"angle": 0, "axis": "y", "origin": [7.5, 7.5, 14]}, + "faces": { + "north": {"uv": [12, 15, 16, 16], "rotation": 90, "texture": "#11"}, + "east": {"uv": [12, 14, 15.5, 16], "rotation": 90, "texture": "#11"}, + "south": {"uv": [12, 15, 16, 16], "rotation": 90, "texture": "#11"}, + "west": {"uv": [12, 14, 15.5, 16], "rotation": 90, "texture": "#11"}, + "up": {"uv": [15, 5.5, 16, 7.5], "rotation": 180, "texture": "#11"}, + "down": {"uv": [15, 5.5, 16, 7.5], "rotation": 180, "texture": "#11"} + } + }, + { + "name": "Cog", + "from": [4, 4, 7], + "to": [12, 6, 11], + "rotation": {"angle": 0, "axis": "y", "origin": [8, 5, 10]}, + "faces": { + "north": {"uv": [12, 15, 16, 16], "texture": "#11"}, + "east": {"uv": [12.5, 7, 14.5, 8], "rotation": 180, "texture": "#11"}, + "south": {"uv": [12, 15, 16, 16], "texture": "#11"}, + "west": {"uv": [12.5, 7, 14.5, 8], "rotation": 180, "texture": "#11"}, + "up": {"uv": [12, 14, 15.5, 16], "texture": "#11"}, + "down": {"uv": [12, 14, 15.5, 16], "texture": "#11"} + } + }, + { + "name": "Cog", + "from": [7, 1, 7], + "to": [9, 9, 11], + "rotation": {"angle": 45, "axis": "z", "origin": [8, 5, 10]}, + "faces": { + "north": {"uv": [12, 15, 16, 16], "rotation": 90, "texture": "#11"}, + "east": {"uv": [12, 14, 15.5, 16], "rotation": 90, "texture": "#11"}, + "south": {"uv": [12, 15, 16, 16], "rotation": 90, "texture": "#11"}, + "west": {"uv": [12, 14, 15.5, 16], "rotation": 90, "texture": "#11"}, + "up": {"uv": [15, 5.5, 16, 7.5], "rotation": 180, "texture": "#11"}, + "down": {"uv": [15, 5.5, 16, 7.5], "rotation": 180, "texture": "#11"} + } + }, + { + "name": "Cog", + "from": [7, 1, 7], + "to": [9, 9, 11], + "rotation": {"angle": -45, "axis": "z", "origin": [8, 5, 10]}, + "faces": { + "north": {"uv": [12, 15, 16, 16], "rotation": 90, "texture": "#11"}, + "east": {"uv": [12, 14, 15.5, 16], "rotation": 90, "texture": "#11"}, + "south": {"uv": [12, 15, 16, 16], "rotation": 90, "texture": "#11"}, + "west": {"uv": [12, 14, 15.5, 16], "rotation": 90, "texture": "#11"}, + "up": {"uv": [15, 5.5, 16, 7.5], "rotation": 180, "texture": "#11"}, + "down": {"uv": [15, 5.5, 16, 7.5], "rotation": 180, "texture": "#11"} + } + } + ] +} \ No newline at end of file diff --git a/src/main/resources/assets/create_dd/models/item/handheld_nozzle/glow_green.json b/src/main/resources/assets/create_dd/models/item/handheld_nozzle/glow_green.json new file mode 100644 index 00000000..9728189e --- /dev/null +++ b/src/main/resources/assets/create_dd/models/item/handheld_nozzle/glow_green.json @@ -0,0 +1,22 @@ +{ + "credit": "Made with Blockbench", + "parent": "create_dd:item/handheld_nozzle/item", + "textures": { + "1": "create_dd:block/signal_glow", + "particle": "create_dd:block/signal_glow" + }, + "elements": [ + { + "from": [6, 7.5, 0.5], + "to": [10, 10.5, 3.5], + "rotation": {"angle": 0, "axis": "y", "origin": [0, -4, -5]}, + "faces": { + "north": {"uv": [15, 3, 11, 0], "texture": "#1"}, + "east": {"uv": [11, 0, 14, 3], "texture": "#1"}, + "south": {"uv": [11, 0, 15, 3], "texture": "#1"}, + "west": {"uv": [12, 0, 15, 3], "texture": "#1"}, + "up": {"uv": [11, 3, 15, 0], "texture": "#1"} + } + } + ] +} \ No newline at end of file diff --git a/src/main/resources/assets/create_dd/models/item/handheld_nozzle/glow_red.json b/src/main/resources/assets/create_dd/models/item/handheld_nozzle/glow_red.json new file mode 100644 index 00000000..e22f0a7a --- /dev/null +++ b/src/main/resources/assets/create_dd/models/item/handheld_nozzle/glow_red.json @@ -0,0 +1,22 @@ +{ + "credit": "Made with Blockbench", + "parent": "create_dd:item/handheld_nozzle/item", + "textures": { + "1": "create:block/signal_glow", + "particle": "create:block/signal_glow" + }, + "elements": [ + { + "from": [6, 7.5, 0.5], + "to": [10, 10.5, 3.5], + "rotation": {"angle": 0, "axis": "y", "origin": [0, -4, -5]}, + "faces": { + "north": {"uv": [15, 3, 11, 0], "texture": "#1"}, + "east": {"uv": [11, 0, 14, 3], "texture": "#1"}, + "south": {"uv": [11, 0, 15, 3], "texture": "#1"}, + "west": {"uv": [12, 0, 15, 3], "texture": "#1"}, + "up": {"uv": [11, 3, 15, 0], "texture": "#1"} + } + } + ] +} \ No newline at end of file diff --git a/src/main/resources/assets/create_dd/models/item/handheld_nozzle/item.json b/src/main/resources/assets/create_dd/models/item/handheld_nozzle/item.json new file mode 100644 index 00000000..4096152e --- /dev/null +++ b/src/main/resources/assets/create_dd/models/item/handheld_nozzle/item.json @@ -0,0 +1,224 @@ +{ + "credit": "Made with Blockbench", + "parent": "minecraft:block/block", + "texture_size": [64, 64], + "textures": { + "4": "create:block/engine", + "5": "create:block/copper_backtank", + "6": "create:block/portable_fluid_interface", + "8": "create:item/potato_cannon", + "11": "create:block/net", + "particle": "create:block/copper_casing" + }, + "elements": [ + { + "from": [0.55, 1.7, 15], + "to": [6.15, 7.3, 27], + "rotation": {"angle": -45, "axis": "z", "origin": [0, -3.5, 1]}, + "faces": { + "east": {"uv": [6, 9.25, 3, 10.75], "rotation": 180, "texture": "#8"}, + "south": {"uv": [4.5, 6, 3, 7.5], "rotation": 270, "texture": "#8"}, + "west": {"uv": [4, 3.5, 1, 2], "rotation": 180, "texture": "#8"}, + "up": {"uv": [1, 3.5, 4, 2], "rotation": 90, "texture": "#8"}, + "down": {"uv": [3, 9.25, 6, 10.75], "rotation": 90, "texture": "#8"} + } + }, + { + "from": [0.55, 1.7, 3], + "to": [6.15, 7.3, 15], + "rotation": {"angle": -45, "axis": "z", "origin": [0, -3.5, -11]}, + "faces": { + "east": {"uv": [3, 9.25, 6, 10.75], "rotation": 180, "texture": "#8"}, + "west": {"uv": [4, 3.5, 1, 2], "rotation": 180, "texture": "#8"}, + "up": {"uv": [1, 3.5, 4, 2], "rotation": 90, "texture": "#8"}, + "down": {"uv": [6, 9.25, 3, 10.75], "rotation": 90, "texture": "#8"} + } + }, + { + "from": [4, 8, 10], + "to": [12, 10, 12], + "rotation": {"angle": 0, "axis": "y", "origin": [0, -4, 4]}, + "faces": { + "north": {"uv": [8, 3.5, 8.5, 5.5], "rotation": 90, "texture": "#8"}, + "east": {"uv": [8.25, 5, 8.75, 5.5], "rotation": 90, "texture": "#8"}, + "south": {"uv": [8.25, 3.5, 8.75, 5.5], "rotation": 90, "texture": "#8"}, + "west": {"uv": [8.25, 3.5, 8.75, 4], "rotation": 90, "texture": "#8"}, + "up": {"uv": [8.75, 3.5, 8.25, 5.5], "rotation": 90, "texture": "#8"} + } + }, + { + "from": [4, 8, 1], + "to": [6, 10, 3], + "rotation": {"angle": 0, "axis": "y", "origin": [0, -4, -5]}, + "faces": { + "south": {"uv": [8.25, 5, 8.75, 5.5], "rotation": 90, "texture": "#8"}, + "west": {"uv": [8.25, 3.5, 8.75, 4], "rotation": 90, "texture": "#8"}, + "up": {"uv": [8.75, 5, 8.25, 5.5], "rotation": 90, "texture": "#8"} + } + }, + { + "from": [10, 8, 1], + "to": [12, 10, 3], + "rotation": {"angle": 0, "axis": "y", "origin": [0, -4, -5]}, + "faces": { + "east": {"uv": [8.25, 5, 8.75, 5.5], "rotation": 90, "texture": "#8"}, + "south": {"uv": [8.25, 3.5, 8.75, 4], "rotation": 90, "texture": "#8"}, + "up": {"uv": [8.75, 3.5, 8.25, 4], "rotation": 90, "texture": "#8"} + } + }, + { + "from": [6, 8, 1], + "to": [10, 10, 3], + "rotation": {"angle": 0, "axis": "y", "origin": [0, -4, -5]}, + "faces": { + "south": {"uv": [2.75, 2.5, 3.75, 3], "texture": "#8"}, + "up": {"uv": [2.75, 2.75, 3.75, 2.25], "texture": "#8"} + } + }, + { + "from": [4, 0, 10], + "to": [12, 8, 20], + "rotation": {"angle": 0, "axis": "y", "origin": [8, 6.6, 10.5]}, + "faces": { + "north": {"uv": [10, 3.5, 12, 5.5], "texture": "#8"}, + "east": {"uv": [9.5, 1, 7, 3], "texture": "#8"}, + "south": {"uv": [10, 1, 12, 3], "texture": "#8"}, + "west": {"uv": [7, 1, 9.5, 3], "texture": "#8"}, + "up": {"uv": [7, 3.5, 9.5, 5.5], "rotation": 90, "texture": "#8"}, + "down": {"uv": [7, 6, 9.5, 8], "rotation": 90, "texture": "#8"} + } + }, + { + "from": [4, -5.8, -4], + "to": [12, 2.2, 6], + "rotation": {"angle": 0, "axis": "x", "origin": [8, -4.4, 5.5]}, + "faces": { + "north": {"uv": [10, 3, 12, 1], "rotation": 180, "texture": "#8"}, + "east": {"uv": [9.5, 3, 7, 1], "rotation": 180, "texture": "#8"}, + "south": {"uv": [10, 5.5, 12, 3.5], "rotation": 180, "texture": "#8"}, + "west": {"uv": [7, 3, 9.5, 1], "rotation": 180, "texture": "#8"}, + "down": {"uv": [7, 6, 9.5, 8], "rotation": 90, "texture": "#8"} + } + }, + { + "from": [1, -1, -7], + "to": [15, 5, 1], + "rotation": {"angle": 0, "axis": "x", "origin": [8, 1.6, 0.5]}, + "faces": { + "north": {"uv": [8.5, 15.5, 15.5, 12.5], "rotation": 180, "texture": "#4"}, + "east": {"uv": [8, 1, 12, 4], "texture": "#5"}, + "south": {"uv": [8.5, 12.5, 15.5, 15.5], "rotation": 180, "texture": "#4"}, + "west": {"uv": [8, 1, 12, 4], "texture": "#5"}, + "down": {"uv": [8.5, 12.5, 15.5, 8.5], "texture": "#4"} + } + }, + { + "from": [1, 5, -9], + "to": [15, 10, 1], + "rotation": {"angle": 0, "axis": "x", "origin": [8, 0.6, 0.5]}, + "faces": { + "north": {"uv": [8.5, 11, 15.5, 8.5], "rotation": 180, "texture": "#4"}, + "east": {"uv": [8.5, 4, 3.5, 1.5], "texture": "#5"}, + "south": {"uv": [5.5, 9, 8, 16], "rotation": 90, "texture": "#6"}, + "west": {"uv": [3.5, 4, 8.5, 1.5], "texture": "#5"}, + "up": {"uv": [0, 9, 5, 16], "rotation": 90, "texture": "#6"}, + "down": {"uv": [8.5, 9.5, 15.5, 14.5], "texture": "#4"} + } + }, + { + "from": [9.5, 2, 1], + "to": [12.5, 8, 6], + "rotation": {"angle": 0, "axis": "y", "origin": [8.5, 5.6, 10.5]}, + "faces": { + "east": {"uv": [4, 2, 2.75, 3.5], "texture": "#8"}, + "south": {"uv": [10.75, 6, 11.5, 7.5], "texture": "#8"}, + "up": {"uv": [2.75, 1.5, 4, 0.75], "rotation": 90, "texture": "#8"}, + "down": {"uv": [4, 5.5, 2.75, 4.75], "rotation": 90, "texture": "#8"} + } + }, + { + "from": [3.5, 2, 1], + "to": [6.5, 8, 6], + "rotation": {"angle": 0, "axis": "y", "origin": [5.5, 5.6, 10.5]}, + "faces": { + "south": {"uv": [10, 6, 10.75, 7.5], "texture": "#8"}, + "west": {"uv": [4, 2, 2.75, 3.5], "texture": "#8"}, + "up": {"uv": [2.75, 0.75, 4, 0], "rotation": 90, "texture": "#8"}, + "down": {"uv": [4, 4.75, 2.75, 4], "rotation": 90, "texture": "#8"} + } + }, + { + "from": [6.5, 2, 1], + "to": [9.5, 8, 6], + "rotation": {"angle": 0, "axis": "y", "origin": [8.5, 5.6, 10.5]}, + "faces": { + "south": {"uv": [10.5, 6, 11, 7.5], "texture": "#8"}, + "up": {"uv": [2.75, 1, 4, 0.5], "rotation": 90, "texture": "#8"}, + "down": {"uv": [4, 5, 2.75, 4.5], "rotation": 90, "texture": "#8"} + } + }, + { + "name": "body", + "from": [2, 0, -13], + "to": [14, 8, 1], + "rotation": {"angle": 0, "axis": "x", "origin": [0, -2, 1]}, + "faces": { + "north": {"uv": [0, 6, 12, 14], "texture": "#11"}, + "east": {"uv": [2, 6, 16, 14], "texture": "#11"}, + "west": {"uv": [0, 6, 14, 14], "rotation": 180, "texture": "#11"}, + "up": {"uv": [0, 6, 14, 14], "rotation": 270, "texture": "#11"}, + "down": {"uv": [0, 6, 14, 14], "rotation": 90, "texture": "#11"} + } + }, + { + "name": "body", + "from": [4, 2, -11], + "to": [12, 7, 1], + "rotation": {"angle": 0, "axis": "x", "origin": [0, -2, 1]}, + "faces": { + "north": {"uv": [0, 2, 8, 10], "texture": "#11"}, + "east": {"uv": [2, 5, 14, 10], "texture": "#11"}, + "south": {"uv": [0, 0, 8, 8], "texture": "#11"}, + "west": {"uv": [1, 5, 13, 10], "texture": "#11"}, + "up": {"uv": [0, 5, 12, 10], "rotation": 270, "texture": "#11"}, + "down": {"uv": [0, 5, 12, 10], "rotation": 90, "texture": "#11"} + } + } + ], + "display": { + "thirdperson_righthand": { + "rotation": [0, 5, 0], + "translation": [0, 1, -4], + "scale": [0.6, 0.6, 0.6] + }, + "thirdperson_lefthand": { + "rotation": [0, 5, 0], + "translation": [0, 1, -4], + "scale": [0.6, 0.6, 0.6] + }, + "firstperson_righthand": { + "rotation": [5, 5, 5], + "translation": [0.25, 5, 0], + "scale": [0.9, 0.9, 0.9] + }, + "firstperson_lefthand": { + "rotation": [5, 5, 5], + "translation": [0.25, 5, 0], + "scale": [0.9, 0.9, 0.9] + }, + "ground": { + "translation": [0, 1.5, 0], + "scale": [0.4, 0.4, 0.4] + }, + "gui": { + "rotation": [-23, 145, 0], + "translation": [0.75, 2.25, 0], + "scale": [0.525, 0.525, 0.525] + }, + "fixed": { + "rotation": [0, 90, 0], + "translation": [-0.25, 4, 0], + "scale": [0.9, 0.9, 0.9] + } + } +} \ No newline at end of file diff --git a/src/main/resources/assets/create_dd/textures/block/signal_glow.png b/src/main/resources/assets/create_dd/textures/block/signal_glow.png new file mode 100644 index 0000000000000000000000000000000000000000..b2ae766ff83459bb8daa39434379a610ce0a07a8 GIT binary patch literal 662 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`jKx9jP7LeL$-D$|SkfJR9T^xl z_H+M9WCij$3p^r=85sBugD~Uq{1quc!7Zr~o@t(*S_~XO4l9EcBP#1y9>D{Et&j&qw&1iw(6%h{l5Nsd-vD7zm{n8lUiOkD@eFX z%z6-iuHqH@^2Hset%bMbo=*AcxA0cJ+G+6(ED77!Wvel#M&1hlv1TUEivFoPnbxzN zn5)>NIMblb+PUTUgwA9?-hWYI9gAx>u>8B~w%JI4>C*MP3pKjl@Hn{rQvbC-JpH#Z zgJj3!8MBscG-ilAJpW}_z3FZ~h6zi01sW#{&NA61sC27SwIOMOLs{(fRjU^5dw+JJ z9$V+_7nMuGR4@AHb1#rkvAB`9eH(KukC6R>v(I)gcgPeSxNh+*LA|-Nxmj{Ss#24| p$0@tl8MkLVR%kN#skvVCFOy&DJD%_J9(IAEz|+;wWt~$(698y3*x>*G literal 0 HcmV?d00001