Search in sources :

Example 1 with ContainerTooltipComponent

use of com.tangykiwi.kiwiclient.util.tooltip.ContainerTooltipComponent in project KiwiClient by TangyKiwi.

the class Tooltips method getTooltipData.

@Subscribe
@AllowConcurrentEvents
public void getTooltipData(TooltipDataEvent event) {
    // Shulker Box
    if (hasItems(event.itemStack) && getSetting(3).asToggle().state) {
        NbtCompound compoundTag = event.itemStack.getSubNbt("BlockEntityTag");
        DefaultedList<ItemStack> itemStacks = DefaultedList.ofSize(27, ItemStack.EMPTY);
        Inventories.readNbt(compoundTag, itemStacks);
        event.tooltipData = new ContainerTooltipComponent(itemStacks, getShulkerColor(event.itemStack));
    } else // EChest
    if (event.itemStack.getItem() == Items.ENDER_CHEST && getSetting(4).asToggle().state) {
        event.tooltipData = new ContainerTooltipComponent(EChestMemory.ITEMS, new Color(0, 50, 50));
    }
}
Also used : ContainerTooltipComponent(com.tangykiwi.kiwiclient.util.tooltip.ContainerTooltipComponent) NbtCompound(net.minecraft.nbt.NbtCompound) DyeColor(net.minecraft.util.DyeColor) AllowConcurrentEvents(com.google.common.eventbus.AllowConcurrentEvents) Subscribe(com.google.common.eventbus.Subscribe)

Aggregations

AllowConcurrentEvents (com.google.common.eventbus.AllowConcurrentEvents)1 Subscribe (com.google.common.eventbus.Subscribe)1 ContainerTooltipComponent (com.tangykiwi.kiwiclient.util.tooltip.ContainerTooltipComponent)1 NbtCompound (net.minecraft.nbt.NbtCompound)1 DyeColor (net.minecraft.util.DyeColor)1