Fixed #514 - Mixer NPE

This commit is contained in:
Calclavia 2014-04-13 23:11:36 +08:00
parent 1b9f984afc
commit 714c3ec2a2

View file

@ -143,7 +143,7 @@ public class TileMixer extends TileMechanical implements IInventory
if (timeLeft <= 0) if (timeLeft <= 0)
{ {
if (this.doneWork(processingItem)) if (doneWork(processingItem))
{ {
if (--processingItem.getEntityItem().stackSize <= 0) if (--processingItem.getEntityItem().stackSize <= 0)
{ {
@ -190,7 +190,10 @@ public class TileMixer extends TileMechanical implements IInventory
if (mixPosition.getBlockID(world()) != blockID()) if (mixPosition.getBlockID(world()) != blockID())
{ {
Block block = Block.blocksList[mixPosition.getBlockID(worldObj)]; Block block = Block.blocksList[mixPosition.getBlockID(worldObj)];
Block blockFluidFinite = ResourceGenerator.getMixture(ResourceGenerator.getName(entity.getEntityItem()));
if (blockFluidFinite != null)
{
if (block instanceof BlockFluidMixture) if (block instanceof BlockFluidMixture)
{ {
ItemStack itemStack = entity.getEntityItem().copy(); ItemStack itemStack = entity.getEntityItem().copy();
@ -203,7 +206,8 @@ public class TileMixer extends TileMechanical implements IInventory
} }
else if (block != null && (block.blockID == Block.waterStill.blockID || block.blockID == Block.waterMoving.blockID)) else if (block != null && (block.blockID == Block.waterStill.blockID || block.blockID == Block.waterMoving.blockID))
{ {
mixPosition.setBlock(worldObj, ResourceGenerator.getMixture(ResourceGenerator.getName(entity.getEntityItem())).blockID); mixPosition.setBlock(worldObj, blockFluidFinite.blockID);
}
} }
} }