use of me.desht.pneumaticcraft.common.tileentity.TileEntityVortexTube in project pnc-repressurized by TeamPneumatic.
the class BlockColorHandler method registerColorHandlers.
public static void registerColorHandlers() {
final IBlockColor heatColor = (state, blockAccess, pos, tintIndex) -> {
if (blockAccess != null && pos != null) {
TileEntity te = blockAccess.getTileEntity(pos);
int heatLevel = 10;
if (te instanceof TileEntityCompressedIronBlock) {
heatLevel = ((TileEntityCompressedIronBlock) te).getHeatLevel();
} else if (te instanceof TileEntityVortexTube) {
switch(tintIndex) {
case 0:
heatLevel = ((TileEntityVortexTube) te).getHotHeatLevel();
break;
case 1:
heatLevel = ((TileEntityVortexTube) te).getColdHeatLevel();
break;
}
}
double[] color = TileEntityCompressedIronBlock.getColorForHeatLevel(heatLevel);
return 0xFF000000 + ((int) (color[0] * 255) << 16) + ((int) (color[1] * 255) << 8) + (int) (color[2] * 255);
}
return 0xFFFFFFFF;
};
Minecraft.getMinecraft().getBlockColors().registerBlockColorHandler(heatColor, Blockss.COMPRESSED_IRON, Blockss.HEAT_SINK, Blockss.VORTEX_TUBE);
final IBlockColor uvLightBoxLampColor = (state, blockAccess, pos, tintIndex) -> {
if (blockAccess != null && pos != null) {
TileEntity te = blockAccess.getTileEntity(pos);
if (te instanceof TileEntityUVLightBox) {
return ((TileEntityUVLightBox) te).areLightsOn ? 0xFF4000FF : 0xFFAFAFE4;
}
}
return 0xFFAFAFE4;
};
Minecraft.getMinecraft().getBlockColors().registerBlockColorHandler(uvLightBoxLampColor, Blockss.UV_LIGHT_BOX);
final IBlockColor camoColor = (state, worldIn, pos, tintIndex) -> {
if (pos == null || worldIn == null)
return 0xffffff;
TileEntity te = worldIn.getTileEntity(pos);
if (te instanceof ICamouflageableTE && ((ICamouflageableTE) te).getCamouflage() != null) {
return Minecraft.getMinecraft().getBlockColors().colorMultiplier(((ICamouflageableTE) te).getCamouflage(), te.getWorld(), pos, tintIndex);
} else {
return 0xffffff;
}
};
for (Block b : Blockss.blocks) {
if (b instanceof BlockPneumaticCraftCamo) {
Minecraft.getMinecraft().getBlockColors().registerBlockColorHandler(camoColor, b);
}
}
}
use of me.desht.pneumaticcraft.common.tileentity.TileEntityVortexTube in project pnc-repressurized by TeamPneumatic.
the class BlockVortexTube method getActualState.
@Override
public IBlockState getActualState(IBlockState state, IBlockAccess worldIn, BlockPos pos) {
state = super.getActualState(state, worldIn, pos);
// worldIn.getTileEntity(pos);
TileEntityVortexTube tube = (TileEntityVortexTube) PneumaticCraftUtils.getTileEntitySafely(worldIn, pos);
for (int i = 0; i < 6; i++) {
state = state.withProperty(BlockPneumaticCraft.CONNECTION_PROPERTIES[i], tube.sidesConnected[i]);
}
return state;
}
Aggregations