Search in sources :

Example 1 with AbstractMachineBlock

use of crazypants.enderio.base.machine.base.block.AbstractMachineBlock in project EnderIO by SleepyTrousers.

the class MachineRenderMapper method mapOverlayLayer.

@Override
@SideOnly(Side.CLIENT)
public EnumMap<EnumFacing, EnumIOMode> mapOverlayLayer(@Nonnull IBlockStateWrapper state, @Nonnull IBlockAccess world, @Nonnull BlockPos pos, boolean isPainted) {
    TileEntity tileEntity = state.getTileEntity();
    Block block = state.getBlock();
    if ((tileEntity instanceof AbstractMachineEntity) && (block instanceof AbstractMachineBlock)) {
        if (isPainted) {
            return renderPaintIO((AbstractMachineEntity) tileEntity, (AbstractMachineBlock<?>) block);
        } else {
            return renderIO((AbstractMachineEntity) tileEntity, (AbstractMachineBlock<?>) block);
        }
    }
    return null;
}
Also used : TileEntity(net.minecraft.tileentity.TileEntity) AbstractMachineEntity(crazypants.enderio.base.machine.base.te.AbstractMachineEntity) AbstractMachineBlock(crazypants.enderio.base.machine.base.block.AbstractMachineBlock) AbstractMachineBlock(crazypants.enderio.base.machine.base.block.AbstractMachineBlock) Block(net.minecraft.block.Block) SideOnly(net.minecraftforge.fml.relauncher.SideOnly)

Example 2 with AbstractMachineBlock

use of crazypants.enderio.base.machine.base.block.AbstractMachineBlock in project EnderIO by SleepyTrousers.

the class MachineRenderMapper method mapBlockRender.

@Override
@SideOnly(Side.CLIENT)
public List<IBlockState> mapBlockRender(@Nonnull IBlockStateWrapper state, @Nonnull IBlockAccess world, @Nonnull BlockPos pos, BlockRenderLayer blockLayer, @Nonnull QuadCollector quadCollector) {
    TileEntity tileEntity = getTileEntity(state, pos);
    Block block = state.getBlock();
    if ((tileEntity instanceof AbstractMachineEntity) && (block instanceof AbstractMachineBlock)) {
        return render(state.getState(), world, pos, blockLayer, (AbstractMachineEntity) tileEntity, (AbstractMachineBlock<?>) block);
    }
    return null;
}
Also used : TileEntity(net.minecraft.tileentity.TileEntity) AbstractMachineEntity(crazypants.enderio.base.machine.base.te.AbstractMachineEntity) AbstractMachineBlock(crazypants.enderio.base.machine.base.block.AbstractMachineBlock) AbstractMachineBlock(crazypants.enderio.base.machine.base.block.AbstractMachineBlock) Block(net.minecraft.block.Block) SideOnly(net.minecraftforge.fml.relauncher.SideOnly)

Aggregations

AbstractMachineBlock (crazypants.enderio.base.machine.base.block.AbstractMachineBlock)2 AbstractMachineEntity (crazypants.enderio.base.machine.base.te.AbstractMachineEntity)2 Block (net.minecraft.block.Block)2 TileEntity (net.minecraft.tileentity.TileEntity)2 SideOnly (net.minecraftforge.fml.relauncher.SideOnly)2