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

@@ -16,12 +16,12 @@ import net.minecraft.item.ItemStack;
import net.minecraft.world.World;
import forestry.api.farming.ICrop;
import forestry.api.farming.IFarmable;
import forestry.api.farming.IFarmableBasic;
import forestry.core.config.Constants;
import forestry.core.utils.ItemStackUtil;
import forestry.core.utils.vect.Vect;
public class FarmableBasicFruit implements IFarmable {
public class FarmableBasicFruit implements IFarmableBasic {
private final Block block;
private final int matureMeta;
@@ -32,8 +32,8 @@ public class FarmableBasicFruit implements IFarmable {
}
@Override
public boolean isSaplingAt(World world, int x, int y, int z) {
return world.getBlock(x, y, z) == block;
public boolean isSapling(Block block, int meta) {
return this.block == block;
}
@Override