mirror of
https://github.com/GTNewHorizons/ForestryMC.git
synced 2026-11-22 04:52:26 +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
@@ -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
|
||||
|
||||
Reference in new issue
Block a user