Fix #431 Leaves become invisible when they start to decay

This commit is contained in:
mezz committed 2015-01-04 22:58:10 -08:00
1 parent 960b322e86
commit e5979367ee
18 files changed
+265 -199

No files matched your search

@@ -10,17 +10,17 @@
******************************************************************************/
package forestry.farming.logic;
import forestry.api.arboriculture.ITree;
import forestry.api.genetics.AlleleManager;
import forestry.api.genetics.IIndividual;
import forestry.plugins.PluginArboriculture;
import java.util.Map;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.init.Blocks;
import net.minecraft.init.Items;
import net.minecraft.item.ItemStack;
import net.minecraft.world.World;
import forestry.api.arboriculture.ITree;
import forestry.api.genetics.IIndividual;
import forestry.core.utils.GeneticsUtil;
import forestry.plugins.PluginArboriculture;
public class FarmableVanillaSapling extends FarmableGenericSapling {
public FarmableVanillaSapling() {
@@ -29,17 +29,11 @@ public class FarmableVanillaSapling extends FarmableGenericSapling {
@Override
public boolean plantSaplingAt(EntityPlayer player, ItemStack germling, World world, int x, int y, int z) {
ITree tree = null;
for (Map.Entry<ItemStack, IIndividual> entry : AlleleManager.ersatzSaplings.entrySet())
if (entry.getKey().isItemEqual(germling) && entry.getValue() instanceof ITree) {
tree = (ITree) entry.getValue();
break;
}
if (tree == null)
IIndividual tree = GeneticsUtil.getGeneticEquivalent(germling);
if (!(tree instanceof ITree))
return false;
return PluginArboriculture.treeInterface.plantSapling(world, tree, player.getGameProfile(), x, y, z);
return PluginArboriculture.treeInterface.plantSapling(world, (ITree)tree, player.getGameProfile(), x, y, z);
}
}