use of lumien.randomthings.tileentity.TileEntityInventoryRerouter in project Random-Things by lumien231.
the class BlockInventoryRerouter method getExtendedState.
@Override
public IBlockState getExtendedState(IBlockState state, IBlockAccess worldIn, BlockPos pos) {
TileEntity te = worldIn.getTileEntity(pos);
IExtendedBlockState extendedState = (IExtendedBlockState) state;
if (te instanceof TileEntityInventoryRerouter) {
TileEntityInventoryRerouter rerouter = (TileEntityInventoryRerouter) te;
Map<EnumFacing, EnumFacing> facingMap = rerouter.getFacingMap();
return extendedState.withProperty(OVERRIDE_DATA, new HashMap<>(facingMap));
}
return super.getActualState(state, worldIn, pos);
}
use of lumien.randomthings.tileentity.TileEntityInventoryRerouter in project Random-Things by lumien231.
the class BlockInventoryRerouter method onBlockActivated.
@Override
public boolean onBlockActivated(World worldIn, BlockPos pos, IBlockState state, EntityPlayer playerIn, EnumHand hand, EnumFacing facing, float hitX, float hitY, float hitZ) {
TileEntity te = worldIn.getTileEntity(pos);
EnumFacing myFacing = state.getValue(FACING);
if (facing != myFacing) {
if (te instanceof TileEntityInventoryRerouter) {
((TileEntityInventoryRerouter) te).rotateFacing(facing);
}
return true;
} else {
return false;
}
}
Aggregations