EntityItemMixin.java (690B)
1 package ambos.simpletech.mixin; 2 3 import net.minecraft.core.entity.EntityItem; 4 import org.spongepowered.asm.mixin.Mixin; 5 import org.spongepowered.asm.mixin.injection.At; 6 import org.spongepowered.asm.mixin.injection.Inject; 7 import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; 8 9 @Mixin(value = EntityItem.class, remap = false) 10 final class EntityItemMixin { 11 @Inject(method = "clumpToNearbyStack", at = @At("HEAD"), require = 0, cancellable = true) 12 private void removeItemEntityStacking(CallbackInfo ci) { 13 EntityItem currentEntityItem = (EntityItem) ((Object) this); 14 15 if (!currentEntityItem.item.isStackable()) { 16 ci.cancel(); 17 } 18 } 19 }