mirror of
https://github.com/Ellpeck/ActuallyAdditions.git
synced 2024-11-26 08:48:34 +01:00
Greenhouse Glass Performance
This commit is contained in:
parent
f22d6ddfae
commit
d57f60c829
1 changed files with 12 additions and 14 deletions
|
@ -27,23 +27,21 @@ public class TileEntityGreenhouseGlass extends TileEntityBase{
|
||||||
super.updateEntity();
|
super.updateEntity();
|
||||||
if(!worldObj.isRemote){
|
if(!worldObj.isRemote){
|
||||||
if(worldObj.canBlockSeeTheSky(xCoord, yCoord, zCoord) && worldObj.isDaytime()){
|
if(worldObj.canBlockSeeTheSky(xCoord, yCoord, zCoord) && worldObj.isDaytime()){
|
||||||
WorldPos blockToFert = this.blockToFertilize();
|
if(this.timeUntilNextFert > 0){
|
||||||
if(blockToFert != null){
|
this.timeUntilNextFert--;
|
||||||
if(this.timeUntilNextFert > 0){
|
if(timeUntilNextFert <= 0){
|
||||||
this.timeUntilNextFert--;
|
WorldPos blockToFert = this.blockToFertilize();
|
||||||
if(timeUntilNextFert <= 0){
|
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);
|
|
||||||
|
|
||||||
if(blockToFert.getMetadata() != metaBefore){
|
if(blockToFert.getMetadata() != metaBefore){
|
||||||
worldObj.playAuxSFX(2005, blockToFert.getX(), blockToFert.getY(), blockToFert.getZ(), 0);
|
worldObj.playAuxSFX(2005, blockToFert.getX(), blockToFert.getY(), blockToFert.getZ(), 0);
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else{
|
}
|
||||||
int time = 300;
|
else{
|
||||||
this.timeUntilNextFert = time+Util.RANDOM.nextInt(time);
|
int time = 300;
|
||||||
}
|
this.timeUntilNextFert = time+Util.RANDOM.nextInt(time);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue