Fix leaf decay info being lost on world save/load

This commit is contained in:
mezz committed 2016-05-21 17:48:17 -07:00
1 parent 3a941ead9f
commit 9cb3e4897b
1 file changed
+17 -3
@@ -92,9 +92,23 @@ public class BlockForestryLeaves extends BlockLeaves implements ITileEntityProvi
}
@Override
public int getMetaFromState(IBlockState state){
return 0;
}
public int getMetaFromState(IBlockState state) {
int i = 0;
if (!state.getValue(DECAYABLE)) {
i |= 4;
}
if (state.getValue(CHECK_DECAY)) {
i |= 8;
}
return i;
}
@Override
public IBlockState getStateFromMeta(int meta) {
return this.getDefaultState().withProperty(DECAYABLE, (meta & 4) == 0).withProperty(CHECK_DECAY, (meta & 8) > 0);
}
/* TILE ENTITY */
@Override