mirror of
https://github.com/GTNewHorizons/ForestryMC.git
synced 2026-11-14 01:04:12 +00:00
Fix #830 Multifarms do not plant saplings when Arboriculture is disabled
This commit is contained in:
1 parent
6e68768259
commit
8cc0da5c04
1 file changed
+10
-5
@@ -20,6 +20,7 @@ import forestry.api.arboriculture.ITree;
|
||||
import forestry.api.arboriculture.TreeManager;
|
||||
import forestry.api.genetics.IIndividual;
|
||||
import forestry.core.utils.GeneticsUtil;
|
||||
import forestry.plugins.PluginManager;
|
||||
|
||||
public class FarmableVanillaSapling extends FarmableGenericSapling {
|
||||
|
||||
@@ -29,12 +30,16 @@ public class FarmableVanillaSapling extends FarmableGenericSapling {
|
||||
|
||||
@Override
|
||||
public boolean plantSaplingAt(EntityPlayer player, ItemStack germling, World world, int x, int y, int z) {
|
||||
IIndividual tree = GeneticsUtil.getGeneticEquivalent(germling);
|
||||
if (!(tree instanceof ITree)) {
|
||||
return false;
|
||||
}
|
||||
if (PluginManager.Module.ARBORICULTURE.isEnabled()) {
|
||||
IIndividual tree = GeneticsUtil.getGeneticEquivalent(germling);
|
||||
if (!(tree instanceof ITree)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return TreeManager.treeRoot.plantSapling(world, (ITree) tree, player.getGameProfile(), x, y, z);
|
||||
return TreeManager.treeRoot.plantSapling(world, (ITree) tree, player.getGameProfile(), x, y, z);
|
||||
} else {
|
||||
return germling.copy().tryPlaceItemIntoWorld(player, world, x, y - 1, z, 1, 0, 0, 0);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
Reference in new issue
Block a user