Compare commits

...
5 Commits
Author SHA1 Message Date
tr7zw f648aca74b Release 2.11.1 2022-12-14 17:08:29 +01:00
tr7zw 9e79a604d3 Merge branch 'pr/204' 2022-12-14 16:56:44 +01:00
tr7zw 13c3f861c3 Add test for the failing code 2022-12-14 16:56:14 +01:00
tr7zw 25aa64a895 Start 2.11.1-SNAPSHOT 2022-12-14 16:47:44 +01:00
Kevin_OVI cc61fc1e6e Fix StackOverflowError when merging ReadableNBT
Fix StackOverflowError by casting the ReadableNBT object to a NBTCompound
2022-12-14 16:09:17 +01:00
11 changed files with 39 additions and 16 deletions

No files matched your search

+1 -1
View File
@@ -5,7 +5,7 @@
<parent>
<groupId>de.tr7zw</groupId>
<artifactId>item-nbt-parent</artifactId>
<version>2.11.0</version>
<version>2.11.1</version>
</parent>
<artifactId>item-nbt-api</artifactId>
@@ -96,7 +96,7 @@ public class NBTCompound implements ReadWriteNBT {
@Override
public void mergeCompound(ReadableNBT comp) {
if (comp instanceof NBTCompound) {
mergeCompound(comp);
mergeCompound((NBTCompound) comp);
} else {
throw new NbtApiException("Unknown NBT object: " + comp);
}
@@ -33,7 +33,7 @@ public enum MinecraftVersion {
private static Logger logger = Logger.getLogger("NBTAPI");
// NBT-API Version
protected static final String VERSION = "2.11.0";
protected static final String VERSION = "2.11.1";
private final int versionId;
private final boolean mojangMapping;
+4 -4
View File
@@ -4,7 +4,7 @@
<parent>
<groupId>de.tr7zw</groupId>
<artifactId>item-nbt-parent</artifactId>
<version>2.11.0</version>
<version>2.11.1</version>
</parent>
<artifactId>item-nbt-api-plugin</artifactId>
<packaging>jar</packaging>
@@ -12,19 +12,19 @@
<dependency>
<groupId>de.tr7zw</groupId>
<artifactId>item-nbt-api</artifactId>
<version>2.11.0</version>
<version>2.11.1</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>de.tr7zw</groupId>
<artifactId>nbt-injector</artifactId>
<version>2.11.0</version>
<version>2.11.1</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>de.tr7zw</groupId>
<artifactId>nbt-data-api</artifactId>
<version>2.11.0</version>
<version>2.11.1</version>
<scope>compile</scope>
</dependency>
</dependencies>
@@ -23,6 +23,7 @@ import de.tr7zw.nbtapi.plugin.tests.compounds.EnumTest;
import de.tr7zw.nbtapi.plugin.tests.compounds.EqualsTest;
import de.tr7zw.nbtapi.plugin.tests.compounds.ForEachTest;
import de.tr7zw.nbtapi.plugin.tests.compounds.GetterSetterTest;
import de.tr7zw.nbtapi.plugin.tests.compounds.InterfaceTest;
import de.tr7zw.nbtapi.plugin.tests.compounds.IteratorTest;
import de.tr7zw.nbtapi.plugin.tests.compounds.ListTest;
import de.tr7zw.nbtapi.plugin.tests.compounds.MergeTest;
@@ -96,6 +97,7 @@ public class NBTAPI extends JavaPlugin {
apiTests.add(new TypeTest());
apiTests.add(new RemovingKeys());
apiTests.add(new EnumTest());
apiTests.add(new InterfaceTest());
if (MinecraftVersion.isAtLeastVersion(MinecraftVersion.MC1_8_R3)) // 1.7.10 list support is not complete at all
apiTests.add(new ListTest());
apiTests.add(new SubCompoundsTest());
@@ -0,0 +1,21 @@
package de.tr7zw.nbtapi.plugin.tests.compounds;
import de.tr7zw.changeme.nbtapi.NBT;
import de.tr7zw.changeme.nbtapi.NbtApiException;
import de.tr7zw.changeme.nbtapi.iface.ReadWriteNBT;
import de.tr7zw.nbtapi.plugin.tests.Test;
public class InterfaceTest implements Test {
@Override
public void test() throws Exception {
ReadWriteNBT src = NBT.createNBTObject();
src.setString("foo", "bar");
ReadWriteNBT target = NBT.createNBTObject();
target.mergeCompound(src);
if (!"bar".equals(target.getString("foo"))) {
throw new NbtApiException("Wasn't able to check the key! The Item-NBT-API may not work!");
}
}
}
+2 -2
View File
@@ -4,7 +4,7 @@
<parent>
<groupId>de.tr7zw</groupId>
<artifactId>item-nbt-parent</artifactId>
<version>2.11.0</version>
<version>2.11.1</version>
</parent>
<artifactId>mappings-parser</artifactId>
<packaging>jar</packaging>
@@ -12,7 +12,7 @@
<dependency>
<groupId>de.tr7zw</groupId>
<artifactId>item-nbt-api</artifactId>
<version>2.11.0</version>
<version>2.11.1</version>
<scope>compile</scope>
</dependency>
</dependencies>
+2 -2
View File
@@ -5,7 +5,7 @@
<parent>
<groupId>de.tr7zw</groupId>
<artifactId>item-nbt-parent</artifactId>
<version>2.11.0</version>
<version>2.11.1</version>
</parent>
<artifactId>nbt-data-api</artifactId>
@@ -14,7 +14,7 @@
<dependency>
<groupId>de.tr7zw</groupId>
<artifactId>item-nbt-api</artifactId>
<version>2.11.0</version>
<version>2.11.1</version>
<scope>compile</scope>
</dependency>
</dependencies>
+2 -2
View File
@@ -4,7 +4,7 @@
<parent>
<groupId>de.tr7zw</groupId>
<artifactId>item-nbt-parent</artifactId>
<version>2.11.0</version>
<version>2.11.1</version>
</parent>
<artifactId>nbt-injector</artifactId>
<packaging>jar</packaging>
@@ -12,7 +12,7 @@
<dependency>
<groupId>de.tr7zw</groupId>
<artifactId>item-nbt-api</artifactId>
<version>2.11.0</version>
<version>2.11.1</version>
<scope>compile</scope>
</dependency>
<dependency>
+1 -1
View File
@@ -3,7 +3,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>de.tr7zw</groupId>
<artifactId>item-nbt-parent</artifactId>
<version>2.11.0</version>
<version>2.11.1</version>
<packaging>pom</packaging>
<inceptionYear>2015</inceptionYear>
<organization>
+2 -2
View File
@@ -112,7 +112,7 @@ Just use the Plugin as Maven dependency and remember to add "NBTAPI" as dependen
<dependency>
<groupId>de.tr7zw</groupId>
<artifactId>item-nbt-api-plugin</artifactId>
<version>2.11.0</version>
<version>2.11.1</version>
</dependency>
[/CODE]
[/SPOILER]
@@ -122,7 +122,7 @@ Using this method the API gets copied into your plugin. Server owners don't have
<dependency>
<groupId>de.tr7zw</groupId>
<artifactId>item-nbt-api</artifactId>
<version>2.11.0</version>
<version>2.11.1</version>
</dependency>
...
<plugins>