mirror of
https://github.com/Ellpeck/ActuallyAdditions.git
synced 2024-11-22 23:28:35 +01:00
Greenhouse Glass Performance
This commit is contained in:
parent
f22d6ddfae
commit
d57f60c829
1 changed files with 12 additions and 14 deletions
|
@ -27,11 +27,10 @@ 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(blockToFert != null){
|
|
||||||
if(this.timeUntilNextFert > 0){
|
if(this.timeUntilNextFert > 0){
|
||||||
this.timeUntilNextFert--;
|
this.timeUntilNextFert--;
|
||||||
if(timeUntilNextFert <= 0){
|
if(timeUntilNextFert <= 0){
|
||||||
|
WorldPos blockToFert = this.blockToFertilize();
|
||||||
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);
|
||||||
|
|
||||||
|
@ -47,7 +46,6 @@ public class TileEntityGreenhouseGlass extends TileEntityBase{
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
public WorldPos blockToFertilize(){
|
public WorldPos blockToFertilize(){
|
||||||
for(int i = yCoord-1; i > 0; i--){
|
for(int i = yCoord-1; i > 0; i--){
|
||||||
|
|
Loading…
Reference in a new issue