From 57df043efa29855a181be22cb742d8005d071ddb Mon Sep 17 00:00:00 2001 From: altrisi Date: Sat, 15 Mar 2025 13:42:36 +0100 Subject: [PATCH] Fix remainder calculation when cauldroning shulker boxes Now handled properly by the game's code --- ...actCauldronBlock_stackableSBoxesMixin.java | 40 ------------------- src/main/resources/carpet.mixins.json | 1 - 2 files changed, 41 deletions(-) delete mode 100644 src/main/java/carpet/mixins/AbstractCauldronBlock_stackableSBoxesMixin.java diff --git a/src/main/java/carpet/mixins/AbstractCauldronBlock_stackableSBoxesMixin.java b/src/main/java/carpet/mixins/AbstractCauldronBlock_stackableSBoxesMixin.java deleted file mode 100644 index ea7ffa26..00000000 --- a/src/main/java/carpet/mixins/AbstractCauldronBlock_stackableSBoxesMixin.java +++ /dev/null @@ -1,40 +0,0 @@ -package carpet.mixins; - -import carpet.CarpetSettings; -import net.minecraft.core.BlockPos; -import net.minecraft.core.cauldron.CauldronInteraction; -import net.minecraft.world.InteractionHand; -import net.minecraft.world.InteractionResult; -import net.minecraft.world.entity.player.Player; -import net.minecraft.world.item.BlockItem; -import net.minecraft.world.item.ItemStack; -import net.minecraft.world.level.Level; -import net.minecraft.world.level.block.AbstractCauldronBlock; -import net.minecraft.world.level.block.ShulkerBoxBlock; -import net.minecraft.world.level.block.state.BlockState; -import org.spongepowered.asm.mixin.Mixin; -import org.spongepowered.asm.mixin.injection.At; -import org.spongepowered.asm.mixin.injection.Redirect; - -@Mixin(AbstractCauldronBlock.class) -public class AbstractCauldronBlock_stackableSBoxesMixin -{ - @Redirect(method = "useItemOn", at = @At( - value = "INVOKE", - target = "Lnet/minecraft/core/cauldron/CauldronInteraction;interact(Lnet/minecraft/world/level/block/state/BlockState;Lnet/minecraft/world/level/Level;Lnet/minecraft/core/BlockPos;Lnet/minecraft/world/entity/player/Player;Lnet/minecraft/world/InteractionHand;Lnet/minecraft/world/item/ItemStack;)Lnet/minecraft/world/InteractionResult;" - )) - private InteractionResult wrapInteractor(final CauldronInteraction cauldronBehavior, final BlockState blockState, final Level world, final BlockPos blockPos, final Player playerEntity, final InteractionHand hand, final ItemStack itemStack) - { - int count = -1; - if (CarpetSettings.shulkerBoxStackSize > 1 && itemStack.getItem() instanceof BlockItem && ((BlockItem)itemStack.getItem()).getBlock() instanceof ShulkerBoxBlock) - count = itemStack.getCount(); - InteractionResult result = cauldronBehavior.interact(blockState, world, blockPos, playerEntity, hand, itemStack); - if (count > 0 && result.consumesAction()) - { - ItemStack current = playerEntity.getItemInHand(hand); - if (current.getItem() instanceof BlockItem && ((BlockItem)itemStack.getItem()).getBlock() instanceof ShulkerBoxBlock) - current.setCount(count); - } - return result; - } -} diff --git a/src/main/resources/carpet.mixins.json b/src/main/resources/carpet.mixins.json index 240d70e5..366ebf76 100644 --- a/src/main/resources/carpet.mixins.json +++ b/src/main/resources/carpet.mixins.json @@ -98,7 +98,6 @@ "HopperBlockEntity_counterMixin", "AbstractContainerMenu_ctrlQCraftingMixin", "Connection_packetCounterMixin", - "AbstractCauldronBlock_stackableSBoxesMixin", "ItemStack_stackableShulkerBoxesMixin", "ItemEntityMixin", "TntBlock_noUpdateMixin",