From e857e536d7dcea7c4e847ba598a0ed7dd20ed3e6 Mon Sep 17 00:00:00 2001 From: Walker Selby Date: Tue, 22 Feb 2022 21:17:19 -0600 Subject: Add Custom Resource Pack Support to Mining in Profile Viewer (#86) * Add createSkull Util Add createSkull Util, makes it easier to make a custom skull when needed. * Fix Gemstone Collection Change displayName from "Gem stones" to "Gemstone" Change displayItem from Red Stained Glass to Gemstone Item Head. * Update GuiProfileViewer Remove code remnant in comment Add space to switch (potm) for consistent style Add NBT data so that Custom Resource Packs work properly with the HOTM GUI. Change tooltip logic to add third yellow color when in progress, matching Hypixel's HOTM display. --- .../moulberry/notenoughupdates/util/Utils.java | 25 ++++++++++++++++++++++ 1 file changed, 25 insertions(+) (limited to 'src/main/java/io/github/moulberry/notenoughupdates/util/Utils.java') diff --git a/src/main/java/io/github/moulberry/notenoughupdates/util/Utils.java b/src/main/java/io/github/moulberry/notenoughupdates/util/Utils.java index f09883eb..6fde1054 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/util/Utils.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/util/Utils.java @@ -710,6 +710,31 @@ public class Utils { return itemStack; } + public static ItemStack createSkull(String displayName, String uuid, String value){ + ItemStack render = new ItemStack(Items.skull, 1, 3); + NBTTagCompound tag = new NBTTagCompound(); + NBTTagCompound skullOwner = new NBTTagCompound(); + NBTTagCompound properties = new NBTTagCompound(); + NBTTagList textures = new NBTTagList(); + NBTTagCompound textures_0 = new NBTTagCompound(); + NBTTagCompound display = new NBTTagCompound(); + + skullOwner.setString("Id", uuid); + skullOwner.setString("Name", uuid); + + textures_0.setString("Value", value); + textures.appendTag(textures_0); + + display.setString("Name", displayName); + tag.setTag("display",display); + + properties.setTag("textures", textures); + skullOwner.setTag("Properties", properties); + tag.setTag("SkullOwner", skullOwner); + render.setTagCompound(tag); + return render; + } + public static void drawStringF(String str, FontRenderer fr, float x, float y, boolean shadow, int colour) { fr.drawString(str, x, y, colour, shadow); } -- cgit