mirror of
https://github.com/GTNewHorizons/ForestryMC.git
synced 2026-11-27 23:33:00 +00:00
Drastically reduce getBlock calls in orchard mode (#19)
* Drastically reduce getBlock calls in orchard mode * improve caching
This commit is contained in:
1 parent
bfa39a7738
commit
b58e4c57c7
12 files changed
+97
-67
No files matched your search
@@ -17,21 +17,14 @@ import net.minecraft.world.World;
|
||||
|
||||
import forestry.api.arboriculture.IAlleleTreeSpecies;
|
||||
import forestry.api.farming.ICrop;
|
||||
import forestry.api.farming.IFarmable;
|
||||
import forestry.api.farming.IFarmableBasic;
|
||||
import forestry.arboriculture.genetics.TreeGenome;
|
||||
import forestry.core.utils.vect.Vect;
|
||||
import forestry.plugins.PluginArboriculture;
|
||||
|
||||
public class FarmableGE implements IFarmable {
|
||||
|
||||
public class FarmableGE implements IFarmableBasic {
|
||||
@Override
|
||||
public boolean isSaplingAt(World world, int x, int y, int z) {
|
||||
|
||||
if (world.isAirBlock(x, y, z)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
Block block = world.getBlock(x, y, z);
|
||||
public boolean isSapling(Block block, int meta) {
|
||||
return PluginArboriculture.blocks.saplingGE == block;
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user