Greenhouse Glass Performance

This commit is contained in:
Ellpeck 2015-11-29 00:38:22 +01:00
parent f22d6ddfae
commit d57f60c829

View file

@ -27,11 +27,10 @@ public class TileEntityGreenhouseGlass extends TileEntityBase{
super.updateEntity();
if(!worldObj.isRemote){
if(worldObj.canBlockSeeTheSky(xCoord, yCoord, zCoord) && worldObj.isDaytime()){
WorldPos blockToFert = this.blockToFertilize();
if(blockToFert != null){
if(this.timeUntilNextFert > 0){
this.timeUntilNextFert--;
if(timeUntilNextFert <= 0){
WorldPos blockToFert = this.blockToFertilize();
int metaBefore = blockToFert.getMetadata();
worldObj.getBlock(blockToFert.getX(), blockToFert.getY(), blockToFert.getZ()).updateTick(worldObj, blockToFert.getX(), blockToFert.getY(), blockToFert.getZ(), Util.RANDOM);
@ -47,7 +46,6 @@ public class TileEntityGreenhouseGlass extends TileEntityBase{
}
}
}
}
public WorldPos blockToFertilize(){
for(int i = yCoord-1; i > 0; i--){