Drastically reduce getBlock calls in orchard mode (#19)

* Drastically reduce getBlock calls in orchard mode

* improve caching
This commit is contained in:
Glease authored and GitHub committed 2022-03-26 15:55:35 +01:00
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;
}