From e3beb353f89448e5b28bb4cf6df2ebf098e8ae04 Mon Sep 17 00:00:00 2001 From: David Troyer Date: Tue, 6 Oct 2020 19:32:01 -0700 Subject: [PATCH] Added Tethered Cannibal Heart Tooltip --- .../crossmod/wendigoism/CCWendigoismItems.java | 2 +- .../wendigoism/TetheredCannibalHeart.java | 17 +++++++++++++++++ 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/src/main/java/net/tigereye/chestcavity/crossmod/wendigoism/CCWendigoismItems.java b/src/main/java/net/tigereye/chestcavity/crossmod/wendigoism/CCWendigoismItems.java index 4fce212..276d71c 100644 --- a/src/main/java/net/tigereye/chestcavity/crossmod/wendigoism/CCWendigoismItems.java +++ b/src/main/java/net/tigereye/chestcavity/crossmod/wendigoism/CCWendigoismItems.java @@ -40,7 +40,7 @@ private static void registerItem(String name, Item item) { private static void addWindegoismHeartsToExternalOrgans(int i, Identifier identifier, Item item) { if(item == WDItems.FLESH){ Map flesh = new HashMap<>(); - flesh.put(CCItems.ORGANS_MUSCLE,.75f); + flesh.put(CCItems.ORGANS_MUSCLE,1f); VanillaOrgans.map.put(WDItems.FLESH,flesh); } if(item == WDItems.CORRUPT_FLESH){ diff --git a/src/main/java/net/tigereye/chestcavity/crossmod/wendigoism/TetheredCannibalHeart.java b/src/main/java/net/tigereye/chestcavity/crossmod/wendigoism/TetheredCannibalHeart.java index 5de50b6..bf3c213 100644 --- a/src/main/java/net/tigereye/chestcavity/crossmod/wendigoism/TetheredCannibalHeart.java +++ b/src/main/java/net/tigereye/chestcavity/crossmod/wendigoism/TetheredCannibalHeart.java @@ -1,17 +1,22 @@ package net.tigereye.chestcavity.crossmod.wendigoism; import moriyashiine.wendigoism.api.accessor.WendigoAccessor; +import net.minecraft.client.item.TooltipContext; import net.minecraft.entity.Entity; import net.minecraft.inventory.Inventory; import net.minecraft.item.ItemStack; import net.minecraft.nbt.CompoundTag; import net.minecraft.server.network.ServerPlayerEntity; +import net.minecraft.text.LiteralText; +import net.minecraft.text.Text; +import net.minecraft.text.TranslatableText; import net.minecraft.util.Identifier; import net.minecraft.world.World; import net.tigereye.chestcavity.items.OrganBase; import net.tigereye.chestcavity.listeners.OrganUpdateListeners; import java.util.HashMap; +import java.util.List; import java.util.Map; import java.util.Random; @@ -46,4 +51,16 @@ public void inventoryTick(ItemStack stack, World world, Entity entity, int slot, } } } + + public void appendTooltip(ItemStack itemStack, World world, List tooltip, TooltipContext tooltipContext) { + int wendigoism = -1; + if(itemStack.getTag() == null){ + itemStack.setTag(new CompoundTag()); + } + if(itemStack.getTag().contains("wendigoism")) { + wendigoism = itemStack.getTag().getInt("wendigoism"); + } + LiteralText text = new LiteralText("Wendigoism: "+wendigoism); + tooltip.add(text); + } }