Fix #1815 Stop MultiFarm from converting vanilla saplings

This commit is contained in:
mezz committed 2017-08-22 21:45:55 -07:00
1 parent e1d017f077
commit ed69411d2e
4 files changed
+2 -34

No files matched your search

@@ -154,7 +154,6 @@ public class TreeRoot extends SpeciesRoot implements ITreeRoot {
@Override
@Nullable
public ITree getMember(ItemStack itemstack) {
itemstack = GeneticsUtil.convertToGeneticEquivalent(itemstack);
if (!isMember(itemstack) || itemstack.getTagCompound() == null) {
return null;
}
@@ -53,18 +53,12 @@ public class FarmableGE implements IFarmable {
public boolean plantSaplingAt(EntityPlayer player, ItemStack germling, World world, BlockPos pos) {
ITreeRoot treeRoot = TreeManager.treeRoot;
germling = GeneticsUtil.convertToGeneticEquivalent(germling);
if (treeRoot.isMember(germling)) {
ITree tree = treeRoot.getMember(germling);
return treeRoot.plantSapling(world, tree, player.getGameProfile(), pos);
} else {
return false;
}
ITree tree = treeRoot.getMember(germling);
return tree != null && treeRoot.plantSapling(world, tree, player.getGameProfile(), pos);
}
@Override
public boolean isGermling(ItemStack itemstack) {
itemstack = GeneticsUtil.convertToGeneticEquivalent(itemstack);
return TreeManager.treeRoot.isMember(itemstack);
}
@@ -55,12 +55,6 @@ public class FarmableSapling implements IFarmable {
@Override
public boolean plantSaplingAt(EntityPlayer player, ItemStack germling, World world, BlockPos pos) {
if (ForestryAPI.enabledPlugins.contains(ForestryPluginUids.ARBORICULTURE)) {
IIndividual tree = GeneticsUtil.getGeneticEquivalent(germling);
if (tree instanceof ITree) {
return TreeManager.treeRoot.plantSapling(world, (ITree) tree, player.getGameProfile(), pos);
}
}
ItemStack copy = germling.copy();
player.setHeldItem(EnumHand.MAIN_HAND, copy);
EnumActionResult actionResult = copy.onItemUse(player, world, pos.down(), EnumHand.MAIN_HAND, EnumFacing.UP, 0, 0, 0);
@@ -10,28 +10,9 @@
******************************************************************************/
package forestry.farming.logic;
import net.minecraft.block.Block;
import net.minecraft.block.state.IBlockState;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.init.Blocks;
import net.minecraft.init.Items;
import net.minecraft.item.ItemStack;
import net.minecraft.util.EnumActionResult;
import net.minecraft.util.EnumFacing;
import net.minecraft.util.EnumHand;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.World;
import forestry.api.arboriculture.ITree;
import forestry.api.arboriculture.TreeManager;
import forestry.api.core.ForestryAPI;
import forestry.api.farming.ICrop;
import forestry.api.farming.IFarmable;
import forestry.api.genetics.IIndividual;
import forestry.core.network.packets.PacketFXSignal;
import forestry.core.proxy.Proxies;
import forestry.core.utils.GeneticsUtil;
import forestry.plugins.ForestryPluginUids;
public class FarmableVanillaSapling extends FarmableSapling {