From 8d1c519d6598fba9a2ce3877cf1968d2a171fff5 Mon Sep 17 00:00:00 2001 From: LittleCircleOO <51949761+LittleCircleOO@users.noreply.github.com> Date: Wed, 8 Jan 2025 13:00:00 +0800 Subject: [PATCH 1/3] backport "wrench items direct to inventory" (57ee884d) --- .../block/basic/BlockLogisticalSorter.java | 2 +- .../common/block/prefab/BlockBase.java | 2 +- .../block/transmitter/BlockTransmitter.java | 2 +- .../common/tile/base/TileEntityMekanism.java | 2 +- .../java/mekanism/common/util/WorldUtils.java | 26 +++++++++++++------ 5 files changed, 22 insertions(+), 12 deletions(-) diff --git a/src/main/java/mekanism/common/block/basic/BlockLogisticalSorter.java b/src/main/java/mekanism/common/block/basic/BlockLogisticalSorter.java index ea631af1c8d..42c7de8fcfe 100644 --- a/src/main/java/mekanism/common/block/basic/BlockLogisticalSorter.java +++ b/src/main/java/mekanism/common/block/basic/BlockLogisticalSorter.java @@ -78,7 +78,7 @@ public InteractionResult use(@NotNull BlockState state, @NotNull Level world, @N return InteractionResult.FAIL; } if (player.isShiftKeyDown()) { - WorldUtils.dismantleBlock(state, world, pos); + WorldUtils.dismantleBlock(state, world, pos, player); return InteractionResult.SUCCESS; } Direction change = tile.getDirection().getClockWise(); diff --git a/src/main/java/mekanism/common/block/prefab/BlockBase.java b/src/main/java/mekanism/common/block/prefab/BlockBase.java index 5a881f865d9..0fcd3b3d85f 100644 --- a/src/main/java/mekanism/common/block/prefab/BlockBase.java +++ b/src/main/java/mekanism/common/block/prefab/BlockBase.java @@ -114,7 +114,7 @@ public InteractionResult use(@NotNull BlockState state, @NotNull Level world, @N @NotNull BlockHitResult hit) { if (player.isShiftKeyDown() && MekanismUtils.canUseAsWrench(player.getItemInHand(hand))) { if (!world.isClientSide) { - WorldUtils.dismantleBlock(state, world, pos); + WorldUtils.dismantleBlock(state, world, pos, player); } return InteractionResult.SUCCESS; } diff --git a/src/main/java/mekanism/common/block/transmitter/BlockTransmitter.java b/src/main/java/mekanism/common/block/transmitter/BlockTransmitter.java index f267649df27..9910c6780d3 100644 --- a/src/main/java/mekanism/common/block/transmitter/BlockTransmitter.java +++ b/src/main/java/mekanism/common/block/transmitter/BlockTransmitter.java @@ -77,7 +77,7 @@ public InteractionResult use(@NotNull BlockState state, @NotNull Level world, @N ItemStack stack = player.getItemInHand(hand); if (MekanismUtils.canUseAsWrench(stack) && player.isShiftKeyDown()) { if (!world.isClientSide) { - WorldUtils.dismantleBlock(state, world, pos); + WorldUtils.dismantleBlock(state, world, pos, player); } return InteractionResult.SUCCESS; } diff --git a/src/main/java/mekanism/common/tile/base/TileEntityMekanism.java b/src/main/java/mekanism/common/tile/base/TileEntityMekanism.java index aded6a45bb9..8cb3dd86eb7 100644 --- a/src/main/java/mekanism/common/tile/base/TileEntityMekanism.java +++ b/src/main/java/mekanism/common/tile/base/TileEntityMekanism.java @@ -495,7 +495,7 @@ public WrenchResult tryWrench(BlockState state, Player player, InteractionHand h return WrenchResult.NO_SECURITY; } if (player.isShiftKeyDown()) { - WorldUtils.dismantleBlock(state, getLevel(), worldPosition, this); + WorldUtils.dismantleBlock(state, getLevel(), worldPosition, this, player); return WrenchResult.DISMANTLED; } //Special ITileDirectional handling diff --git a/src/main/java/mekanism/common/util/WorldUtils.java b/src/main/java/mekanism/common/util/WorldUtils.java index 5ebb7b282d7..e5497444d18 100644 --- a/src/main/java/mekanism/common/util/WorldUtils.java +++ b/src/main/java/mekanism/common/util/WorldUtils.java @@ -21,6 +21,7 @@ import net.minecraft.sounds.SoundEvents; import net.minecraft.sounds.SoundSource; import net.minecraft.util.Mth; +import net.minecraft.world.entity.Entity; import net.minecraft.world.entity.player.Player; import net.minecraft.world.item.ItemStack; import net.minecraft.world.level.BlockAndTintGetter; @@ -362,19 +363,28 @@ public static void markChunkDirty(Level world, BlockPos pos) { } /** - * Dismantles a block, dropping it and removing it from the world. + * Dismantles a block, adding to player inventory (or dropping it) and removing it from the world. */ - public static void dismantleBlock(BlockState state, Level world, BlockPos pos) { - dismantleBlock(state, world, pos, getTileEntity(world, pos)); + public static void dismantleBlock(BlockState state, Level world, BlockPos pos, @Nullable Entity entity) { + dismantleBlock(state, world, pos, getTileEntity(world, pos), entity); } /** - * Dismantles a block, dropping it and removing it from the world. + * Dismantles a block, adding to player inventory (or dropping it) and removing it from the world. */ - public static void dismantleBlock(BlockState state, Level world, BlockPos pos, @Nullable BlockEntity tile) { - if (world instanceof ServerLevel level) {//Copy of Block#dropResources but skipping the xp dropping - Block.getDrops(state, level, pos, tile).forEach(stack -> Block.popResource(world, pos, stack)); - state.spawnAfterBreak(level, pos, ItemStack.EMPTY, false); + public static void dismantleBlock(BlockState state, Level world, BlockPos pos, @Nullable BlockEntity tile, @Nullable Entity entity) { + if (entity instanceof Player player) { + if (world instanceof ServerLevel) { + Block.getDrops(state, (ServerLevel) world, pos, tile, entity, ItemStack.EMPTY).forEach(dropStack -> { + if (player.getInventory().add(dropStack)) { + world.playSound(null, entity.getX(), entity.getY(), entity.getZ(), SoundEvents.ITEM_PICKUP, SoundSource.PLAYERS, 0.2F, (world.random.nextFloat() - world.random.nextFloat()) * 1.4F + 2.0F); + } else { + player.drop(dropStack, false); + } + }); + } + } else { + Block.dropResources(state, world, pos, tile, entity, ItemStack.EMPTY, false); } world.removeBlock(pos, false); } From fb901ea665e24213380d2dd198c8713d070f4a4d Mon Sep 17 00:00:00 2001 From: LittleCircleOO <51949761+LittleCircleOO@users.noreply.github.com> Date: Wed, 8 Jan 2025 13:30:29 +0800 Subject: [PATCH 2/3] backport "Don't allow using a wrench to dismantle radioactive blocks" (2aa0e29a) --- .../common/block/turbine/BlockTurbineRotor.java | 9 +++++---- .../java/mekanism/common/block/BlockMekanism.java | 9 +++++++-- .../java/mekanism/common/block/basic/BlockBin.java | 7 ++++--- .../mekanism/common/block/basic/BlockFluidTank.java | 9 +++++---- .../common/block/basic/BlockLogisticalSorter.java | 7 ++++++- .../common/block/basic/BlockStructuralGlass.java | 7 ++++--- .../mekanism/common/block/prefab/BlockBase.java | 1 + .../common/block/prefab/BlockBasicMultiblock.java | 7 ++++--- .../mekanism/common/block/prefab/BlockTile.java | 9 +++++---- .../common/tile/base/TileEntityMekanism.java | 4 ++++ .../mekanism/common/tile/base/WrenchResult.java | 13 ++++++++++++- 11 files changed, 57 insertions(+), 25 deletions(-) diff --git a/src/generators/java/mekanism/generators/common/block/turbine/BlockTurbineRotor.java b/src/generators/java/mekanism/generators/common/block/turbine/BlockTurbineRotor.java index 38a3f912278..46ce79fc0ba 100644 --- a/src/generators/java/mekanism/generators/common/block/turbine/BlockTurbineRotor.java +++ b/src/generators/java/mekanism/generators/common/block/turbine/BlockTurbineRotor.java @@ -2,7 +2,6 @@ import mekanism.common.block.prefab.BlockTile.BlockTileModel; import mekanism.common.content.blocktype.BlockTypeTile; -import mekanism.common.tile.base.WrenchResult; import mekanism.common.util.WorldUtils; import mekanism.generators.common.item.ItemTurbineBlade; import mekanism.generators.common.registries.GeneratorsBlockTypes; @@ -34,9 +33,11 @@ public InteractionResult use(@NotNull BlockState state, @NotNull Level world, @N if (tile == null) { return InteractionResult.PASS; } else if (world.isClientSide) { - return genericClientActivated(player, hand); - } else if (tile.tryWrench(state, player, hand, hit) != WrenchResult.PASS) { - return InteractionResult.SUCCESS; + return genericClientActivated(player, hand, tile); + } + InteractionResult wrenchResult = tile.tryWrench(state, player, hand, hit).getInteractionResult(); + if (wrenchResult != InteractionResult.PASS) { + return wrenchResult; } ItemStack stack = player.getItemInHand(hand); if (!player.isShiftKeyDown()) { diff --git a/src/main/java/mekanism/common/block/BlockMekanism.java b/src/main/java/mekanism/common/block/BlockMekanism.java index 1007921a85a..6871214568e 100644 --- a/src/main/java/mekanism/common/block/BlockMekanism.java +++ b/src/main/java/mekanism/common/block/BlockMekanism.java @@ -431,8 +431,13 @@ public void animateTick(@NotNull BlockState state, @NotNull Level world, @NotNul } } - protected InteractionResult genericClientActivated(@NotNull Player player, @NotNull InteractionHand hand) { - if (Attribute.has(this, AttributeGui.class) || MekanismUtils.canUseAsWrench(player.getItemInHand(hand))) { + protected InteractionResult genericClientActivated(@NotNull Player player, @NotNull InteractionHand hand, BlockEntity blockEntity) { + if (Attribute.has(this, AttributeGui.class)) { + return InteractionResult.SUCCESS; + } else if (MekanismUtils.canUseAsWrench(player.getItemInHand(hand))) { + if (blockEntity instanceof ITileRadioactive tileRadioactive && tileRadioactive.getRadiationScale() > 0) { + return InteractionResult.FAIL; + } return InteractionResult.SUCCESS; } return InteractionResult.PASS; diff --git a/src/main/java/mekanism/common/block/basic/BlockBin.java b/src/main/java/mekanism/common/block/basic/BlockBin.java index 7e8db3b6677..94b6cca8dc7 100644 --- a/src/main/java/mekanism/common/block/basic/BlockBin.java +++ b/src/main/java/mekanism/common/block/basic/BlockBin.java @@ -7,7 +7,6 @@ import mekanism.common.content.blocktype.BlockTypeTile; import mekanism.common.inventory.slot.BinInventorySlot; import mekanism.common.tile.TileEntityBin; -import mekanism.common.tile.base.WrenchResult; import mekanism.common.util.MekanismUtils; import mekanism.common.util.WorldUtils; import net.minecraft.core.BlockPos; @@ -81,8 +80,10 @@ public InteractionResult use(@NotNull BlockState state, @NotNull Level world, @N TileEntityBin bin = WorldUtils.getTileEntity(TileEntityBin.class, world, pos); if (bin == null) { return InteractionResult.PASS; - } else if (bin.tryWrench(state, player, hand, hit) != WrenchResult.PASS) { - return InteractionResult.SUCCESS; + } + InteractionResult wrenchResult = bin.tryWrench(state, player, hand, hit).getInteractionResult(); + if (wrenchResult != InteractionResult.PASS) { + return wrenchResult; } ItemStack stack = player.getItemInHand(hand); if (stack.isEmpty() && player.isShiftKeyDown() && hit.getDirection() == bin.getDirection()) { diff --git a/src/main/java/mekanism/common/block/basic/BlockFluidTank.java b/src/main/java/mekanism/common/block/basic/BlockFluidTank.java index 71da5ef4352..ae608d85351 100644 --- a/src/main/java/mekanism/common/block/basic/BlockFluidTank.java +++ b/src/main/java/mekanism/common/block/basic/BlockFluidTank.java @@ -5,7 +5,6 @@ import mekanism.common.content.blocktype.Machine; import mekanism.common.resource.BlockResourceInfo; import mekanism.common.tile.TileEntityFluidTank; -import mekanism.common.tile.base.WrenchResult; import mekanism.common.util.FluidUtils; import mekanism.common.util.WorldUtils; import net.minecraft.core.BlockPos; @@ -52,9 +51,11 @@ public InteractionResult use(@NotNull BlockState state, @NotNull Level world, @N if (tile == null) { return InteractionResult.PASS; } else if (world.isClientSide) { - return genericClientActivated(player, hand); - } else if (tile.tryWrench(state, player, hand, hit) != WrenchResult.PASS) { - return InteractionResult.SUCCESS; + return genericClientActivated(player, hand, tile); + } + InteractionResult wrenchResult = tile.tryWrench(state, player, hand, hit).getInteractionResult(); + if (wrenchResult != InteractionResult.PASS) { + return wrenchResult; } //Handle filling fluid tank if (!player.isShiftKeyDown()) { diff --git a/src/main/java/mekanism/common/block/basic/BlockLogisticalSorter.java b/src/main/java/mekanism/common/block/basic/BlockLogisticalSorter.java index 42c7de8fcfe..5cbf3e1977f 100644 --- a/src/main/java/mekanism/common/block/basic/BlockLogisticalSorter.java +++ b/src/main/java/mekanism/common/block/basic/BlockLogisticalSorter.java @@ -1,5 +1,6 @@ package mekanism.common.block.basic; +import mekanism.api.radiation.IRadiationManager; import mekanism.api.security.ISecurityUtils; import mekanism.common.block.attribute.Attribute; import mekanism.common.block.prefab.BlockTile.BlockTileModel; @@ -69,7 +70,7 @@ public InteractionResult use(@NotNull BlockState state, @NotNull Level world, @N if (tile == null) { return InteractionResult.PASS; } else if (world.isClientSide) { - return genericClientActivated(player, hand); + return genericClientActivated(player, hand, tile); } //TODO: Make this be moved into the logistical sorter tile ItemStack stack = player.getItemInHand(hand); @@ -78,6 +79,10 @@ public InteractionResult use(@NotNull BlockState state, @NotNull Level world, @N return InteractionResult.FAIL; } if (player.isShiftKeyDown()) { + if (IRadiationManager.INSTANCE.isRadiationEnabled() && tile.getRadiationScale() > 0) { + //Note: This should always be false for the logistical sorter, but we keep it here for good measure + return InteractionResult.FAIL; + } WorldUtils.dismantleBlock(state, world, pos, player); return InteractionResult.SUCCESS; } diff --git a/src/main/java/mekanism/common/block/basic/BlockStructuralGlass.java b/src/main/java/mekanism/common/block/basic/BlockStructuralGlass.java index b7ddd89bffd..53e8ec779b0 100644 --- a/src/main/java/mekanism/common/block/basic/BlockStructuralGlass.java +++ b/src/main/java/mekanism/common/block/basic/BlockStructuralGlass.java @@ -2,7 +2,6 @@ import mekanism.common.block.prefab.BlockTileGlass; import mekanism.common.content.blocktype.BlockTypeTile; -import mekanism.common.tile.base.WrenchResult; import mekanism.common.tile.prefab.TileEntityStructuralMultiblock; import mekanism.common.util.MekanismUtils; import mekanism.common.util.WorldUtils; @@ -38,8 +37,10 @@ public InteractionResult use(@NotNull BlockState state, @NotNull Level world, @N } } return InteractionResult.SUCCESS; - } else if (tile.tryWrench(state, player, hand, hit) != WrenchResult.PASS) { - return InteractionResult.SUCCESS; + } + InteractionResult wrenchResult = tile.tryWrench(state, player, hand, hit).getInteractionResult(); + if (wrenchResult != InteractionResult.PASS) { + return wrenchResult; } return tile.onActivate(player, hand, player.getItemInHand(hand)); } diff --git a/src/main/java/mekanism/common/block/prefab/BlockBase.java b/src/main/java/mekanism/common/block/prefab/BlockBase.java index 0fcd3b3d85f..29fec6913ce 100644 --- a/src/main/java/mekanism/common/block/prefab/BlockBase.java +++ b/src/main/java/mekanism/common/block/prefab/BlockBase.java @@ -113,6 +113,7 @@ public VoxelShape getShape(@NotNull BlockState state, @NotNull BlockGetter world public InteractionResult use(@NotNull BlockState state, @NotNull Level world, @NotNull BlockPos pos, @NotNull Player player, @NotNull InteractionHand hand, @NotNull BlockHitResult hit) { if (player.isShiftKeyDown() && MekanismUtils.canUseAsWrench(player.getItemInHand(hand))) { + //Note: We don't handle checking if it is radioactive here, as the assumption is it doesn't have a tile so won't have that information if (!world.isClientSide) { WorldUtils.dismantleBlock(state, world, pos, player); } diff --git a/src/main/java/mekanism/common/block/prefab/BlockBasicMultiblock.java b/src/main/java/mekanism/common/block/prefab/BlockBasicMultiblock.java index e8fb9d6e4bd..fed8278179b 100644 --- a/src/main/java/mekanism/common/block/prefab/BlockBasicMultiblock.java +++ b/src/main/java/mekanism/common/block/prefab/BlockBasicMultiblock.java @@ -3,7 +3,6 @@ import java.util.function.UnaryOperator; import mekanism.common.content.blocktype.BlockTypeTile; import mekanism.common.tile.base.TileEntityMekanism; -import mekanism.common.tile.base.WrenchResult; import mekanism.common.tile.prefab.TileEntityMultiblock; import mekanism.common.util.MekanismUtils; import mekanism.common.util.WorldUtils; @@ -43,8 +42,10 @@ public InteractionResult use(@NotNull BlockState state, @NotNull Level world, @N } } return InteractionResult.SUCCESS; - } else if (tile.tryWrench(state, player, hand, hit) != WrenchResult.PASS) { - return InteractionResult.SUCCESS; + } + InteractionResult wrenchResult = tile.tryWrench(state, player, hand, hit).getInteractionResult(); + if (wrenchResult != InteractionResult.PASS) { + return wrenchResult; } return tile.onActivate(player, hand, player.getItemInHand(hand)); } diff --git a/src/main/java/mekanism/common/block/prefab/BlockTile.java b/src/main/java/mekanism/common/block/prefab/BlockTile.java index 112fbaf541b..f48792b1055 100644 --- a/src/main/java/mekanism/common/block/prefab/BlockTile.java +++ b/src/main/java/mekanism/common/block/prefab/BlockTile.java @@ -14,7 +14,6 @@ import mekanism.common.content.blocktype.BlockTypeTile; import mekanism.common.registration.impl.TileEntityTypeRegistryObject; import mekanism.common.tile.base.TileEntityMekanism; -import mekanism.common.tile.base.WrenchResult; import mekanism.common.util.WorldUtils; import net.minecraft.core.BlockPos; import net.minecraft.core.Direction; @@ -58,9 +57,11 @@ public InteractionResult use(@NotNull BlockState state, @NotNull Level world, @N if (tile == null) { return InteractionResult.PASS; } else if (world.isClientSide) { - return genericClientActivated(player, hand); - } else if (tile.tryWrench(state, player, hand, hit) != WrenchResult.PASS) { - return InteractionResult.SUCCESS; + return genericClientActivated(player, hand, tile); + } + InteractionResult wrenchResult = tile.tryWrench(state, player, hand, hit).getInteractionResult(); + if (wrenchResult != InteractionResult.PASS) { + return wrenchResult; } return type.has(AttributeGui.class) ? tile.openGui(player) : InteractionResult.PASS; } diff --git a/src/main/java/mekanism/common/tile/base/TileEntityMekanism.java b/src/main/java/mekanism/common/tile/base/TileEntityMekanism.java index 8cb3dd86eb7..a5447f6e327 100644 --- a/src/main/java/mekanism/common/tile/base/TileEntityMekanism.java +++ b/src/main/java/mekanism/common/tile/base/TileEntityMekanism.java @@ -495,6 +495,10 @@ public WrenchResult tryWrench(BlockState state, Player player, InteractionHand h return WrenchResult.NO_SECURITY; } if (player.isShiftKeyDown()) { + if (IRadiationManager.INSTANCE.isRadiationEnabled() && getRadiationScale() > 0) { + //Don't allow dismantling radioactive blocks + return WrenchResult.RADIOACTIVE; + } WorldUtils.dismantleBlock(state, getLevel(), worldPosition, this, player); return WrenchResult.DISMANTLED; } diff --git a/src/main/java/mekanism/common/tile/base/WrenchResult.java b/src/main/java/mekanism/common/tile/base/WrenchResult.java index 55063079dc5..a852180ffc4 100644 --- a/src/main/java/mekanism/common/tile/base/WrenchResult.java +++ b/src/main/java/mekanism/common/tile/base/WrenchResult.java @@ -1,9 +1,20 @@ package mekanism.common.tile.base; +import net.minecraft.world.InteractionResult; + //TODO: Move this to a different package public enum WrenchResult { DISMANTLED, SUCCESS, PASS, - NO_SECURITY + NO_SECURITY, + RADIOACTIVE; + + public InteractionResult getInteractionResult() { + return switch (this) { + case PASS -> InteractionResult.PASS; + case RADIOACTIVE -> InteractionResult.FAIL; + default -> InteractionResult.SUCCESS; + }; + } } \ No newline at end of file From d0981b5d248807eadfc253e4f2cc6e26a68b05a8 Mon Sep 17 00:00:00 2001 From: Sara Freimer Date: Wed, 3 Jul 2024 07:25:34 +0800 Subject: [PATCH 3/3] backport "Add alternative textures for the configurator when on various modes" (c6c44ee) --- .../mekanism/client/ClientRegistration.java | 10 ++++++++ .../mekanism/models/item/configurator.json | 24 ++++++++++++++++-- .../models/item/configurator_empty.json | 6 +++++ .../models/item/configurator_rotate.json | 6 +++++ .../models/item/configurator_wrench.json | 6 +++++ .../textures/item/configurator_config.png | Bin 0 -> 279 bytes ...onfigurator.png => configurator_empty.png} | Bin .../textures/item/configurator_rotate.png | Bin 0 -> 253 bytes .../textures/item/configurator_wrench.png | Bin 0 -> 275 bytes 9 files changed, 50 insertions(+), 2 deletions(-) create mode 100644 src/main/resources/assets/mekanism/models/item/configurator_empty.json create mode 100644 src/main/resources/assets/mekanism/models/item/configurator_rotate.json create mode 100644 src/main/resources/assets/mekanism/models/item/configurator_wrench.json create mode 100644 src/main/resources/assets/mekanism/textures/item/configurator_config.png rename src/main/resources/assets/mekanism/textures/item/{configurator.png => configurator_empty.png} (100%) create mode 100644 src/main/resources/assets/mekanism/textures/item/configurator_rotate.png create mode 100644 src/main/resources/assets/mekanism/textures/item/configurator_wrench.png diff --git a/src/main/java/mekanism/client/ClientRegistration.java b/src/main/java/mekanism/client/ClientRegistration.java index ff016fdba2d..10658e5202b 100644 --- a/src/main/java/mekanism/client/ClientRegistration.java +++ b/src/main/java/mekanism/client/ClientRegistration.java @@ -151,6 +151,7 @@ import mekanism.common.content.gear.shared.ModuleColorModulationUnit; import mekanism.common.integration.MekanismHooks; import mekanism.common.item.ItemConfigurationCard; +import mekanism.common.item.ItemConfigurator; import mekanism.common.item.ItemCraftingFormula; import mekanism.common.item.block.ItemBlockCardboardBox; import mekanism.common.item.block.machine.ItemBlockFluidTank; @@ -263,6 +264,15 @@ public static void init(FMLClientSetupEvent event) { }); ClientRegistrationUtil.setPropertyOverride(MekanismItems.CONFIGURATION_CARD, Mekanism.rl("encoded"), (stack, world, entity, seed) -> ((ItemConfigurationCard) stack.getItem()).hasData(stack) ? 1 : 0); + ClientRegistrationUtil.setPropertyOverride(MekanismItems.CONFIGURATOR, Mekanism.rl("mode"), (stack, world, entity, seed) -> { + ItemConfigurator.ConfiguratorMode mode = ((ItemConfigurator) stack.getItem()).getMode(stack); + return switch (mode) { + default -> 0; + case EMPTY -> 1; + case ROTATE -> 2; + case WRENCH -> 3; + }; + }); ClientRegistrationUtil.setPropertyOverride(MekanismItems.ELECTRIC_BOW, Mekanism.rl("pull"), (stack, world, entity, seed) -> entity != null && entity.getUseItem() == stack ? (stack.getUseDuration() - entity.getUseItemRemainingTicks()) / 20.0F : 0); diff --git a/src/main/resources/assets/mekanism/models/item/configurator.json b/src/main/resources/assets/mekanism/models/item/configurator.json index f9d924dbb0d..73673d3e0d4 100644 --- a/src/main/resources/assets/mekanism/models/item/configurator.json +++ b/src/main/resources/assets/mekanism/models/item/configurator.json @@ -1,6 +1,26 @@ { "parent": "item/handheld", "textures": { - "layer0": "mekanism:item/configurator" - } + "layer0": "mekanism:item/configurator_config" + }, + "overrides": [ + { + "predicate": { + "mekanism:mode": 1 + }, + "model": "mekanism:item/configurator_empty" + }, + { + "predicate": { + "mekanism:mode": 2 + }, + "model": "mekanism:item/configurator_rotate" + }, + { + "predicate": { + "mekanism:mode": 3 + }, + "model": "mekanism:item/configurator_wrench" + } + ] } \ No newline at end of file diff --git a/src/main/resources/assets/mekanism/models/item/configurator_empty.json b/src/main/resources/assets/mekanism/models/item/configurator_empty.json new file mode 100644 index 00000000000..c75836208a9 --- /dev/null +++ b/src/main/resources/assets/mekanism/models/item/configurator_empty.json @@ -0,0 +1,6 @@ +{ + "parent": "item/handheld", + "textures": { + "layer0": "mekanism:item/configurator_empty" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/mekanism/models/item/configurator_rotate.json b/src/main/resources/assets/mekanism/models/item/configurator_rotate.json new file mode 100644 index 00000000000..f9bc8e1d871 --- /dev/null +++ b/src/main/resources/assets/mekanism/models/item/configurator_rotate.json @@ -0,0 +1,6 @@ +{ + "parent": "item/handheld", + "textures": { + "layer0": "mekanism:item/configurator_rotate" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/mekanism/models/item/configurator_wrench.json b/src/main/resources/assets/mekanism/models/item/configurator_wrench.json new file mode 100644 index 00000000000..59728493af8 --- /dev/null +++ b/src/main/resources/assets/mekanism/models/item/configurator_wrench.json @@ -0,0 +1,6 @@ +{ + "parent": "item/handheld", + "textures": { + "layer0": "mekanism:item/configurator_wrench" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/mekanism/textures/item/configurator_config.png b/src/main/resources/assets/mekanism/textures/item/configurator_config.png new file mode 100644 index 0000000000000000000000000000000000000000..d34ad84be6e26ca34d4e534158ca9ac367af8b38 GIT binary patch literal 279 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!63?wyl`GbK}V1Q4EE8m3W61(2Z%gd*yr_Y@` z_y7O@e69g}5$SwAOW{)X_V$kYYN26aKs7C%CT(3^{Szkw6|Y#ia!ZWeuHCy26*!(c zefnyT%ZHC2W6~ba2O7>+666Q61PJn$u}=h2`JOJ0Arez#&qwk#DDbcZgo&>RTcc6* zzgbIaN#Q;#{Uw@*{wdw^NHJwU<@ZT^O1UK$-|nf06q`e~nJ}Ds`EC=_4pYTP+ePl& zSZub8X^y*j#nSgS4Cy_S!&k*|MMrq$3mp3Mm8mXmZ^NfGpYQM6$-tk=UMAI}zY*jF MPgg&ebxsLQ06xBHEdT%j literal 0 HcmV?d00001 diff --git a/src/main/resources/assets/mekanism/textures/item/configurator.png b/src/main/resources/assets/mekanism/textures/item/configurator_empty.png similarity index 100% rename from src/main/resources/assets/mekanism/textures/item/configurator.png rename to src/main/resources/assets/mekanism/textures/item/configurator_empty.png diff --git a/src/main/resources/assets/mekanism/textures/item/configurator_rotate.png b/src/main/resources/assets/mekanism/textures/item/configurator_rotate.png new file mode 100644 index 0000000000000000000000000000000000000000..9073ebb3bc74e784ab9f9c9fd95c517f8e37be54 GIT binary patch literal 253 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!63?wyl`GbL!M}SX=tGv8?dV2cYxpV*j|Igvb4oQvXKJl;-hdt&=|+Zwj*0)78&qol`;+0H5|;Gynhq literal 0 HcmV?d00001 diff --git a/src/main/resources/assets/mekanism/textures/item/configurator_wrench.png b/src/main/resources/assets/mekanism/textures/item/configurator_wrench.png new file mode 100644 index 0000000000000000000000000000000000000000..74ec8dd919ab764ec43c0ced843a934bca3b814e GIT binary patch literal 275 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!63?wyl`GbK}V1Q4EtGv8?dU|^Q#EEm~&OLSd z^oNfh|NsBb=NiBlk8&F?=jt(ed)=uEBY4ZHggZ~trBhs{k!wq4BpKzIV$;H?C=NK?&<31 Jvd$@?2>=;MZ?OOX literal 0 HcmV?d00001