Search in sources :

Example 1 with IMultiStateBlock

use of mod.chiselsandbits.api.IMultiStateBlock in project TUMAT by canitzp.

the class ChiselsAndBits 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 IMultiStateBlock) {
        component.setName(new TextComponent(InfoUtil.getBlockName(state)));
        component.add(new TextComponent(L10n.getChiselAndBitsBaseBlock(InfoUtil.getBlockName(((IMultiStateBlock) state.getBlock()).getPrimaryState(world, pos)))), TooltipComponent.Priority.HIGH);
    }
    return component;
}
Also used : IMultiStateBlock(mod.chiselsandbits.api.IMultiStateBlock) TextComponent(de.canitzp.tumat.api.components.TextComponent) IBlockState(net.minecraft.block.state.IBlockState)

Aggregations

TextComponent (de.canitzp.tumat.api.components.TextComponent)1 IMultiStateBlock (mod.chiselsandbits.api.IMultiStateBlock)1 IBlockState (net.minecraft.block.state.IBlockState)1