Search in sources :

Example 1 with InfoDisplayType

use of crazypants.enderio.powertools.machine.capbank.InfoDisplayType in project EnderIO by SleepyTrousers.

the class CapBankBlockRenderMapper method renderBody.

@Override
@SideOnly(Side.CLIENT)
protected List<IBlockState> renderBody(@Nonnull IBlockStateWrapper state, @Nonnull IBlockAccess world, @Nonnull BlockPos pos, BlockRenderLayer blockLayer, @Nonnull QuadCollector quadCollector) {
    List<IBlockState> states = new ArrayList<IBlockState>();
    TileEntity tileEntity = state.getTileEntity();
    if (tileEntity instanceof TileCapBank && state.getBlock() instanceof BlockCapBank) {
        NNList.FACING.apply(new Callback<EnumFacing>() {

            @Override
            public void apply(@Nonnull EnumFacing face) {
                IoMode ioMode = ((TileCapBank) tileEntity).getIoMode(face);
                InfoDisplayType displayType = ((TileCapBank) tileEntity).getDisplayType(face);
                EnumIOMode iOMode = ((BlockCapBank) state.getBlock()).mapIOMode(displayType, ioMode);
                states.add(ModObject.block_machine_io.getBlockNN().getDefaultState().withProperty(IOMode.IO, IOMode.get(face, iOMode)));
            }
        });
    } else {
        states.add(state.getState().withProperty(RENDER, EnumMergingBlockRenderMode.sides).withProperty(CapBankType.KIND, CapBankType.NONE));
    }
    return states;
}
Also used : TileEntity(net.minecraft.tileentity.TileEntity) TileCapBank(crazypants.enderio.powertools.machine.capbank.TileCapBank) IBlockState(net.minecraft.block.state.IBlockState) BlockCapBank(crazypants.enderio.powertools.machine.capbank.BlockCapBank) EnumFacing(net.minecraft.util.EnumFacing) ArrayList(java.util.ArrayList) EnumIOMode(crazypants.enderio.base.render.property.IOMode.EnumIOMode) IoMode(crazypants.enderio.base.machine.modes.IoMode) InfoDisplayType(crazypants.enderio.powertools.machine.capbank.InfoDisplayType) SideOnly(net.minecraftforge.fml.relauncher.SideOnly)

Aggregations

IoMode (crazypants.enderio.base.machine.modes.IoMode)1 EnumIOMode (crazypants.enderio.base.render.property.IOMode.EnumIOMode)1 BlockCapBank (crazypants.enderio.powertools.machine.capbank.BlockCapBank)1 InfoDisplayType (crazypants.enderio.powertools.machine.capbank.InfoDisplayType)1 TileCapBank (crazypants.enderio.powertools.machine.capbank.TileCapBank)1 ArrayList (java.util.ArrayList)1 IBlockState (net.minecraft.block.state.IBlockState)1 TileEntity (net.minecraft.tileentity.TileEntity)1 EnumFacing (net.minecraft.util.EnumFacing)1 SideOnly (net.minecraftforge.fml.relauncher.SideOnly)1