Fix some more exceptions because of stupid item handling

Closes #542
This commit is contained in:
Ellpeck 2016-12-28 22:28:23 +01:00
parent f83c4ec60b
commit a0e64cc512
2 changed files with 2 additions and 2 deletions

View file

@ -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);
}

View file

@ -30,7 +30,7 @@ public class ItemResonantRice extends ItemBase{
@Override
public ActionResult<ItemStack> 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<ItemStack>(EnumActionResult.SUCCESS, stack);