From a51c5e0645a5c63de8bc77f9c4496b38464d1c34 Mon Sep 17 00:00:00 2001 From: Skywolf is not Wolf Date: Sat, 25 Jan 2020 10:08:52 +0900 Subject: [PATCH] ReflectedNBTWrapper 1.2 Revision 3 - Fixed ItemNBTImporter.import(ItemStack,ReflectedNBTCompound) make error with arrays - *Warning!* If you edit nbt with arrays, error will occurred in previous versions. - Changed package name to v1_2R3 --- .../{v1_2R2 => v1_2R3}/BukkitVersionUtil.java | 2 +- .../CollectionMismatchedException.java | 2 +- .../Exception/UndefinedNBTException.java | 2 +- .../Interface/IReflectedNBTBase.java | 2 +- .../Interface/IReflectedNBTCompound.java | 2 +- .../Interface/IReflectedNBTList.java | 2 +- .../{v1_2R2 => v1_2R3}/ItemNBTExtrator.java | 4 ++-- .../{v1_2R2 => v1_2R3}/ItemNBTImporter.java | 4 ++-- .../Iterator/LinearIterator.java | 2 +- .../NBTData/ReflectedNBTByte.java | 6 +++--- .../NBTData/ReflectedNBTByteArray.java | 6 +++--- .../NBTData/ReflectedNBTCompound.java | 12 ++++++------ .../NBTData/ReflectedNBTDouble.java | 6 +++--- .../NBTData/ReflectedNBTFloat.java | 6 +++--- .../NBTData/ReflectedNBTInteger.java | 6 +++--- .../NBTData/ReflectedNBTIntegerArray.java | 13 ++++++++----- .../NBTData/ReflectedNBTList.java | 18 +++++++++--------- .../NBTData/ReflectedNBTLong.java | 10 +++++++--- .../NBTData/ReflectedNBTLongArray.java | 6 +++--- .../NBTData/ReflectedNBTShort.java | 6 +++--- .../NBTData/ReflectedNBTString.java | 6 +++--- .../ReflectedNBTStorage.java | 6 +++--- 22 files changed, 68 insertions(+), 61 deletions(-) rename src/skywolf46/NBTUtil/{v1_2R2 => v1_2R3}/BukkitVersionUtil.java (95%) rename src/skywolf46/NBTUtil/{v1_2R2 => v1_2R3}/Exception/CollectionMismatchedException.java (85%) rename src/skywolf46/NBTUtil/{v1_2R2 => v1_2R3}/Exception/UndefinedNBTException.java (80%) rename src/skywolf46/NBTUtil/{v1_2R2 => v1_2R3}/Interface/IReflectedNBTBase.java (82%) rename src/skywolf46/NBTUtil/{v1_2R2 => v1_2R3}/Interface/IReflectedNBTCompound.java (92%) rename src/skywolf46/NBTUtil/{v1_2R2 => v1_2R3}/Interface/IReflectedNBTList.java (91%) rename src/skywolf46/NBTUtil/{v1_2R2 => v1_2R3}/ItemNBTExtrator.java (94%) rename src/skywolf46/NBTUtil/{v1_2R2 => v1_2R3}/ItemNBTImporter.java (94%) rename src/skywolf46/NBTUtil/{v1_2R2 => v1_2R3}/Iterator/LinearIterator.java (90%) rename src/skywolf46/NBTUtil/{v1_2R2 => v1_2R3}/NBTData/ReflectedNBTByte.java (92%) rename src/skywolf46/NBTUtil/{v1_2R2 => v1_2R3}/NBTData/ReflectedNBTByteArray.java (93%) rename src/skywolf46/NBTUtil/{v1_2R2 => v1_2R3}/NBTData/ReflectedNBTCompound.java (93%) rename src/skywolf46/NBTUtil/{v1_2R2 => v1_2R3}/NBTData/ReflectedNBTDouble.java (92%) rename src/skywolf46/NBTUtil/{v1_2R2 => v1_2R3}/NBTData/ReflectedNBTFloat.java (92%) rename src/skywolf46/NBTUtil/{v1_2R2 => v1_2R3}/NBTData/ReflectedNBTInteger.java (92%) rename src/skywolf46/NBTUtil/{v1_2R2 => v1_2R3}/NBTData/ReflectedNBTIntegerArray.java (83%) rename src/skywolf46/NBTUtil/{v1_2R2 => v1_2R3}/NBTData/ReflectedNBTList.java (91%) rename src/skywolf46/NBTUtil/{v1_2R2 => v1_2R3}/NBTData/ReflectedNBTLong.java (89%) rename src/skywolf46/NBTUtil/{v1_2R2 => v1_2R3}/NBTData/ReflectedNBTLongArray.java (93%) rename src/skywolf46/NBTUtil/{v1_2R2 => v1_2R3}/NBTData/ReflectedNBTShort.java (92%) rename src/skywolf46/NBTUtil/{v1_2R2 => v1_2R3}/NBTData/ReflectedNBTString.java (92%) rename src/skywolf46/NBTUtil/{v1_2R2 => v1_2R3}/ReflectedNBTStorage.java (96%) diff --git a/src/skywolf46/NBTUtil/v1_2R2/BukkitVersionUtil.java b/src/skywolf46/NBTUtil/v1_2R3/BukkitVersionUtil.java similarity index 95% rename from src/skywolf46/NBTUtil/v1_2R2/BukkitVersionUtil.java rename to src/skywolf46/NBTUtil/v1_2R3/BukkitVersionUtil.java index 7f964a1..b6bf57d 100644 --- a/src/skywolf46/NBTUtil/v1_2R2/BukkitVersionUtil.java +++ b/src/skywolf46/NBTUtil/v1_2R3/BukkitVersionUtil.java @@ -1,4 +1,4 @@ -package skywolf46.NBTUtil.v1_2R2; +package skywolf46.NBTUtil.v1_2R3; import org.bukkit.Bukkit; import org.bukkit.Server; diff --git a/src/skywolf46/NBTUtil/v1_2R2/Exception/CollectionMismatchedException.java b/src/skywolf46/NBTUtil/v1_2R3/Exception/CollectionMismatchedException.java similarity index 85% rename from src/skywolf46/NBTUtil/v1_2R2/Exception/CollectionMismatchedException.java rename to src/skywolf46/NBTUtil/v1_2R3/Exception/CollectionMismatchedException.java index 94f6d4c..1275462 100644 --- a/src/skywolf46/NBTUtil/v1_2R2/Exception/CollectionMismatchedException.java +++ b/src/skywolf46/NBTUtil/v1_2R3/Exception/CollectionMismatchedException.java @@ -1,4 +1,4 @@ -package skywolf46.NBTUtil.v1_2R2.Exception; +package skywolf46.NBTUtil.v1_2R3.Exception; public class CollectionMismatchedException extends RuntimeException { public CollectionMismatchedException(Class bef, Class nex) { diff --git a/src/skywolf46/NBTUtil/v1_2R2/Exception/UndefinedNBTException.java b/src/skywolf46/NBTUtil/v1_2R3/Exception/UndefinedNBTException.java similarity index 80% rename from src/skywolf46/NBTUtil/v1_2R2/Exception/UndefinedNBTException.java rename to src/skywolf46/NBTUtil/v1_2R3/Exception/UndefinedNBTException.java index 2080844..2e5a8fc 100644 --- a/src/skywolf46/NBTUtil/v1_2R2/Exception/UndefinedNBTException.java +++ b/src/skywolf46/NBTUtil/v1_2R3/Exception/UndefinedNBTException.java @@ -1,4 +1,4 @@ -package skywolf46.NBTUtil.v1_2R2.Exception; +package skywolf46.NBTUtil.v1_2R3.Exception; public class UndefinedNBTException extends RuntimeException { public UndefinedNBTException(Class c) { diff --git a/src/skywolf46/NBTUtil/v1_2R2/Interface/IReflectedNBTBase.java b/src/skywolf46/NBTUtil/v1_2R3/Interface/IReflectedNBTBase.java similarity index 82% rename from src/skywolf46/NBTUtil/v1_2R2/Interface/IReflectedNBTBase.java rename to src/skywolf46/NBTUtil/v1_2R3/Interface/IReflectedNBTBase.java index 420b101..e215869 100644 --- a/src/skywolf46/NBTUtil/v1_2R2/Interface/IReflectedNBTBase.java +++ b/src/skywolf46/NBTUtil/v1_2R3/Interface/IReflectedNBTBase.java @@ -1,4 +1,4 @@ -package skywolf46.NBTUtil.v1_2R2.Interface; +package skywolf46.NBTUtil.v1_2R3.Interface; public interface IReflectedNBTBase { T getValue(); diff --git a/src/skywolf46/NBTUtil/v1_2R2/Interface/IReflectedNBTCompound.java b/src/skywolf46/NBTUtil/v1_2R3/Interface/IReflectedNBTCompound.java similarity index 92% rename from src/skywolf46/NBTUtil/v1_2R2/Interface/IReflectedNBTCompound.java rename to src/skywolf46/NBTUtil/v1_2R3/Interface/IReflectedNBTCompound.java index 71f6c2d..60a80ce 100644 --- a/src/skywolf46/NBTUtil/v1_2R2/Interface/IReflectedNBTCompound.java +++ b/src/skywolf46/NBTUtil/v1_2R3/Interface/IReflectedNBTCompound.java @@ -1,4 +1,4 @@ -package skywolf46.NBTUtil.v1_2R2.Interface; +package skywolf46.NBTUtil.v1_2R3.Interface; import java.util.HashMap; import java.util.List; diff --git a/src/skywolf46/NBTUtil/v1_2R2/Interface/IReflectedNBTList.java b/src/skywolf46/NBTUtil/v1_2R3/Interface/IReflectedNBTList.java similarity index 91% rename from src/skywolf46/NBTUtil/v1_2R2/Interface/IReflectedNBTList.java rename to src/skywolf46/NBTUtil/v1_2R3/Interface/IReflectedNBTList.java index 99d454a..841e1f6 100644 --- a/src/skywolf46/NBTUtil/v1_2R2/Interface/IReflectedNBTList.java +++ b/src/skywolf46/NBTUtil/v1_2R3/Interface/IReflectedNBTList.java @@ -1,4 +1,4 @@ -package skywolf46.NBTUtil.v1_2R2.Interface; +package skywolf46.NBTUtil.v1_2R3.Interface; import java.util.List; diff --git a/src/skywolf46/NBTUtil/v1_2R2/ItemNBTExtrator.java b/src/skywolf46/NBTUtil/v1_2R3/ItemNBTExtrator.java similarity index 94% rename from src/skywolf46/NBTUtil/v1_2R2/ItemNBTExtrator.java rename to src/skywolf46/NBTUtil/v1_2R3/ItemNBTExtrator.java index a2217b6..3e5ca37 100644 --- a/src/skywolf46/NBTUtil/v1_2R2/ItemNBTExtrator.java +++ b/src/skywolf46/NBTUtil/v1_2R3/ItemNBTExtrator.java @@ -1,7 +1,7 @@ -package skywolf46.NBTUtil.v1_2R2; +package skywolf46.NBTUtil.v1_2R3; import org.bukkit.inventory.ItemStack; -import skywolf46.NBTUtil.v1_2R2.NBTData.ReflectedNBTCompound; +import skywolf46.NBTUtil.v1_2R3.NBTData.ReflectedNBTCompound; import java.lang.reflect.InvocationTargetException; import java.lang.reflect.Method; diff --git a/src/skywolf46/NBTUtil/v1_2R2/ItemNBTImporter.java b/src/skywolf46/NBTUtil/v1_2R3/ItemNBTImporter.java similarity index 94% rename from src/skywolf46/NBTUtil/v1_2R2/ItemNBTImporter.java rename to src/skywolf46/NBTUtil/v1_2R3/ItemNBTImporter.java index 0ddf9e8..fa7cb7e 100644 --- a/src/skywolf46/NBTUtil/v1_2R2/ItemNBTImporter.java +++ b/src/skywolf46/NBTUtil/v1_2R3/ItemNBTImporter.java @@ -1,7 +1,7 @@ -package skywolf46.NBTUtil.v1_2R2; +package skywolf46.NBTUtil.v1_2R3; import org.bukkit.inventory.ItemStack; -import skywolf46.NBTUtil.v1_2R2.NBTData.ReflectedNBTCompound; +import skywolf46.NBTUtil.v1_2R3.NBTData.ReflectedNBTCompound; import java.lang.reflect.InvocationTargetException; import java.lang.reflect.Method; diff --git a/src/skywolf46/NBTUtil/v1_2R2/Iterator/LinearIterator.java b/src/skywolf46/NBTUtil/v1_2R3/Iterator/LinearIterator.java similarity index 90% rename from src/skywolf46/NBTUtil/v1_2R2/Iterator/LinearIterator.java rename to src/skywolf46/NBTUtil/v1_2R3/Iterator/LinearIterator.java index 0170cd8..72194ea 100644 --- a/src/skywolf46/NBTUtil/v1_2R2/Iterator/LinearIterator.java +++ b/src/skywolf46/NBTUtil/v1_2R3/Iterator/LinearIterator.java @@ -1,4 +1,4 @@ -package skywolf46.NBTUtil.v1_2R2.Iterator; +package skywolf46.NBTUtil.v1_2R3.Iterator; import java.util.Iterator; diff --git a/src/skywolf46/NBTUtil/v1_2R2/NBTData/ReflectedNBTByte.java b/src/skywolf46/NBTUtil/v1_2R3/NBTData/ReflectedNBTByte.java similarity index 92% rename from src/skywolf46/NBTUtil/v1_2R2/NBTData/ReflectedNBTByte.java rename to src/skywolf46/NBTUtil/v1_2R3/NBTData/ReflectedNBTByte.java index 28d8166..71f11a3 100644 --- a/src/skywolf46/NBTUtil/v1_2R2/NBTData/ReflectedNBTByte.java +++ b/src/skywolf46/NBTUtil/v1_2R3/NBTData/ReflectedNBTByte.java @@ -1,7 +1,7 @@ -package skywolf46.NBTUtil.v1_2R2.NBTData; +package skywolf46.NBTUtil.v1_2R3.NBTData; -import skywolf46.NBTUtil.v1_2R2.BukkitVersionUtil; -import skywolf46.NBTUtil.v1_2R2.Interface.IReflectedNBTBase; +import skywolf46.NBTUtil.v1_2R3.BukkitVersionUtil; +import skywolf46.NBTUtil.v1_2R3.Interface.IReflectedNBTBase; import java.lang.reflect.Constructor; import java.lang.reflect.Field; diff --git a/src/skywolf46/NBTUtil/v1_2R2/NBTData/ReflectedNBTByteArray.java b/src/skywolf46/NBTUtil/v1_2R3/NBTData/ReflectedNBTByteArray.java similarity index 93% rename from src/skywolf46/NBTUtil/v1_2R2/NBTData/ReflectedNBTByteArray.java rename to src/skywolf46/NBTUtil/v1_2R3/NBTData/ReflectedNBTByteArray.java index 8e5258b..a079c07 100644 --- a/src/skywolf46/NBTUtil/v1_2R2/NBTData/ReflectedNBTByteArray.java +++ b/src/skywolf46/NBTUtil/v1_2R3/NBTData/ReflectedNBTByteArray.java @@ -1,7 +1,7 @@ -package skywolf46.NBTUtil.v1_2R2.NBTData; +package skywolf46.NBTUtil.v1_2R3.NBTData; -import skywolf46.NBTUtil.v1_2R2.BukkitVersionUtil; -import skywolf46.NBTUtil.v1_2R2.Interface.IReflectedNBTBase; +import skywolf46.NBTUtil.v1_2R3.BukkitVersionUtil; +import skywolf46.NBTUtil.v1_2R3.Interface.IReflectedNBTBase; import java.lang.reflect.Constructor; import java.lang.reflect.Field; diff --git a/src/skywolf46/NBTUtil/v1_2R2/NBTData/ReflectedNBTCompound.java b/src/skywolf46/NBTUtil/v1_2R3/NBTData/ReflectedNBTCompound.java similarity index 93% rename from src/skywolf46/NBTUtil/v1_2R2/NBTData/ReflectedNBTCompound.java rename to src/skywolf46/NBTUtil/v1_2R3/NBTData/ReflectedNBTCompound.java index aec668b..dfbc5be 100644 --- a/src/skywolf46/NBTUtil/v1_2R2/NBTData/ReflectedNBTCompound.java +++ b/src/skywolf46/NBTUtil/v1_2R3/NBTData/ReflectedNBTCompound.java @@ -1,10 +1,10 @@ -package skywolf46.NBTUtil.v1_2R2.NBTData; +package skywolf46.NBTUtil.v1_2R3.NBTData; -import skywolf46.NBTUtil.v1_2R2.BukkitVersionUtil; -import skywolf46.NBTUtil.v1_2R2.Exception.UndefinedNBTException; -import skywolf46.NBTUtil.v1_2R2.Interface.IReflectedNBTBase; -import skywolf46.NBTUtil.v1_2R2.Interface.IReflectedNBTCompound; -import skywolf46.NBTUtil.v1_2R2.ReflectedNBTStorage; +import skywolf46.NBTUtil.v1_2R3.BukkitVersionUtil; +import skywolf46.NBTUtil.v1_2R3.Exception.UndefinedNBTException; +import skywolf46.NBTUtil.v1_2R3.Interface.IReflectedNBTBase; +import skywolf46.NBTUtil.v1_2R3.Interface.IReflectedNBTCompound; +import skywolf46.NBTUtil.v1_2R3.ReflectedNBTStorage; import java.lang.reflect.Constructor; import java.lang.reflect.Field; diff --git a/src/skywolf46/NBTUtil/v1_2R2/NBTData/ReflectedNBTDouble.java b/src/skywolf46/NBTUtil/v1_2R3/NBTData/ReflectedNBTDouble.java similarity index 92% rename from src/skywolf46/NBTUtil/v1_2R2/NBTData/ReflectedNBTDouble.java rename to src/skywolf46/NBTUtil/v1_2R3/NBTData/ReflectedNBTDouble.java index c7e6ebc..9413d32 100644 --- a/src/skywolf46/NBTUtil/v1_2R2/NBTData/ReflectedNBTDouble.java +++ b/src/skywolf46/NBTUtil/v1_2R3/NBTData/ReflectedNBTDouble.java @@ -1,7 +1,7 @@ -package skywolf46.NBTUtil.v1_2R2.NBTData; +package skywolf46.NBTUtil.v1_2R3.NBTData; -import skywolf46.NBTUtil.v1_2R2.BukkitVersionUtil; -import skywolf46.NBTUtil.v1_2R2.Interface.IReflectedNBTBase; +import skywolf46.NBTUtil.v1_2R3.BukkitVersionUtil; +import skywolf46.NBTUtil.v1_2R3.Interface.IReflectedNBTBase; import java.lang.reflect.Constructor; import java.lang.reflect.Field; diff --git a/src/skywolf46/NBTUtil/v1_2R2/NBTData/ReflectedNBTFloat.java b/src/skywolf46/NBTUtil/v1_2R3/NBTData/ReflectedNBTFloat.java similarity index 92% rename from src/skywolf46/NBTUtil/v1_2R2/NBTData/ReflectedNBTFloat.java rename to src/skywolf46/NBTUtil/v1_2R3/NBTData/ReflectedNBTFloat.java index 12b3f84..10c525b 100644 --- a/src/skywolf46/NBTUtil/v1_2R2/NBTData/ReflectedNBTFloat.java +++ b/src/skywolf46/NBTUtil/v1_2R3/NBTData/ReflectedNBTFloat.java @@ -1,7 +1,7 @@ -package skywolf46.NBTUtil.v1_2R2.NBTData; +package skywolf46.NBTUtil.v1_2R3.NBTData; -import skywolf46.NBTUtil.v1_2R2.BukkitVersionUtil; -import skywolf46.NBTUtil.v1_2R2.Interface.IReflectedNBTBase; +import skywolf46.NBTUtil.v1_2R3.BukkitVersionUtil; +import skywolf46.NBTUtil.v1_2R3.Interface.IReflectedNBTBase; import java.lang.reflect.Constructor; import java.lang.reflect.Field; diff --git a/src/skywolf46/NBTUtil/v1_2R2/NBTData/ReflectedNBTInteger.java b/src/skywolf46/NBTUtil/v1_2R3/NBTData/ReflectedNBTInteger.java similarity index 92% rename from src/skywolf46/NBTUtil/v1_2R2/NBTData/ReflectedNBTInteger.java rename to src/skywolf46/NBTUtil/v1_2R3/NBTData/ReflectedNBTInteger.java index 129f794..961d5d7 100644 --- a/src/skywolf46/NBTUtil/v1_2R2/NBTData/ReflectedNBTInteger.java +++ b/src/skywolf46/NBTUtil/v1_2R3/NBTData/ReflectedNBTInteger.java @@ -1,7 +1,7 @@ -package skywolf46.NBTUtil.v1_2R2.NBTData; +package skywolf46.NBTUtil.v1_2R3.NBTData; -import skywolf46.NBTUtil.v1_2R2.BukkitVersionUtil; -import skywolf46.NBTUtil.v1_2R2.Interface.IReflectedNBTBase; +import skywolf46.NBTUtil.v1_2R3.BukkitVersionUtil; +import skywolf46.NBTUtil.v1_2R3.Interface.IReflectedNBTBase; import java.lang.reflect.Constructor; import java.lang.reflect.Field; diff --git a/src/skywolf46/NBTUtil/v1_2R2/NBTData/ReflectedNBTIntegerArray.java b/src/skywolf46/NBTUtil/v1_2R3/NBTData/ReflectedNBTIntegerArray.java similarity index 83% rename from src/skywolf46/NBTUtil/v1_2R2/NBTData/ReflectedNBTIntegerArray.java rename to src/skywolf46/NBTUtil/v1_2R3/NBTData/ReflectedNBTIntegerArray.java index a405d67..e532e2d 100644 --- a/src/skywolf46/NBTUtil/v1_2R2/NBTData/ReflectedNBTIntegerArray.java +++ b/src/skywolf46/NBTUtil/v1_2R3/NBTData/ReflectedNBTIntegerArray.java @@ -1,7 +1,7 @@ -package skywolf46.NBTUtil.v1_2R2.NBTData; +package skywolf46.NBTUtil.v1_2R3.NBTData; -import skywolf46.NBTUtil.v1_2R2.BukkitVersionUtil; -import skywolf46.NBTUtil.v1_2R2.Interface.IReflectedNBTBase; +import skywolf46.NBTUtil.v1_2R3.BukkitVersionUtil; +import skywolf46.NBTUtil.v1_2R3.Interface.IReflectedNBTBase; import java.lang.reflect.Constructor; import java.lang.reflect.Field; @@ -20,7 +20,7 @@ public class ReflectedNBTIntegerArray implements IReflectedNBTBase { NBT_CLASS = BukkitVersionUtil.getNMSClass("NBTTagIntArray"); CONTENT_FIELD = NBT_CLASS.getDeclaredField("data"); CONTENT_FIELD.setAccessible(true); - NBT_CONSTRUCTOR = NBT_CLASS.getConstructor(new int[0].getClass()); + NBT_CONSTRUCTOR = NBT_CLASS.getConstructor(int[].class); } catch (ClassNotFoundException e) { e.printStackTrace(); } catch (NoSuchMethodException e) { @@ -71,7 +71,10 @@ public void setNBTValue(IReflectedNBTBase base) { public Object getNBTBase() { try { - return NBT_CONSTRUCTOR.newInstance(Arrays.copyOf(data, data.length)); + int[] data = new int[this.data.length]; + for (int i = 0; i < data.length; i++) + data[i] = this.data[i]; + return NBT_CONSTRUCTOR.newInstance(data); } catch (InstantiationException e) { e.printStackTrace(); } catch (IllegalAccessException e) { diff --git a/src/skywolf46/NBTUtil/v1_2R2/NBTData/ReflectedNBTList.java b/src/skywolf46/NBTUtil/v1_2R3/NBTData/ReflectedNBTList.java similarity index 91% rename from src/skywolf46/NBTUtil/v1_2R2/NBTData/ReflectedNBTList.java rename to src/skywolf46/NBTUtil/v1_2R3/NBTData/ReflectedNBTList.java index 199eb4d..66e8d77 100644 --- a/src/skywolf46/NBTUtil/v1_2R2/NBTData/ReflectedNBTList.java +++ b/src/skywolf46/NBTUtil/v1_2R3/NBTData/ReflectedNBTList.java @@ -1,12 +1,12 @@ -package skywolf46.NBTUtil.v1_2R2.NBTData; +package skywolf46.NBTUtil.v1_2R3.NBTData; -import skywolf46.NBTUtil.v1_2R2.BukkitVersionUtil; -import skywolf46.NBTUtil.v1_2R2.Exception.CollectionMismatchedException; -import skywolf46.NBTUtil.v1_2R2.Exception.UndefinedNBTException; -import skywolf46.NBTUtil.v1_2R2.Interface.IReflectedNBTBase; -import skywolf46.NBTUtil.v1_2R2.Interface.IReflectedNBTList; -import skywolf46.NBTUtil.v1_2R2.Iterator.LinearIterator; -import skywolf46.NBTUtil.v1_2R2.ReflectedNBTStorage; +import skywolf46.NBTUtil.v1_2R3.BukkitVersionUtil; +import skywolf46.NBTUtil.v1_2R3.Exception.CollectionMismatchedException; +import skywolf46.NBTUtil.v1_2R3.Exception.UndefinedNBTException; +import skywolf46.NBTUtil.v1_2R3.Interface.IReflectedNBTBase; +import skywolf46.NBTUtil.v1_2R3.Interface.IReflectedNBTList; +import skywolf46.NBTUtil.v1_2R3.Iterator.LinearIterator; +import skywolf46.NBTUtil.v1_2R3.ReflectedNBTStorage; import javax.annotation.Nonnull; import java.lang.reflect.*; @@ -56,7 +56,7 @@ public ReflectedNBTList(Object o) { for (Object obj : listNBT) nb.add(ReflectedNBTStorage.createReflectedNBT(obj)); if (listNBT.size() != 0) - nbtClass = listNBT.get(0).getClass(); + nbtClass = nb.get(0).getClass(); } catch (IllegalAccessException e) { e.printStackTrace(); } diff --git a/src/skywolf46/NBTUtil/v1_2R2/NBTData/ReflectedNBTLong.java b/src/skywolf46/NBTUtil/v1_2R3/NBTData/ReflectedNBTLong.java similarity index 89% rename from src/skywolf46/NBTUtil/v1_2R2/NBTData/ReflectedNBTLong.java rename to src/skywolf46/NBTUtil/v1_2R3/NBTData/ReflectedNBTLong.java index 8d2bf8e..480ecf7 100644 --- a/src/skywolf46/NBTUtil/v1_2R2/NBTData/ReflectedNBTLong.java +++ b/src/skywolf46/NBTUtil/v1_2R3/NBTData/ReflectedNBTLong.java @@ -1,7 +1,7 @@ -package skywolf46.NBTUtil.v1_2R2.NBTData; +package skywolf46.NBTUtil.v1_2R3.NBTData; -import skywolf46.NBTUtil.v1_2R2.BukkitVersionUtil; -import skywolf46.NBTUtil.v1_2R2.Interface.IReflectedNBTBase; +import skywolf46.NBTUtil.v1_2R3.BukkitVersionUtil; +import skywolf46.NBTUtil.v1_2R3.Interface.IReflectedNBTBase; import java.lang.reflect.Constructor; import java.lang.reflect.Field; @@ -43,6 +43,10 @@ public ReflectedNBTLong() { this.d = 0; } + public ReflectedNBTLong(long l) { + this.d = l; + } + @Override public Long getValue() { return d; diff --git a/src/skywolf46/NBTUtil/v1_2R2/NBTData/ReflectedNBTLongArray.java b/src/skywolf46/NBTUtil/v1_2R3/NBTData/ReflectedNBTLongArray.java similarity index 93% rename from src/skywolf46/NBTUtil/v1_2R2/NBTData/ReflectedNBTLongArray.java rename to src/skywolf46/NBTUtil/v1_2R3/NBTData/ReflectedNBTLongArray.java index 60080f7..d3a5ba9 100644 --- a/src/skywolf46/NBTUtil/v1_2R2/NBTData/ReflectedNBTLongArray.java +++ b/src/skywolf46/NBTUtil/v1_2R3/NBTData/ReflectedNBTLongArray.java @@ -1,7 +1,7 @@ -package skywolf46.NBTUtil.v1_2R2.NBTData; +package skywolf46.NBTUtil.v1_2R3.NBTData; -import skywolf46.NBTUtil.v1_2R2.BukkitVersionUtil; -import skywolf46.NBTUtil.v1_2R2.Interface.IReflectedNBTBase; +import skywolf46.NBTUtil.v1_2R3.BukkitVersionUtil; +import skywolf46.NBTUtil.v1_2R3.Interface.IReflectedNBTBase; import java.lang.reflect.Constructor; import java.lang.reflect.Field; diff --git a/src/skywolf46/NBTUtil/v1_2R2/NBTData/ReflectedNBTShort.java b/src/skywolf46/NBTUtil/v1_2R3/NBTData/ReflectedNBTShort.java similarity index 92% rename from src/skywolf46/NBTUtil/v1_2R2/NBTData/ReflectedNBTShort.java rename to src/skywolf46/NBTUtil/v1_2R3/NBTData/ReflectedNBTShort.java index 3d68e8a..d530213 100644 --- a/src/skywolf46/NBTUtil/v1_2R2/NBTData/ReflectedNBTShort.java +++ b/src/skywolf46/NBTUtil/v1_2R3/NBTData/ReflectedNBTShort.java @@ -1,7 +1,7 @@ -package skywolf46.NBTUtil.v1_2R2.NBTData; +package skywolf46.NBTUtil.v1_2R3.NBTData; -import skywolf46.NBTUtil.v1_2R2.BukkitVersionUtil; -import skywolf46.NBTUtil.v1_2R2.Interface.IReflectedNBTBase; +import skywolf46.NBTUtil.v1_2R3.BukkitVersionUtil; +import skywolf46.NBTUtil.v1_2R3.Interface.IReflectedNBTBase; import java.lang.reflect.Constructor; import java.lang.reflect.Field; diff --git a/src/skywolf46/NBTUtil/v1_2R2/NBTData/ReflectedNBTString.java b/src/skywolf46/NBTUtil/v1_2R3/NBTData/ReflectedNBTString.java similarity index 92% rename from src/skywolf46/NBTUtil/v1_2R2/NBTData/ReflectedNBTString.java rename to src/skywolf46/NBTUtil/v1_2R3/NBTData/ReflectedNBTString.java index c9d63fb..010cdf6 100644 --- a/src/skywolf46/NBTUtil/v1_2R2/NBTData/ReflectedNBTString.java +++ b/src/skywolf46/NBTUtil/v1_2R3/NBTData/ReflectedNBTString.java @@ -1,7 +1,7 @@ -package skywolf46.NBTUtil.v1_2R2.NBTData; +package skywolf46.NBTUtil.v1_2R3.NBTData; -import skywolf46.NBTUtil.v1_2R2.BukkitVersionUtil; -import skywolf46.NBTUtil.v1_2R2.Interface.IReflectedNBTBase; +import skywolf46.NBTUtil.v1_2R3.BukkitVersionUtil; +import skywolf46.NBTUtil.v1_2R3.Interface.IReflectedNBTBase; import java.lang.reflect.Constructor; import java.lang.reflect.Field; diff --git a/src/skywolf46/NBTUtil/v1_2R2/ReflectedNBTStorage.java b/src/skywolf46/NBTUtil/v1_2R3/ReflectedNBTStorage.java similarity index 96% rename from src/skywolf46/NBTUtil/v1_2R2/ReflectedNBTStorage.java rename to src/skywolf46/NBTUtil/v1_2R3/ReflectedNBTStorage.java index 5435639..a10dbfa 100644 --- a/src/skywolf46/NBTUtil/v1_2R2/ReflectedNBTStorage.java +++ b/src/skywolf46/NBTUtil/v1_2R3/ReflectedNBTStorage.java @@ -1,7 +1,7 @@ -package skywolf46.NBTUtil.v1_2R2; +package skywolf46.NBTUtil.v1_2R3; -import skywolf46.NBTUtil.v1_2R2.Interface.IReflectedNBTBase; -import skywolf46.NBTUtil.v1_2R2.NBTData.*; +import skywolf46.NBTUtil.v1_2R3.Interface.IReflectedNBTBase; +import skywolf46.NBTUtil.v1_2R3.NBTData.*; import java.util.HashMap; import java.util.function.Function;