Fixed a Crash with the Greenhouse Glass.

Closes https://github.com/Ellpeck/ActuallyAdditions/issues/30
This commit is contained in:
Ellpeck 2015-12-04 23:51:38 +01:00
parent 46ad9fee6f
commit 2cd7bea732

View file

@ -31,6 +31,7 @@ public class TileEntityGreenhouseGlass extends TileEntityBase{
this.timeUntilNextFert--; this.timeUntilNextFert--;
if(timeUntilNextFert <= 0){ if(timeUntilNextFert <= 0){
WorldPos blockToFert = this.blockToFertilize(); WorldPos blockToFert = this.blockToFertilize();
if(this.blockToFertilize() != null){
int metaBefore = blockToFert.getMetadata(); int metaBefore = blockToFert.getMetadata();
worldObj.getBlock(blockToFert.getX(), blockToFert.getY(), blockToFert.getZ()).updateTick(worldObj, blockToFert.getX(), blockToFert.getY(), blockToFert.getZ(), Util.RANDOM); worldObj.getBlock(blockToFert.getX(), blockToFert.getY(), blockToFert.getZ()).updateTick(worldObj, blockToFert.getX(), blockToFert.getY(), blockToFert.getZ(), Util.RANDOM);
@ -39,6 +40,7 @@ public class TileEntityGreenhouseGlass extends TileEntityBase{
} }
} }
} }
}
else{ else{
int time = 300; int time = 300;
this.timeUntilNextFert = time+Util.RANDOM.nextInt(time); this.timeUntilNextFert = time+Util.RANDOM.nextInt(time);