Fixed crash when breaking a mana pool and placing a spreader/flower in it's place.

This commit is contained in:
Vasco Lavos committed 2014-07-13 02:12:27 +01:00
1 parent 3204b450fb
commit 247522fc68
2 files changed
+11 -2

No files matched your search

@@ -75,6 +75,7 @@ public class BlockPool extends BlockModContainer implements IWandHUD, IWandable,
@Override
public void breakBlock(World par1World, int par2, int par3, int par4, Block par5, int par6) {
super.breakBlock(par1World, par2, par3, par4, par5, par6);
TilePool pool = (TilePool) par1World.getTileEntity(par2, par3, par4);
lastFragile = pool.fragile;
}
@@ -135,7 +135,11 @@ public class BlockSpreader extends BlockModContainer implements IWandable, IWand
@Override
public boolean onBlockActivated(World par1World, int par2, int par3, int par4, EntityPlayer par5EntityPlayer, int par6, float par7, float par8, float par9) {
TileSpreader spreader = (TileSpreader) par1World.getTileEntity(par2, par3, par4);
TileEntity tile = par1World.getTileEntity(par2, par3, par4);
if(!(tile instanceof TileSpreader))
return false;
TileSpreader spreader = (TileSpreader) tile;
ItemStack lens = spreader.getStackInSlot(0);
ItemStack heldItem = par5EntityPlayer.getCurrentEquippedItem();
boolean isHeldItemLens = heldItem != null && heldItem.getItem() instanceof ILens;
@@ -161,7 +165,11 @@ public class BlockSpreader extends BlockModContainer implements IWandable, IWand
@Override
public void breakBlock(World par1World, int par2, int par3, int par4, Block par5, int par6) {
TileSimpleInventory inv = (TileSimpleInventory) par1World.getTileEntity(par2, par3, par4);
TileEntity tile = par1World.getTileEntity(par2, par3, par4);
if(!(tile instanceof TileSimpleInventory))
return;
TileSimpleInventory inv = (TileSimpleInventory) tile;
if (inv != null) {
for (int j1 = 0; j1 < inv.getSizeInventory(); ++j1) {