Skip to content

Commit

Permalink
Fix for Forge 1499 and later
Browse files Browse the repository at this point in the history
  • Loading branch information
jaquadro committed Aug 26, 2015
1 parent ff1a16e commit 2619f79
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 37 deletions.
4 changes: 2 additions & 2 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
minecraft_version=1.8
forge_version=1.8-11.14.3.1450
mod_version=2.1.8
forge_version=1.8-11.14.3.1502
mod_version=2.1.9
chameleon_version=0.1.0
chameleon_max_version=1.0.0
Original file line number Diff line number Diff line change
Expand Up @@ -113,24 +113,21 @@ protected BlockState createBlockState () {
}

@Override
public IBlockState getExtendedState (IBlockState state, IBlockAccess world, BlockPos pos) {
if (state instanceof IExtendedBlockState) {
TileEntityDrawers tile = getTileEntity(world, pos);
if (tile == null)
return state;

EnumFacing facing = EnumFacing.getFront(tile.getDirection());
if (facing.getAxis() == EnumFacing.Axis.Y)
facing = EnumFacing.NORTH;

EnumCompDrawer slots = EnumCompDrawer.OPEN1;
if (tile.isDrawerEnabled(1))
slots = EnumCompDrawer.OPEN2;
if (tile.isDrawerEnabled(2))
slots = EnumCompDrawer.OPEN3;

return ((IExtendedBlockState) state).withProperty(FACING, facing).withProperty(SLOTS, slots);
}
return state;
public IBlockState getActualState (IBlockState state, IBlockAccess world, BlockPos pos) {
TileEntityDrawers tile = getTileEntity(world, pos);
if (tile == null)
return state;

EnumFacing facing = EnumFacing.getFront(tile.getDirection());
if (facing.getAxis() == EnumFacing.Axis.Y)
facing = EnumFacing.NORTH;

EnumCompDrawer slots = EnumCompDrawer.OPEN1;
if (tile.isDrawerEnabled(1))
slots = EnumCompDrawer.OPEN2;
if (tile.isDrawerEnabled(2))
slots = EnumCompDrawer.OPEN3;

return state.withProperty(FACING, facing).withProperty(SLOTS, slots);
}
}
24 changes: 8 additions & 16 deletions src/com/jaquadro/minecraft/storagedrawers/block/BlockDrawers.java
Original file line number Diff line number Diff line change
Expand Up @@ -539,25 +539,17 @@ protected BlockState createBlockState () {

@Override
public IBlockState getActualState (IBlockState state, IBlockAccess worldIn, BlockPos pos) {
return super.getActualState(state, worldIn, pos);
}

@Override
public IBlockState getExtendedState (IBlockState state, IBlockAccess world, BlockPos pos) {
if (state instanceof IExtendedBlockState) {
TileEntityDrawers tile = getTileEntity(world, pos);
if (tile == null)
return state;
TileEntityDrawers tile = getTileEntity(worldIn, pos);
if (tile == null)
return state;

EnumFacing facing = EnumFacing.getFront(tile.getDirection());
if (facing.getAxis() == EnumFacing.Axis.Y)
facing = EnumFacing.NORTH;
EnumFacing facing = EnumFacing.getFront(tile.getDirection());
if (facing.getAxis() == EnumFacing.Axis.Y)
facing = EnumFacing.NORTH;

BlockPlanks.EnumType woodType = translateMaterial(tile.getMaterialOrDefault());
BlockPlanks.EnumType woodType = translateMaterial(tile.getMaterialOrDefault());

return ((IExtendedBlockState) state).withProperty(BLOCK, state.getValue(BLOCK)).withProperty(FACING, facing).withProperty(VARIANT, woodType);
}
return state;
return state.withProperty(BLOCK, state.getValue(BLOCK)).withProperty(FACING, facing).withProperty(VARIANT, woodType);
}

private BlockPlanks.EnumType translateMaterial (String materal) {
Expand Down

0 comments on commit 2619f79

Please sign in to comment.