aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/io/github/moulberry/notenoughupdates/NEUManager.java
diff options
context:
space:
mode:
authorNopoTheGamer <40329022+NopoTheGamer@users.noreply.github.com>2022-07-08 02:07:38 +1000
committerGitHub <noreply@github.com>2022-07-07 18:07:38 +0200
commit6e40cd5d2426eee681b091acc6e0822d4d7c45b5 (patch)
tree5aea970325eaadfc17ad7660a53bc0e33fc18c84 /src/main/java/io/github/moulberry/notenoughupdates/NEUManager.java
parenta2ad09ee13cee2ef70268336b9df41368574f45a (diff)
downloadnotenoughupdates-6e40cd5d2426eee681b091acc6e0822d4d7c45b5.tar.gz
notenoughupdates-6e40cd5d2426eee681b091acc6e0822d4d7c45b5.tar.bz2
notenoughupdates-6e40cd5d2426eee681b091acc6e0822d4d7c45b5.zip
Added bestiary tab to pv (#177)
* some progress - missing be mobs from crimson and dungeons * fix id's * works :tm: * working mobs levels (for hub and island because lazy * idk seems right * Added bestiary texture, fixed name bug, added changelog i hope i didnt mess up anything. * i did smth * use 2.1.md from master because yes * L europe * Finished be tab * hi im just putting it here because too lazy to open a pr for this k, thanks bye * unbelievable * fix crash * fix crash with old repo * stfu infer * europe wins * l o n g Co-authored-by: jani270 <jani270@gmx.de>
Diffstat (limited to 'src/main/java/io/github/moulberry/notenoughupdates/NEUManager.java')
-rw-r--r--src/main/java/io/github/moulberry/notenoughupdates/NEUManager.java21
1 files changed, 21 insertions, 0 deletions
diff --git a/src/main/java/io/github/moulberry/notenoughupdates/NEUManager.java b/src/main/java/io/github/moulberry/notenoughupdates/NEUManager.java
index 18d756d8..cd0d08b5 100644
--- a/src/main/java/io/github/moulberry/notenoughupdates/NEUManager.java
+++ b/src/main/java/io/github/moulberry/notenoughupdates/NEUManager.java
@@ -662,6 +662,22 @@ public class NEUManager {
return uuid;
}
+ public String getSkullValueFromNBT(NBTTagCompound tag) {
+ if (tag != null && tag.hasKey("SkullOwner", 10)) {
+ NBTTagCompound ea = tag.getCompoundTag("SkullOwner");
+ NBTTagCompound ea3 = tag.getCompoundTag("display");
+
+ if (ea.hasKey("Properties", 10)) {
+ NBTTagCompound ea2 = ea;
+ ea = ea.getCompoundTag("Properties");
+ ea = ea.getTagList("textures", 10).getCompoundTagAt(0);
+ String name = ea3.getString("Name").replaceAll(" M{0,4}(CM|CD|D?C{0,3})(XC|XL|L?X{0,3})(IX|IV|V?I{0,3})$", "");
+ return "put(\"ID\", Utils.createSkull(EnumChatFormatting.AQUA + \"" + name + "\" ,\"" + ea2.getString("Id") + "\", \"" + ea.getString("Value") +"\"));";
+ }
+ }
+ return null;
+ }
+
public String getInternalnameFromNBT(NBTTagCompound tag) {
String internalname = null;
if (tag != null && tag.hasKey("ExtraAttributes", 10)) {
@@ -891,6 +907,11 @@ public class NEUManager {
return json;
}
+ public String getSkullValueForItem(ItemStack stack) {
+ if (stack == null) return null;
+ NBTTagCompound tag = stack.getTagCompound();
+ return getSkullValueFromNBT(tag);
+ }
public String getInternalNameForItem(ItemStack stack) {
if (stack == null) return null;
NBTTagCompound tag = stack.getTagCompound();