diff --git a/item-nbt-api/src/main/java/de/tr7zw/changeme/nbtapi/NBTCompound.java b/item-nbt-api/src/main/java/de/tr7zw/changeme/nbtapi/NBTCompound.java index 6d2614908..f5ed1c73b 100644 --- a/item-nbt-api/src/main/java/de/tr7zw/changeme/nbtapi/NBTCompound.java +++ b/item-nbt-api/src/main/java/de/tr7zw/changeme/nbtapi/NBTCompound.java @@ -1460,7 +1460,7 @@ public boolean equals(Object obj) { return false; } - protected static boolean isEqual(NBTCompound compA, NBTCompound compB, String key) { + private static boolean isEqual(NBTCompound compA, NBTCompound compB, String key) { if (compA.getType(key) != compB.getType(key)) return false; switch (compA.getType(key)) { diff --git a/item-nbt-api/src/main/java/de/tr7zw/changeme/nbtapi/NbtApiException.java b/item-nbt-api/src/main/java/de/tr7zw/changeme/nbtapi/NbtApiException.java index e71506a41..dbf536185 100644 --- a/item-nbt-api/src/main/java/de/tr7zw/changeme/nbtapi/NbtApiException.java +++ b/item-nbt-api/src/main/java/de/tr7zw/changeme/nbtapi/NbtApiException.java @@ -29,16 +29,6 @@ public NbtApiException() { super(); } - /** - * @param message - * @param cause - * @param enableSuppression - * @param writableStackTrace - */ - public NbtApiException(String message, Throwable cause, boolean enableSuppression, boolean writableStackTrace) { - super(generateMessage(message), cause, enableSuppression, writableStackTrace); - } - /** * @param message * @param cause diff --git a/item-nbt-api/src/main/java/de/tr7zw/changeme/nbtapi/utils/PathUtil.java b/item-nbt-api/src/main/java/de/tr7zw/changeme/nbtapi/utils/PathUtil.java index d0b3763fc..f1aaef4c1 100644 --- a/item-nbt-api/src/main/java/de/tr7zw/changeme/nbtapi/utils/PathUtil.java +++ b/item-nbt-api/src/main/java/de/tr7zw/changeme/nbtapi/utils/PathUtil.java @@ -27,12 +27,7 @@ public static class PathSegment { private final String path; private final Integer index; - public PathSegment(String path, int index) { - this.path = path; - this.index = index; - } - - public PathSegment(String path) { + private PathSegment(String path) { Matcher matcher = indexPattern.matcher(path); if (matcher.find()) { this.path = path.substring(0, path.indexOf("[")); diff --git a/item-nbt-api/src/main/java/de/tr7zw/changeme/nbtapi/utils/nmsmappings/ReflectionMethod.java b/item-nbt-api/src/main/java/de/tr7zw/changeme/nbtapi/utils/nmsmappings/ReflectionMethod.java index e74586367..74b156f87 100644 --- a/item-nbt-api/src/main/java/de/tr7zw/changeme/nbtapi/utils/nmsmappings/ReflectionMethod.java +++ b/item-nbt-api/src/main/java/de/tr7zw/changeme/nbtapi/utils/nmsmappings/ReflectionMethod.java @@ -5,8 +5,6 @@ import java.lang.reflect.Method; import java.util.Arrays; import java.util.UUID; -import java.util.stream.Collectors; - import org.bukkit.inventory.ItemStack; import de.tr7zw.changeme.nbtapi.NbtApiException; @@ -175,10 +173,6 @@ MinecraftVersion.MC1_7_R4, new Since(MinecraftVersion.MC1_7_R4, "asCraftMirror") NMS_WORLD_GET_TILEENTITY(ClassWrapper.NMS_WORLDSERVER, new Class[] { ClassWrapper.NMS_BLOCKPOSITION.getClazz() }, MinecraftVersion.MC1_8_R3, new Since(MinecraftVersion.MC1_8_R3, "getTileEntity"), new Since(MinecraftVersion.MC1_18_R1, "getBlockEntity(net.minecraft.core.BlockPos)")), - NMS_WORLD_SET_TILEENTITY(ClassWrapper.NMS_WORLDSERVER, - new Class[] { ClassWrapper.NMS_BLOCKPOSITION.getClazz(), ClassWrapper.NMS_TILEENTITY.getClazz() }, - MinecraftVersion.MC1_8_R3, MinecraftVersion.MC1_16_R3, - new Since(MinecraftVersion.MC1_8_R3, "setTileEntity")), NMS_WORLD_REMOVE_TILEENTITY(ClassWrapper.NMS_WORLDSERVER, new Class[] { ClassWrapper.NMS_BLOCKPOSITION.getClazz() }, MinecraftVersion.MC1_8_R3, MinecraftVersion.MC1_17_R1, new Since(MinecraftVersion.MC1_8_R3, "t"), new Since(MinecraftVersion.MC1_9_R1, "s"), new Since(MinecraftVersion.MC1_13_R1, "n"), @@ -187,11 +181,9 @@ MinecraftVersion.MC1_8_R3, MinecraftVersion.MC1_17_R1, new Since(MinecraftVersio NMS_WORLD_GET_TILEENTITY_1_7_10(ClassWrapper.NMS_WORLDSERVER, new Class[] { int.class, int.class, int.class }, MinecraftVersion.MC1_7_R4, MinecraftVersion.MC1_7_R4, new Since(MinecraftVersion.MC1_7_R4, "getTileEntity")), - // FIXME: No Spigot mapping! TILEENTITY_LOAD_LEGACY191(ClassWrapper.NMS_TILEENTITY, new Class[] { ClassWrapper.NMS_MINECRAFTSERVER.getClazz(), ClassWrapper.NMS_NBTTAGCOMPOUND.getClazz() }, MinecraftVersion.MC1_9_R1, MinecraftVersion.MC1_9_R1, new Since(MinecraftVersion.MC1_9_R1, "a")), - // FIXME: No Spigot mapping! TILEENTITY_LOAD_LEGACY183(ClassWrapper.NMS_TILEENTITY, new Class[] { ClassWrapper.NMS_NBTTAGCOMPOUND.getClazz() }, MinecraftVersion.MC1_8_R3, MinecraftVersion.MC1_9_R2, new Since(MinecraftVersion.MC1_8_R3, "c"), new Since(MinecraftVersion.MC1_9_R1, "a"), new Since(MinecraftVersion.MC1_9_R2, "c")), @@ -264,10 +256,8 @@ MinecraftVersion.MC1_7_R4, MinecraftVersion.MC1_20_R2, new Since(MinecraftVersio MinecraftVersion.MC1_13_R1, new Since(MinecraftVersion.MC1_11_R1, "keySet")), REGISTRY_GET(ClassWrapper.NMS_REGISTRYSIMPLE, new Class[] { Object.class }, MinecraftVersion.MC1_11_R1, MinecraftVersion.MC1_13_R1, new Since(MinecraftVersion.MC1_11_R1, "get")), - // FIXME: No Spigot mapping! REGISTRY_SET(ClassWrapper.NMS_REGISTRYSIMPLE, new Class[] { Object.class, Object.class }, MinecraftVersion.MC1_11_R1, MinecraftVersion.MC1_13_R1, new Since(MinecraftVersion.MC1_11_R1, "a")), - // FIXME: No Spigot mapping! REGISTRY_GET_INVERSE(ClassWrapper.NMS_REGISTRYMATERIALS, new Class[] { Object.class }, MinecraftVersion.MC1_11_R1, MinecraftVersion.MC1_13_R1, new Since(MinecraftVersion.MC1_11_R1, "b")), REGISTRYMATERIALS_KEYSET(ClassWrapper.NMS_REGISTRYMATERIALS, new Class[] {}, MinecraftVersion.MC1_13_R1, @@ -442,11 +432,11 @@ public ClassWrapper getParentClassWrapper() { return parentClassWrapper; } - public static class Since { - public final MinecraftVersion version; - public final String name; + private static class Since { + final MinecraftVersion version; + final String name; - public Since(MinecraftVersion version, String name) { + private Since(MinecraftVersion version, String name) { this.version = version; this.name = name; } diff --git a/item-nbt-api/src/main/java/de/tr7zw/changeme/nbtapi/wrapper/ProxyBuilder.java b/item-nbt-api/src/main/java/de/tr7zw/changeme/nbtapi/wrapper/ProxyBuilder.java index f4ee7bc33..335f1eba2 100644 --- a/item-nbt-api/src/main/java/de/tr7zw/changeme/nbtapi/wrapper/ProxyBuilder.java +++ b/item-nbt-api/src/main/java/de/tr7zw/changeme/nbtapi/wrapper/ProxyBuilder.java @@ -65,7 +65,7 @@ public Arguments(Class target, NBTProxy proxy, boolean readOnly, ReadWriteNBT } } - @SuppressWarnings("unchecked") + @SuppressWarnings({ "unchecked", "rawtypes" }) private static Function createFunction(NBTProxy proxy, Method method) { if ("toString".equals(method.getName()) && method.getParameterCount() == 0 && method.getReturnType() == String.class) {