Fix #1103 The papaya and the date palm sapling item place not sapling block

This commit is contained in:
Nedelosk committed 2016-03-19 16:53:20 +01:00
1 parent cd4061b1fe
commit fa30244c5e
1 file changed
+9 -7
@@ -39,6 +39,7 @@ import forestry.api.core.IItemModelRegister;
import forestry.api.core.IModelManager;
import forestry.api.core.IStateMapperRegister;
import forestry.arboriculture.blocks.property.PropertyTree;
import forestry.arboriculture.genetics.TreeDefinition;
import forestry.arboriculture.models.SaplingStateMapper;
import forestry.arboriculture.tiles.TileSapling;
import forestry.core.proxy.Proxies;
@@ -92,17 +93,18 @@ public class BlockSapling extends BlockTreeContainer implements IGrowable, IStat
/* STATES */
@Override
public int getMetaFromState(IBlockState state) {
return TREE.getAllowedValues().indexOf(state.getValue(TREE));
}
@Override
public IBlockState getStateFromMeta(int meta) {
return getDefaultState().withProperty(TREE, TREE.getAllowedValues().get(meta));
return 0;
}
@Override
public IBlockState getActualState(IBlockState state, IBlockAccess world, BlockPos pos) {
return super.getActualState(state, world, pos);
TileSapling sapling = getSaplingTile(world, pos);
if(sapling != null && sapling.getTree() != null){
state = state.withProperty(TREE, sapling.getTree().getGenome().getPrimary());
}else{
state = state.withProperty(TREE, TreeDefinition.Oak.getGenome().getPrimary());
}
return state;
}
@Override