Search in sources :

Example 1 with TileEntityDisplayStand

use of de.ellpeck.actuallyadditions.mod.tile.TileEntityDisplayStand in project TUMAT by canitzp.

the class ActuallyAdditions method renderTileEntity.

@Override
public TooltipComponent renderTileEntity(WorldClient world, EntityPlayerSP player, TileEntity tileEntity, EnumFacing side, TooltipComponent component, boolean shouldCalculate) {
    if (tileEntity instanceof TileEntityCompost) {
        InfoUtil.syncTileEntity(tileEntity, shouldCalculate && InfoUtil.getItemStackInSlot(tileEntity, side, 0) != ItemStack.EMPTY, "ConversionTime");
        int time = ((TileEntityCompost) tileEntity).conversionTime;
        component.add(new TextComponent(TextFormatting.AQUA.toString() + time + "/3000 Ticks"), TooltipComponent.Priority.HIGH);
    } else if (tileEntity instanceof TileEntityDisplayStand) {
        ItemStack stack = InfoUtil.getItemStackInSlot(tileEntity, side, 0);
        if (stack != ItemStack.EMPTY) {
            component.add(new TextComponent(TextFormatting.AQUA.toString() + stack.getDisplayName()), TooltipComponent.Priority.HIGH);
        }
    } else if (tileEntity instanceof TileEntitySmileyCloud) {
        if (!Objects.equals(((TileEntitySmileyCloud) tileEntity).name, ""))
            component.add(new TextComponent(TextFormatting.AQUA.toString() + ((TileEntitySmileyCloud) tileEntity).name), TooltipComponent.Priority.HIGH);
    }
    return component;
}
Also used : TextComponent(de.canitzp.tumat.api.components.TextComponent) TileEntityCompost(de.ellpeck.actuallyadditions.mod.tile.TileEntityCompost) ItemStack(net.minecraft.item.ItemStack) TileEntitySmileyCloud(de.ellpeck.actuallyadditions.mod.tile.TileEntitySmileyCloud) TileEntityDisplayStand(de.ellpeck.actuallyadditions.mod.tile.TileEntityDisplayStand)

Aggregations

TextComponent (de.canitzp.tumat.api.components.TextComponent)1 TileEntityCompost (de.ellpeck.actuallyadditions.mod.tile.TileEntityCompost)1 TileEntityDisplayStand (de.ellpeck.actuallyadditions.mod.tile.TileEntityDisplayStand)1 TileEntitySmileyCloud (de.ellpeck.actuallyadditions.mod.tile.TileEntitySmileyCloud)1 ItemStack (net.minecraft.item.ItemStack)1