Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- diff --git a/pelep/unlittorch/item/ItemTorch.java b/pelep/unlittorch/item/ItemTorch.java
- index a62ee1e..e2d2b95 100644
- --- a/pelep/unlittorch/item/ItemTorch.java
- +++ b/pelep/unlittorch/item/ItemTorch.java
- @@ -653,7 +653,7 @@ public class ItemTorch extends ItemBlock
- }
- else
- {
- - this.killItemTorch(world, p, ist, "fire.fire");
- + this.killItemTorch(world, p, ist, slot, "fire.fire");
- }
- return;
- @@ -667,7 +667,7 @@ public class ItemTorch extends ItemBlock
- }
- else
- {
- - this.killItemTorch(world, p, ist, "fire.fire");
- + this.killItemTorch(world, p, ist, slot, "fire.fire");
- }
- if (p.inventory.getStackInSlot(slot) == null)
- @@ -682,7 +682,7 @@ public class ItemTorch extends ItemBlock
- if (world.canLightningStrikeAt(x, y, z) && (held && world.rand.nextInt(50) == 0 || world.rand.nextInt(80) == 0))
- {
- - this.killItemTorch(world, p, ist, "random.fizz");
- + this.killItemTorch(world, p, ist, slot, "random.fizz");
- return;
- }
- @@ -698,22 +698,17 @@ public class ItemTorch extends ItemBlock
- private void destroyItemTorch(World world, EntityPlayer p, ItemStack ist, int slot, boolean random)
- {
- world.playSoundAtEntity(p, "fire.fire", 1.0F, 1.0F);
- -
- - if (random)
- - {
- - int dec = world.rand.nextInt(ist.stackSize) + 1;
- - p.inventory.decrStackSize(slot, dec);
- - }
- - else
- - {
- - p.inventory.setInventorySlotContents(slot, (ItemStack)null);
- - }
- + ist.setItemDamage(1);
- + p.inventory.decrStackSize(slot, 1);
- }
- - private void killItemTorch(World world, EntityPlayer p, ItemStack ist, String sound)
- + private void killItemTorch(World world, EntityPlayer p, ItemStack ist, int slot, String sound)
- {
- world.playSoundAtEntity(p, sound, 1.0F, 1.0F);
- - ist.setItemDamage(0);
- + ist.setItemDamage(1);
- + p.inventory.decrStackSize(slot, 1);
- + if( false == p.inventory.addItemStackToInventory(new ItemStack(ist.getItem())) )
- + p.dropItem(ist.itemID, 1);
- }
- public boolean onEntityItemUpdate(EntityItem ei)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement