Skip to content

Commit

Permalink
Fix oxygen distributor NPE.
Browse files Browse the repository at this point in the history
  • Loading branch information
micdoodle8 committed Jul 17, 2013
1 parent 28a7b6c commit 59627bf
Showing 1 changed file with 12 additions and 9 deletions.
Expand Up @@ -41,21 +41,24 @@ public GCCoreTileEntityOxygenDistributor()
@Override
public void invalidate()
{
for (int x = (int) Math.floor(this.xCoord - this.oxygenBubble.getSize()); x < Math.ceil(this.xCoord + this.oxygenBubble.getSize()); x++)
if (this.oxygenBubble != null)
{
for (int y = (int) Math.floor(this.yCoord - this.oxygenBubble.getSize()); y < Math.ceil(this.yCoord + this.oxygenBubble.getSize()); y++)
for (int x = (int) Math.floor(this.xCoord - this.oxygenBubble.getSize()); x < Math.ceil(this.xCoord + this.oxygenBubble.getSize()); x++)
{
for (int z = (int) Math.floor(this.zCoord - this.oxygenBubble.getSize()); z < Math.ceil(this.zCoord + this.oxygenBubble.getSize()); z++)
for (int y = (int) Math.floor(this.yCoord - this.oxygenBubble.getSize()); y < Math.ceil(this.yCoord + this.oxygenBubble.getSize()); y++)
{
int blockID = this.worldObj.getBlockId(x, y, z);

if (blockID > 0)
for (int z = (int) Math.floor(this.zCoord - this.oxygenBubble.getSize()); z < Math.ceil(this.zCoord + this.oxygenBubble.getSize()); z++)
{
Block block = Block.blocksList[blockID];
int blockID = this.worldObj.getBlockId(x, y, z);

if (block instanceof IOxygenReliantBlock)
if (blockID > 0)
{
((IOxygenReliantBlock) block).onOxygenRemoved(this.worldObj, x, y, z);
Block block = Block.blocksList[blockID];

if (block instanceof IOxygenReliantBlock)
{
((IOxygenReliantBlock) block).onOxygenRemoved(this.worldObj, x, y, z);
}
}
}
}
Expand Down

0 comments on commit 59627bf

Please sign in to comment.