From ab0b6bc2fade5efdb2f9c4ba3a5fe40b8ae4b6ba Mon Sep 17 00:00:00 2001 From: modmuss50 Date: Wed, 7 Aug 2019 20:24:13 +0100 Subject: [PATCH] Make obstinate happy --- .../java/techreborn/items/ItemUpgrade.java | 21 +++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/src/main/java/techreborn/items/ItemUpgrade.java b/src/main/java/techreborn/items/ItemUpgrade.java index 828f3cd0b..2ebf640a8 100644 --- a/src/main/java/techreborn/items/ItemUpgrade.java +++ b/src/main/java/techreborn/items/ItemUpgrade.java @@ -24,15 +24,25 @@ package techreborn.items; +import net.fabricmc.api.EnvType; +import net.fabricmc.api.Environment; +import net.minecraft.client.gui.screen.Screen; +import net.minecraft.client.item.TooltipContext; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; +import net.minecraft.text.LiteralText; +import net.minecraft.text.Text; +import net.minecraft.util.Formatting; +import net.minecraft.world.World; import reborncore.api.blockentity.IUpgrade; import reborncore.common.recipes.IUpgradeHandler; import reborncore.common.blockentity.MachineBaseBlockEntity; import techreborn.TechReborn; +import techreborn.init.TRContent; import javax.annotation.Nonnull; import javax.annotation.Nullable; +import java.util.List; public class ItemUpgrade extends Item implements IUpgrade { @@ -54,4 +64,15 @@ public class ItemUpgrade extends Item implements IUpgrade { ItemStack stack) { behavior.process(blockEntity, handler, stack); } + + @Environment(EnvType.CLIENT) + @Override + public void appendTooltip(ItemStack stack, @Nullable World world, List tooltip, TooltipContext context) { + if(stack.getItem() == TRContent.Upgrades.SUPERCONDUCTOR.item){ + if(Screen.hasShiftDown()){ + tooltip.add(new LiteralText(Formatting.GOLD + "Blame obstinate_3 for this")); + } + } + super.appendTooltip(stack, world, tooltip, context); + } }