mirror of
https://github.com/Ellpeck/ActuallyAdditions.git
synced 2024-11-22 15:18: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();
|
||||
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){
|
||||
int metaBefore = blockToFert.getMetadata();
|
||||
worldObj.getBlock(blockToFert.getX(), blockToFert.getY(), blockToFert.getZ()).updateTick(worldObj, blockToFert.getX(), blockToFert.getY(), blockToFert.getZ(), Util.RANDOM);
|
||||
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);
|
||||
|
||||
if(blockToFert.getMetadata() != metaBefore){
|
||||
worldObj.playAuxSFX(2005, blockToFert.getX(), blockToFert.getY(), blockToFert.getZ(), 0);
|
||||
}
|
||||
if(blockToFert.getMetadata() != metaBefore){
|
||||
worldObj.playAuxSFX(2005, blockToFert.getX(), blockToFert.getY(), blockToFert.getZ(), 0);
|
||||
}
|
||||
}
|
||||
else{
|
||||
int time = 300;
|
||||
this.timeUntilNextFert = time+Util.RANDOM.nextInt(time);
|
||||
}
|
||||
}
|
||||
else{
|
||||
int time = 300;
|
||||
this.timeUntilNextFert = time+Util.RANDOM.nextInt(time);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue