use of crazypants.enderio.powertools.machine.capbank.BlockCapBank 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.powertools.machine.capbank.BlockCapBank in project EnderIO by SleepyTrousers.
the class FillGaugeBakery method countNeighbors.
private void countNeighbors() {
if (world != null && pos != null) {
height = 1;
myOffset = 0;
BlockPos other = pos;
while (true) {
other = other.up();
IBlockState state = world.getBlockState(other);
if (!(state.getBlock() instanceof BlockCapBank) || state.getValue(CapBankType.KIND) != bankType) {
break;
}
IBlockState infrontOfOther = world.getBlockState(other.offset(face));
@SuppressWarnings("null") boolean isCovered = infrontOfOther.isSideSolid(world, other.offset(face), face.getOpposite());
if (isCovered) {
break;
}
@SuppressWarnings("null") TileEntity tileEntity = BlockEnder.getAnyTileEntitySafe(world, other);
if (!(tileEntity instanceof TileCapBank) || ((TileCapBank) tileEntity).getDisplayType(face) != InfoDisplayType.LEVEL_BAR) {
break;
}
height++;
connectUp = true;
}
other = pos;
while (true) {
other = other.down();
IBlockState state = world.getBlockState(other);
if (!(state.getBlock() instanceof BlockCapBank) || state.getValue(CapBankType.KIND) != bankType) {
break;
}
IBlockState infrontOfOther = world.getBlockState(other.offset(face));
@SuppressWarnings("null") boolean isCovered = infrontOfOther.isSideSolid(world, other.offset(face), face.getOpposite());
if (isCovered) {
break;
}
@SuppressWarnings("null") TileEntity tileEntity = BlockEnder.getAnyTileEntitySafe(world, other);
if (!(tileEntity instanceof TileCapBank) || ((TileCapBank) tileEntity).getDisplayType(face) != InfoDisplayType.LEVEL_BAR) {
break;
}
height++;
myOffset++;
connectDown = true;
}
}
}
Aggregations