Make obstinate happy

This commit is contained in:
modmuss50 2019-08-07 20:24:13 +01:00
parent 43c7a7fecf
commit ab0b6bc2fa

View file

@ -24,15 +24,25 @@
package techreborn.items; 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.Item;
import net.minecraft.item.ItemStack; 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.api.blockentity.IUpgrade;
import reborncore.common.recipes.IUpgradeHandler; import reborncore.common.recipes.IUpgradeHandler;
import reborncore.common.blockentity.MachineBaseBlockEntity; import reborncore.common.blockentity.MachineBaseBlockEntity;
import techreborn.TechReborn; import techreborn.TechReborn;
import techreborn.init.TRContent;
import javax.annotation.Nonnull; import javax.annotation.Nonnull;
import javax.annotation.Nullable; import javax.annotation.Nullable;
import java.util.List;
public class ItemUpgrade extends Item implements IUpgrade { public class ItemUpgrade extends Item implements IUpgrade {
@ -54,4 +64,15 @@ public class ItemUpgrade extends Item implements IUpgrade {
ItemStack stack) { ItemStack stack) {
behavior.process(blockEntity, handler, stack); behavior.process(blockEntity, handler, stack);
} }
@Environment(EnvType.CLIENT)
@Override
public void appendTooltip(ItemStack stack, @Nullable World world, List<Text> 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);
}
} }