Compare commits

..
18 Commits
Author SHA1 Message Date
tr7zw 6f25881eda Add 1.19.4 as supported version. 2.11.2 2023-03-16 19:15:55 +01:00
tr7zw bd69504f54 Merge pull request #216 from tr7zw/dependabot/maven/org.apache.maven.plugins-maven-compiler-plugin-3.11.0
Bump maven-compiler-plugin from 3.10.1 to 3.11.0
2023-03-09 21:08:23 +01:00
dependabot[bot] 85d7224fdd Bump maven-compiler-plugin from 3.10.1 to 3.11.0
Bumps [maven-compiler-plugin](https://github.com/apache/maven-compiler-plugin) from 3.10.1 to 3.11.0.
- [Release notes](https://github.com/apache/maven-compiler-plugin/releases)
- [Commits](https://github.com/apache/maven-compiler-plugin/compare/maven-compiler-plugin-3.10.1...maven-compiler-plugin-3.11.0)

---
updated-dependencies:
- dependency-name: org.apache.maven.plugins:maven-compiler-plugin
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-02-28 00:00:07 +00:00
tr7zw 8dc51a3d30 Merge pull request #214 from tr7zw/dependabot/maven/org.apache.maven.plugins-maven-javadoc-plugin-3.5.0
Bump maven-javadoc-plugin from 3.4.1 to 3.5.0
2023-02-16 10:03:07 +01:00
dependabot[bot] 8a440889b0 Bump maven-javadoc-plugin from 3.4.1 to 3.5.0
Bumps [maven-javadoc-plugin](https://github.com/apache/maven-javadoc-plugin) from 3.4.1 to 3.5.0.
- [Release notes](https://github.com/apache/maven-javadoc-plugin/releases)
- [Commits](https://github.com/apache/maven-javadoc-plugin/compare/maven-javadoc-plugin-3.4.1...maven-javadoc-plugin-3.5.0)

---
updated-dependencies:
- dependency-name: org.apache.maven.plugins:maven-javadoc-plugin
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-02-15 23:57:59 +00:00
tr7zw 4a93fdc869 Fix issue with ReadWriteNBT returning ReadableNBT 2023-02-15 22:06:17 +01:00
tr7zw c905de852d Merge pull request #210 from tr7zw/revert-209-dependabot/maven/com.diffplug.spotless-spotless-maven-plugin-2.31.0
Revert "Bump spotless-maven-plugin from 2.30.0 to 2.31.0"
2023-01-31 12:16:37 +01:00
tr7zw fd7da1e3fb Revert "Bump spotless-maven-plugin from 2.30.0 to 2.31.0" 2023-01-31 12:03:09 +01:00
tr7zw 1123e27b10 Merge pull request #209 from tr7zw/dependabot/maven/com.diffplug.spotless-spotless-maven-plugin-2.31.0
Bump spotless-maven-plugin from 2.30.0 to 2.31.0
2023-01-31 11:42:42 +01:00
dependabot[bot] a97ed32097 Bump spotless-maven-plugin from 2.30.0 to 2.31.0
Bumps [spotless-maven-plugin](https://github.com/diffplug/spotless) from 2.30.0 to 2.31.0.
- [Release notes](https://github.com/diffplug/spotless/releases)
- [Changelog](https://github.com/diffplug/spotless/blob/main/CHANGES.md)
- [Commits](https://github.com/diffplug/spotless/compare/lib/2.30.0...lib/2.31.0)

---
updated-dependencies:
- dependency-name: com.diffplug.spotless:spotless-maven-plugin
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-01-26 23:01:52 +00:00
tr7zw 05b4249bb4 Merge pull request #207 from tr7zw/dependabot/maven/com.diffplug.spotless-spotless-maven-plugin-2.30.0
Bump spotless-maven-plugin from 2.29.0 to 2.30.0
2023-01-25 20:33:17 +01:00
tr7zw e399590d1d Bump for 2.11.2-SNAPSHOT 2023-01-25 20:32:30 +01:00
tr7zw 310682ea25 Merge pull request #208 from FREE2WIN2/master
Fix Wiki repository url for maven and gradle.
2023-01-24 11:02:17 +01:00
FREE2WIN2 6b70966926 Wiki: Fix repository url of codemc repo 2023-01-20 23:03:47 +01:00
FREE2WIN2 79275c0c19 Wiki: Fix repository url of codemc repo 2023-01-20 23:03:03 +01:00
dependabot[bot] 2b21ef46bb Bump spotless-maven-plugin from 2.29.0 to 2.30.0
Bumps [spotless-maven-plugin](https://github.com/diffplug/spotless) from 2.29.0 to 2.30.0.
- [Release notes](https://github.com/diffplug/spotless/releases)
- [Changelog](https://github.com/diffplug/spotless/blob/main/CHANGES.md)
- [Commits](https://github.com/diffplug/spotless/compare/lib/2.29.0...lib/2.30.0)

---
updated-dependencies:
- dependency-name: com.diffplug.spotless:spotless-maven-plugin
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-01-16 23:03:41 +00:00
tr7zw 79e1e62862 Merge pull request #205 from tr7zw/dependabot/maven/com.diffplug.spotless-spotless-maven-plugin-2.29.0
Bump spotless-maven-plugin from 2.28.0 to 2.29.0
2023-01-03 23:51:49 +01:00
dependabot[bot] 852ddf4a22 Bump spotless-maven-plugin from 2.28.0 to 2.29.0
Bumps [spotless-maven-plugin](https://github.com/diffplug/spotless) from 2.28.0 to 2.29.0.
- [Release notes](https://github.com/diffplug/spotless/releases)
- [Changelog](https://github.com/diffplug/spotless/blob/main/CHANGES.md)
- [Commits](https://github.com/diffplug/spotless/compare/lib/2.28.0...lib/2.29.0)

---
updated-dependencies:
- dependency-name: com.diffplug.spotless:spotless-maven-plugin
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-01-02 23:03:22 +00:00
13 changed files with 90 additions and 26 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.1</version>
<version>2.11.2</version>
</parent>
<artifactId>item-nbt-api</artifactId>
@@ -129,7 +129,13 @@ public interface ReadWriteNBT extends ReadableNBT {
* @param name
* @return
*/
ReadableNBT getOrCreateCompound(String name);
ReadWriteNBT getOrCreateCompound(String name);
/**
* @param name
* @return The Compound instance or null
*/
ReadWriteNBT getCompound(String name);
/**
* Set a key to the given Enum value. It gets stored as a String. Passing null
@@ -19,7 +19,7 @@ public enum MinecraftVersion {
MC1_7_R4(174), MC1_8_R3(183), MC1_9_R1(191), MC1_9_R2(192), MC1_10_R1(1101), MC1_11_R1(1111), MC1_12_R1(1121),
MC1_13_R1(1131), MC1_13_R2(1132), MC1_14_R1(1141), MC1_15_R1(1151), MC1_16_R1(1161), MC1_16_R2(1162),
MC1_16_R3(1163), MC1_17_R1(1171), MC1_18_R1(1181, true), MC1_18_R2(1182, true), MC1_19_R1(1191, true),
MC1_19_R2(1192, true);
MC1_19_R2(1192, true), MC1_19_R3(1193, true);
private static MinecraftVersion version;
private static Boolean hasGsonSupport;
@@ -33,7 +33,7 @@ public enum MinecraftVersion {
private static Logger logger = Logger.getLogger("NBTAPI");
// NBT-API Version
protected static final String VERSION = "2.11.1";
protected static final String VERSION = "2.11.2";
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.1</version>
<version>2.11.2</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.1</version>
<version>2.11.2</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>de.tr7zw</groupId>
<artifactId>nbt-injector</artifactId>
<version>2.11.1</version>
<version>2.11.2</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>de.tr7zw</groupId>
<artifactId>nbt-data-api</artifactId>
<version>2.11.1</version>
<version>2.11.2</version>
<scope>compile</scope>
</dependency>
</dependencies>
@@ -27,6 +27,7 @@ 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;
import de.tr7zw.nbtapi.plugin.tests.compounds.ModernSubCompoundsTest;
import de.tr7zw.nbtapi.plugin.tests.compounds.RemovingKeys;
import de.tr7zw.nbtapi.plugin.tests.compounds.StreamTest;
import de.tr7zw.nbtapi.plugin.tests.compounds.SubCompoundsTest;
@@ -101,6 +102,7 @@ public class NBTAPI extends JavaPlugin {
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());
apiTests.add(new ModernSubCompoundsTest());
if (MinecraftVersion.isAtLeastVersion(MinecraftVersion.MC1_8_R3)) // 1.7.10 not a thing
apiTests.add(new MergeTest());
apiTests.add(new ForEachTest());
@@ -0,0 +1,56 @@
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 ModernSubCompoundsTest implements Test {
private static final String COMP_TEST_KEY = "componentTest";
private static final String STRING_TEST_KEY = "stringTest";
private static final String INT_TEST_KEY = "intTest";
private static final String DOUBLE_TEST_KEY = "doubleTest";
private static final String BOOLEAN_TEST_KEY = "booleanTest";
private static final String STRING_TEST_VALUE = "TestString";
private static final int INT_TEST_VALUE = 42;
private static final double DOUBLE_TEST_VALUE = 1.5d;
private static final boolean BOOLEAN_TEST_VALUE = true;
@Override
public void test() throws Exception {
ReadWriteNBT cont = NBT.createNBTObject();
ReadWriteNBT comp = cont.getOrCreateCompound(COMP_TEST_KEY);
comp.setString(STRING_TEST_KEY, STRING_TEST_VALUE + "2");
comp.setInteger(INT_TEST_KEY, INT_TEST_VALUE * 2);
comp.setDouble(DOUBLE_TEST_KEY, DOUBLE_TEST_VALUE * 2);
if (cont.getCompound("invalide") != null) {
throw new NbtApiException("An invalide compound did not return null!");
}
comp = null;
comp = cont.getCompound(COMP_TEST_KEY);
if (comp == null) {
throw new NbtApiException("Wasn't able to get the NBTCompound!");
}
if (!comp.hasTag(STRING_TEST_KEY)) {
throw new NbtApiException("Wasn't able to check a compound key!");
}
if (!(STRING_TEST_VALUE + "2").equals(comp.getString(STRING_TEST_KEY))
|| comp.getInteger(INT_TEST_KEY) != INT_TEST_VALUE * 2
|| comp.getDouble(DOUBLE_TEST_KEY) != DOUBLE_TEST_VALUE * 2
|| comp.getBoolean(BOOLEAN_TEST_KEY) == BOOLEAN_TEST_VALUE) {
throw new NbtApiException("One key does not equal the original compound value!");
}
// Using getOrCreateCompound twice
comp.getOrCreateCompound("someName").setString("test", "abc");
if (!comp.getOrCreateCompound("someName").getString("test").equals("abc")) {
throw new NbtApiException("getOrCreateCompound did not return the same compound!");
}
}
}
+2 -2
View File
@@ -4,7 +4,7 @@
<parent>
<groupId>de.tr7zw</groupId>
<artifactId>item-nbt-parent</artifactId>
<version>2.11.1</version>
<version>2.11.2</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.1</version>
<version>2.11.2</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.1</version>
<version>2.11.2</version>
</parent>
<artifactId>nbt-data-api</artifactId>
@@ -14,7 +14,7 @@
<dependency>
<groupId>de.tr7zw</groupId>
<artifactId>item-nbt-api</artifactId>
<version>2.11.1</version>
<version>2.11.2</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.1</version>
<version>2.11.2</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.1</version>
<version>2.11.2</version>
<scope>compile</scope>
</dependency>
<dependency>
+4 -4
View File
@@ -3,7 +3,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>de.tr7zw</groupId>
<artifactId>item-nbt-parent</artifactId>
<version>2.11.1</version>
<version>2.11.2</version>
<packaging>pom</packaging>
<inceptionYear>2015</inceptionYear>
<organization>
@@ -90,7 +90,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.10.1</version>
<version>3.11.0</version>
<configuration>
<source>1.8</source>
<target>1.8</target>
@@ -112,7 +112,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<version>3.4.1</version>
<version>3.5.0</version>
<configuration>
<source>8</source>
</configuration>
@@ -164,7 +164,7 @@
<plugin>
<groupId>com.diffplug.spotless</groupId>
<artifactId>spotless-maven-plugin</artifactId>
<version>2.28.0</version>
<version>2.30.0</version>
<configuration>
<formats>
<format>
+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.1</version>
<version>2.11.2</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.1</version>
<version>2.11.2</version>
</dependency>
...
<plugins>
+3 -3
View File
@@ -11,7 +11,7 @@ repositories {
...
maven {
name = "CodeMC"
url = uri("https://repo.codemc.org/repository/maven-public/")
url = uri("https://repo.codemc.io/repository/maven-public/")
}
...
}
@@ -46,7 +46,7 @@ repositories {
...
maven {
name = "CodeMC"
url = uri("https://repo.codemc.org/repository/maven-public/")
url = uri("https://repo.codemc.io/repository/maven-public/")
}
...
}
@@ -64,4 +64,4 @@ If you want to run the shadowJar task when the build task is executed, you can w
build {
dependsOn(shadowJar)
}
```
```
+3 -3
View File
@@ -15,7 +15,7 @@ Add the following Entries to your pom at the correct location:
<!-- CodeMC -->
<repository>
<id>codemc-repo</id>
<url>https://repo.codemc.org/repository/maven-public/</url>
<url>https://repo.codemc.io/repository/maven-public/</url>
<layout>default</layout>
</repository>
...
@@ -42,7 +42,7 @@ Add the following Entries to your pom at the correct location:
<!-- CodeMC -->
<repository>
<id>codemc-repo</id>
<url>https://repo.codemc.org/repository/maven-public/</url>
<url>https://repo.codemc.io/repository/maven-public/</url>
<layout>default</layout>
</repository>
...
@@ -73,4 +73,4 @@ Add the following Entries to your pom at the correct location:
</configuration>
</plugin>
</plugins>
```
```