From a0e64cc512447fe0c10f22b3360f1a6c2b10b7e2 Mon Sep 17 00:00:00 2001 From: Ellpeck Date: Wed, 28 Dec 2016 22:28:23 +0100 Subject: [PATCH] Fix some more exceptions because of stupid item handling Closes #542 --- .../de/ellpeck/actuallyadditions/mod/items/ItemHairyBall.java | 2 +- .../ellpeck/actuallyadditions/mod/items/ItemResonantRice.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/items/ItemHairyBall.java b/src/main/java/de/ellpeck/actuallyadditions/mod/items/ItemHairyBall.java index e86fa7ab4..9911fc849 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/items/ItemHairyBall.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/items/ItemHairyBall.java @@ -63,7 +63,7 @@ public class ItemHairyBall extends ItemBase{ entityItem.setPickupDelay(0); player.worldObj.spawnEntityInWorld(entityItem); } - stack = StackUtil.addStackSize(stack, -1); + stack.stackSize--; world.playSound(null, player.posX, player.posY, player.posZ, SoundEvents.ENTITY_ITEM_PICKUP, SoundCategory.PLAYERS, 0.2F, world.rand.nextFloat()*0.1F+0.9F); } diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/items/ItemResonantRice.java b/src/main/java/de/ellpeck/actuallyadditions/mod/items/ItemResonantRice.java index a1eaaaecf..3f7dc9c78 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/items/ItemResonantRice.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/items/ItemResonantRice.java @@ -30,7 +30,7 @@ public class ItemResonantRice extends ItemBase{ @Override public ActionResult onItemRightClick(ItemStack stack, World world, EntityPlayer player, EnumHand hand){ if(!world.isRemote){ - stack = StackUtil.addStackSize(stack, -1); + stack.stackSize--; world.createExplosion(null, player.posX, player.posY, player.posZ, 0.5F, true); } return new ActionResult(EnumActionResult.SUCCESS, stack);