use of crazypants.enderio.base.render.property.IOMode.EnumIOMode in project EnderIO by SleepyTrousers.
the class ReservoirBlockRenderMapper 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();
if ((tileEntity instanceof TileReservoir) && ((TileReservoir) tileEntity).isAutoEject()) {
EnumMap<EnumFacing, EnumIOMode> result = new EnumMap<EnumFacing, EnumIOMode>(EnumFacing.class);
for (NNIterator<EnumFacing> itr = NNList.FACING.fastIterator(); itr.hasNext(); ) {
EnumFacing face = itr.next();
IBlockState neighborState = world.getBlockState(pos.offset(face));
if (!isSameKind(state, neighborState)) {
result.put(face, EnumIOMode.RESERVOIR);
}
}
return result.isEmpty() ? null : result;
}
return null;
}
use of crazypants.enderio.base.render.property.IOMode.EnumIOMode in project EnderIO by SleepyTrousers.
the class InvPanelRenderMapper method renderIO.
@Override
@SideOnly(Side.CLIENT)
protected EnumMap<EnumFacing, EnumIOMode> renderIO(@Nonnull AbstractMachineEntity tileEntity, @Nonnull AbstractMachineBlock<?> block) {
EnumMap<EnumFacing, EnumIOMode> result = new EnumMap<EnumFacing, EnumIOMode>(EnumFacing.class);
EnumFacing face = tileEntity.getFacing().getOpposite();
IoMode ioMode = tileEntity.getIoMode(face);
if (ioMode != IoMode.NONE) {
result.put(face, block.mapIOMode(ioMode, face));
return result;
}
return null;
}
use of crazypants.enderio.base.render.property.IOMode.EnumIOMode in project EnderIO by SleepyTrousers.
the class ImpulseRenderMapper method renderIO.
@SideOnly(Side.CLIENT)
protected EnumMap<EnumFacing, EnumIOMode> renderIO(@Nonnull TileImpulseHopper tileEntity, @Nonnull BlockImpulseHopper block) {
EnumMap<EnumFacing, EnumIOMode> result = new EnumMap<EnumFacing, EnumIOMode>(EnumFacing.class);
for (EnumFacing face : EnumFacing.values()) {
IoMode ioMode = tileEntity.getIoMode(face);
if (ioMode != IoMode.NONE) {
EnumIOMode iOMode = mapIOMode(ioMode);
result.put(face, iOMode);
}
}
return result.isEmpty() ? null : result;
}
use of crazypants.enderio.base.render.property.IOMode.EnumIOMode 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;
}
use of crazypants.enderio.base.render.property.IOMode.EnumIOMode in project EnderIO by SleepyTrousers.
the class MachineRenderMapper method renderIO.
@SideOnly(Side.CLIENT)
protected EnumMap<EnumFacing, EnumIOMode> renderIO(@Nonnull AbstractMachineEntity tileEntity, @Nonnull AbstractMachineBlock<?> block) {
EnumMap<EnumFacing, EnumIOMode> result = new EnumMap<EnumFacing, EnumIOMode>(EnumFacing.class);
for (EnumFacing face : EnumFacing.values()) {
IoMode ioMode = tileEntity.getIoMode(face);
if (ioMode != IoMode.NONE) {
EnumIOMode iOMode = block.mapIOMode(ioMode, face);
result.put(face, iOMode);
}
}
return result.isEmpty() ? null : result;
}
Aggregations