From 5a9a297d005ccd9b12dca7684f404ec28679eead Mon Sep 17 00:00:00 2001
From: Nathan Curran <30569566+Focusvity@users.noreply.github.com>
Date: Sat, 25 Apr 2020 15:33:42 +1000
Subject: [PATCH] v0.9.1
---
pom.xml | 2 +-
.../me/dpohvar/powernbt/api/NBTManager.java | 1 -
.../powernbt/completer/CompleterNBT.java | 24 +-
.../powernbt/completer/TypeCompleter.java | 1 -
.../powernbt/listener/SelectListener.java | 1 -
.../java/me/dpohvar/powernbt/nbt/NBTBase.java | 5 +
.../dpohvar/powernbt/nbt/NBTTagLongArray.java | 233 ++++++++++++++++++
.../java/me/dpohvar/powernbt/nbt/NBTType.java | 45 +++-
8 files changed, 301 insertions(+), 11 deletions(-)
create mode 100644 src/main/java/me/dpohvar/powernbt/nbt/NBTTagLongArray.java
diff --git a/pom.xml b/pom.xml
index 9bb8784..6f0cc9b 100644
--- a/pom.xml
+++ b/pom.xml
@@ -30,7 +30,7 @@
me.dpohvar.powernbt
PowerNBT
- 0.9
+ 0.9.1
jar
Powerful NBT editor for CraftBukkit 1.5 and later
diff --git a/src/main/java/me/dpohvar/powernbt/api/NBTManager.java b/src/main/java/me/dpohvar/powernbt/api/NBTManager.java
index 96108a7..5b12ab4 100644
--- a/src/main/java/me/dpohvar/powernbt/api/NBTManager.java
+++ b/src/main/java/me/dpohvar/powernbt/api/NBTManager.java
@@ -656,5 +656,4 @@ public ItemStack createCraftItemStack(NBTCompound compound)
if (compound == null) return new ItemStack(Material.AIR);
return itemStackUtils.createCraftItemStackFromNBT(compound.getHandle());
}
-
}
diff --git a/src/main/java/me/dpohvar/powernbt/completer/CompleterNBT.java b/src/main/java/me/dpohvar/powernbt/completer/CompleterNBT.java
index 16742a6..4c703cd 100644
--- a/src/main/java/me/dpohvar/powernbt/completer/CompleterNBT.java
+++ b/src/main/java/me/dpohvar/powernbt/completer/CompleterNBT.java
@@ -35,7 +35,7 @@ public void fillTabs(Caller caller, TabFormer former) throws Exception
String word = former.poll(); // object
if (word.isEmpty())
{
- former.addIfStarts("buffer", "list", "compound", "byte[]", "int[]", "debug", "file:", "gz:", "sch:");
+ former.addIfStarts("buffer", "list", "compound", "byte[]", "int[]", "long[]", "debug", "file:", "gz:", "sch:");
if (caller.getOwner() instanceof Entity) former.addIfStarts("block", "inventory", "hand", "hand:");
if (caller.getOwner() instanceof Entity && former.getQuery().startsWith("id"))
{
@@ -145,7 +145,7 @@ public void fillTabs(Caller caller, TabFormer former) throws Exception
former.addIfStarts("float", "double");
} else if (val1.matches("\\[((-?[0-9]+|#-?[0-9a-fA-F]+)(,(?!\\])|(?=\\])))*\\]"))
{
- former.addIfStarts("byte[]", "int[]");
+ former.addIfStarts("byte[]", "int[]", "long[]");
}
} else
{
@@ -240,6 +240,7 @@ public void fillTabs(Caller caller, TabFormer former) throws Exception
case DOUBLE:
case BYTEARRAY:
case INTARRAY:
+ case LONGARRAY:
String s = NBTViewer.getShortValue(base, false);
former.add(s);
return;
@@ -271,6 +272,7 @@ public void fillTabs(Caller caller, TabFormer former) throws Exception
case DOUBLE:
case BYTEARRAY:
case INTARRAY:
+ case LONGARRAY:
String s = NBTViewer.getShortValue(b, false);
former.add(s);
return;
@@ -288,7 +290,7 @@ public void fillTabs(Caller caller, TabFormer former) throws Exception
}
}
}
- former.addIfStarts("me", "item", "buffer", "list", "compound", "byte[]", "int[]");
+ former.addIfStarts("me", "item", "buffer", "list", "compound", "byte[]", "int[]", "long[]");
if (caller.getOwner() instanceof Entity) former.addIfStarts("block", "inventory", "hand", "hand:");
if (caller.getOwner() instanceof Entity && former.getQuery().startsWith("id"))
{
@@ -394,7 +396,7 @@ public void fillTabs(Caller caller, TabFormer former) throws Exception
former.addIfStarts("float", "double");
} else if (val2.matches("\\[((-?[0-9]+|#-?[0-9a-fA-F]+)(,(?!\\])|(?=\\])))*\\]"))
{
- former.addIfStarts("byte[]", "int[]");
+ former.addIfStarts("byte[]", "int[]", "long[]");
}
} else
{
@@ -447,6 +449,12 @@ private void completeTag(NBTContainer> container, TabFormer former) throws Exc
{
former.addIfStarts("[" + i + "]");
}
+ } else if (base instanceof NBTTagLongArray)
+ {
+ for (int i = 0; i < ((NBTTagLongArray) base).size(); i++)
+ {
+ former.addIfStarts("[" + i + "]");
+ }
}
}
for (String type : container.getTypes())
@@ -503,6 +511,13 @@ private void completeTag(NBTContainer> container, TabFormer former) throws Exc
String s = "[" + i + "]";
if (s.toUpperCase().startsWith(qu.toUpperCase())) former.add(option + s);
}
+ } else if (base instanceof NBTTagLongArray)
+ {
+ for (int i = 0; i < ((NBTTagLongArray) base).size(); i++)
+ {
+ String s = "[" + i + "]";
+ if (s.toUpperCase().startsWith(qu.toUpperCase())) former.add(option + s);
+ }
}
}
for (String type : container.getTypes())
@@ -519,7 +534,6 @@ private void completeTag(NBTContainer> container, TabFormer former) throws Exc
}
}
}
-
}
diff --git a/src/main/java/me/dpohvar/powernbt/completer/TypeCompleter.java b/src/main/java/me/dpohvar/powernbt/completer/TypeCompleter.java
index a9f8d05..4c9b152 100644
--- a/src/main/java/me/dpohvar/powernbt/completer/TypeCompleter.java
+++ b/src/main/java/me/dpohvar/powernbt/completer/TypeCompleter.java
@@ -120,5 +120,4 @@ private Object getObjectByQueue(String key, Queue