use of ic2.core.ref.MetaTeBlock in project TUMAT by canitzp.
the class IndustrialCraft2 method renderBlock.
@Override
public TooltipComponent renderBlock(WorldClient world, EntityPlayerSP player, BlockPos pos, EnumFacing side, TooltipComponent component, boolean shouldCalculate) {
IBlockState state = world.getBlockState(pos);
if (state.getBlock() instanceof BlockTileEntity) {
if (InfoUtil.hasProperty(state, ((BlockTileEntity) state.getBlock()).typeProperty)) {
IProperty<MetaTeBlock> property = ((BlockTileEntity) state.getBlock()).typeProperty;
IBlockState actualState = state.getActualState(world, pos);
MetaTeBlock teBlock = actualState.getValue(property);
String name = property.getName(teBlock).replace("_active", "");
String unlocalized = "ic2.te." + name;
if (!name.contains("cable")) {
component.setName(new TextComponent(Localization.translate(unlocalized)));
}
}
}
return component;
}
Aggregations