simple-tech

Minecraft: Better than Adventure! mod that adds simple blocks to automate tasks
git clone git://memoryshards.xyz/simple-tech.git
Log | Files | Refs | README | LICENSE

commit f7d1e68cf3cd93e1bb94d51ef7721c747223e93e
parent 085ad757fe3879058687693bcf1055450bf77284
Author: Amb0s <ambos@disroot.org>
Date:   Mon, 28 Aug 2023 20:14:38 +0200

Use temporary workaround for #13

Diffstat:
Msrc/main/java/turniplabs/simpletech/mixin/EntityItemMixin.java | 8++++++--
Msrc/main/resources/simpletech.mixins.json | 1+
2 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/src/main/java/turniplabs/simpletech/mixin/EntityItemMixin.java b/src/main/java/turniplabs/simpletech/mixin/EntityItemMixin.java @@ -7,10 +7,14 @@ import org.spongepowered.asm.mixin.injection.Inject; import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; @Mixin(value = EntityItem.class, remap = false) -public class EntityItemMixin { +final class EntityItemMixin { @Inject(method = "clumpToNearbyStack", at = @At("HEAD"), require = 0, cancellable = true) private void removeItemEntityStacking(CallbackInfo ci) { - ci.cancel(); + EntityItem currentEntityItem = (EntityItem) ((Object) this); + + if (!currentEntityItem.item.isStackable()) { + ci.cancel(); + } } } diff --git a/src/main/resources/simpletech.mixins.json b/src/main/resources/simpletech.mixins.json @@ -4,6 +4,7 @@ "package": "turniplabs.simpletech.mixin", "compatibilityLevel": "JAVA_8", "mixins": [ + "EntityItemMixin", "MinecraftMixin", "RenderBlocksMixin" ],