mirror of https://github.com/ViaVersion/ViaNBT.git
2.1.1, remove Guava dependency
This commit is contained in:
parent
eb96d8bca8
commit
d80ab5b7bd
|
@ -1,4 +1,5 @@
|
||||||
Copyright (C) 2013-2017 Steveice10
|
Copyright (C) 2013-2017 Steveice10
|
||||||
|
Copyright (C) 2021-2023 ViaVersion and contributors
|
||||||
|
|
||||||
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
||||||
|
|
||||||
|
|
26
pom.xml
26
pom.xml
|
@ -5,12 +5,12 @@
|
||||||
|
|
||||||
<groupId>com.viaversion</groupId>
|
<groupId>com.viaversion</groupId>
|
||||||
<artifactId>opennbt</artifactId>
|
<artifactId>opennbt</artifactId>
|
||||||
<version>2.1</version>
|
<version>2.1.1</version>
|
||||||
<packaging>jar</packaging>
|
<packaging>jar</packaging>
|
||||||
|
|
||||||
<name>OpenNBT</name>
|
<name>OpenNBT</name>
|
||||||
<description>A library for reading and writing NBT files, written in Java.</description>
|
<description>A library for reading and writing NBT files, written in Java.</description>
|
||||||
<url>https://github.com/Steveice10/OpenNBT/</url>
|
<url>https://github.com/ViaVersion/OpenNBT</url>
|
||||||
|
|
||||||
<distributionManagement>
|
<distributionManagement>
|
||||||
<repository>
|
<repository>
|
||||||
|
@ -19,12 +19,6 @@
|
||||||
</repository>
|
</repository>
|
||||||
</distributionManagement>
|
</distributionManagement>
|
||||||
|
|
||||||
<scm>
|
|
||||||
<connection>scm:git:git@github.com:Steveice10/OpenNBT.git</connection>
|
|
||||||
<developerConnection>scm:git:git@github.com:Steveice10/OpenNBT.git</developerConnection>
|
|
||||||
<url>https://github.com/Steveice10/OpenNBT/</url>
|
|
||||||
</scm>
|
|
||||||
|
|
||||||
<properties>
|
<properties>
|
||||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||||
<jdk.version>1.8</jdk.version>
|
<jdk.version>1.8</jdk.version>
|
||||||
|
@ -46,20 +40,18 @@
|
||||||
<name>Steveice10</name>
|
<name>Steveice10</name>
|
||||||
<email>Steveice10@gmail.com</email>
|
<email>Steveice10@gmail.com</email>
|
||||||
</developer>
|
</developer>
|
||||||
|
<developer>
|
||||||
|
<id>kennytv</id>
|
||||||
|
<name>Nassim Jahnke</name>
|
||||||
|
</developer>
|
||||||
</developers>
|
</developers>
|
||||||
|
|
||||||
<issueManagement>
|
<issueManagement>
|
||||||
<system>GitHub</system>
|
<system>GitHub</system>
|
||||||
<url>https://github.com/Steveice10/OpenNBT/issues</url>
|
<url>https://github.com/ViaVersion/OpenNBT/issues</url>
|
||||||
</issueManagement>
|
</issueManagement>
|
||||||
|
|
||||||
<dependencies>
|
<dependencies>
|
||||||
<dependency>
|
|
||||||
<groupId>com.google.guava</groupId>
|
|
||||||
<artifactId>guava</artifactId>
|
|
||||||
<version>21.0</version>
|
|
||||||
<scope>provided</scope>
|
|
||||||
</dependency>
|
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>it.unimi.dsi</groupId>
|
<groupId>it.unimi.dsi</groupId>
|
||||||
<artifactId>fastutil</artifactId>
|
<artifactId>fastutil</artifactId>
|
||||||
|
@ -69,7 +61,7 @@
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.jetbrains</groupId>
|
<groupId>org.jetbrains</groupId>
|
||||||
<artifactId>annotations</artifactId>
|
<artifactId>annotations</artifactId>
|
||||||
<version>23.0.0</version>
|
<version>24.0.0</version>
|
||||||
<scope>provided</scope>
|
<scope>provided</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
</dependencies>
|
</dependencies>
|
||||||
|
@ -80,7 +72,7 @@
|
||||||
<plugin>
|
<plugin>
|
||||||
<groupId>org.apache.maven.plugins</groupId>
|
<groupId>org.apache.maven.plugins</groupId>
|
||||||
<artifactId>maven-javadoc-plugin</artifactId>
|
<artifactId>maven-javadoc-plugin</artifactId>
|
||||||
<version>3.4.0</version>
|
<version>3.4.1</version>
|
||||||
<executions>
|
<executions>
|
||||||
<execution>
|
<execution>
|
||||||
<id>attach-javadocs</id>
|
<id>attach-javadocs</id>
|
||||||
|
|
|
@ -3,7 +3,6 @@ package com.github.steveice10.opennbt.tag.builtin;
|
||||||
import com.github.steveice10.opennbt.tag.TagCreateException;
|
import com.github.steveice10.opennbt.tag.TagCreateException;
|
||||||
import com.github.steveice10.opennbt.tag.TagRegistry;
|
import com.github.steveice10.opennbt.tag.TagRegistry;
|
||||||
import com.github.steveice10.opennbt.tag.limiter.TagLimiter;
|
import com.github.steveice10.opennbt.tag.limiter.TagLimiter;
|
||||||
import com.google.common.base.Preconditions;
|
|
||||||
import org.jetbrains.annotations.Nullable;
|
import org.jetbrains.annotations.Nullable;
|
||||||
|
|
||||||
import java.io.DataInput;
|
import java.io.DataInput;
|
||||||
|
@ -46,7 +45,9 @@ public class CompoundTag extends Tag implements Iterable<Entry<String, Tag>> {
|
||||||
* @param value The value of the tag.
|
* @param value The value of the tag.
|
||||||
*/
|
*/
|
||||||
public CompoundTag(LinkedHashMap<String, Tag> value) {
|
public CompoundTag(LinkedHashMap<String, Tag> value) {
|
||||||
Preconditions.checkNotNull(value);
|
if (value == null) {
|
||||||
|
throw new NullPointerException("value cannot be null");
|
||||||
|
}
|
||||||
this.value = value;
|
this.value = value;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -61,7 +62,9 @@ public class CompoundTag extends Tag implements Iterable<Entry<String, Tag>> {
|
||||||
* @param value New value of this tag.
|
* @param value New value of this tag.
|
||||||
*/
|
*/
|
||||||
public void setValue(Map<String, Tag> value) {
|
public void setValue(Map<String, Tag> value) {
|
||||||
Preconditions.checkNotNull(value);
|
if (value == null) {
|
||||||
|
throw new NullPointerException("value cannot be null");
|
||||||
|
}
|
||||||
this.value = new LinkedHashMap<>(value);
|
this.value = new LinkedHashMap<>(value);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -71,7 +74,9 @@ public class CompoundTag extends Tag implements Iterable<Entry<String, Tag>> {
|
||||||
* @param value New value of this tag.
|
* @param value New value of this tag.
|
||||||
*/
|
*/
|
||||||
public void setValue(LinkedHashMap<String, Tag> value) {
|
public void setValue(LinkedHashMap<String, Tag> value) {
|
||||||
Preconditions.checkNotNull(value);
|
if (value == null) {
|
||||||
|
throw new NullPointerException("value cannot be null");
|
||||||
|
}
|
||||||
this.value = value;
|
this.value = value;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,7 +1,6 @@
|
||||||
package com.github.steveice10.opennbt.tag.builtin;
|
package com.github.steveice10.opennbt.tag.builtin;
|
||||||
|
|
||||||
import com.github.steveice10.opennbt.tag.limiter.TagLimiter;
|
import com.github.steveice10.opennbt.tag.limiter.TagLimiter;
|
||||||
import com.google.common.base.Preconditions;
|
|
||||||
|
|
||||||
import java.io.DataInput;
|
import java.io.DataInput;
|
||||||
import java.io.DataOutput;
|
import java.io.DataOutput;
|
||||||
|
@ -29,7 +28,9 @@ public class IntArrayTag extends Tag {
|
||||||
* @param value The value of the tag.
|
* @param value The value of the tag.
|
||||||
*/
|
*/
|
||||||
public IntArrayTag(int[] value) {
|
public IntArrayTag(int[] value) {
|
||||||
Preconditions.checkNotNull(value);
|
if (value == null) {
|
||||||
|
throw new NullPointerException("value cannot be null");
|
||||||
|
}
|
||||||
this.value = value;
|
this.value = value;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -44,7 +45,9 @@ public class IntArrayTag extends Tag {
|
||||||
* @param value New value of this tag.
|
* @param value New value of this tag.
|
||||||
*/
|
*/
|
||||||
public void setValue(int[] value) {
|
public void setValue(int[] value) {
|
||||||
Preconditions.checkNotNull(value);
|
if (value == null) {
|
||||||
|
throw new NullPointerException("value cannot be null");
|
||||||
|
}
|
||||||
this.value = value;
|
this.value = value;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -3,7 +3,6 @@ package com.github.steveice10.opennbt.tag.builtin;
|
||||||
import com.github.steveice10.opennbt.tag.TagCreateException;
|
import com.github.steveice10.opennbt.tag.TagCreateException;
|
||||||
import com.github.steveice10.opennbt.tag.TagRegistry;
|
import com.github.steveice10.opennbt.tag.TagRegistry;
|
||||||
import com.github.steveice10.opennbt.tag.limiter.TagLimiter;
|
import com.github.steveice10.opennbt.tag.limiter.TagLimiter;
|
||||||
import com.google.common.base.Preconditions;
|
|
||||||
import org.jetbrains.annotations.Nullable;
|
import org.jetbrains.annotations.Nullable;
|
||||||
|
|
||||||
import java.io.DataInput;
|
import java.io.DataInput;
|
||||||
|
@ -63,7 +62,9 @@ public class ListTag extends Tag implements Iterable<Tag> {
|
||||||
* @throws IllegalArgumentException If all tags in the list are not of the same type.
|
* @throws IllegalArgumentException If all tags in the list are not of the same type.
|
||||||
*/
|
*/
|
||||||
public void setValue(List<Tag> value) throws IllegalArgumentException {
|
public void setValue(List<Tag> value) throws IllegalArgumentException {
|
||||||
Preconditions.checkNotNull(value);
|
if (value == null) {
|
||||||
|
throw new NullPointerException("value cannot be null");
|
||||||
|
}
|
||||||
|
|
||||||
this.type = null;
|
this.type = null;
|
||||||
this.value.clear();
|
this.value.clear();
|
||||||
|
@ -91,7 +92,9 @@ public class ListTag extends Tag implements Iterable<Tag> {
|
||||||
* @throws IllegalArgumentException If the tag's type differs from the list tag's type.
|
* @throws IllegalArgumentException If the tag's type differs from the list tag's type.
|
||||||
*/
|
*/
|
||||||
public boolean add(Tag tag) throws IllegalArgumentException {
|
public boolean add(Tag tag) throws IllegalArgumentException {
|
||||||
Preconditions.checkNotNull(tag);
|
if (tag == null) {
|
||||||
|
throw new NullPointerException("tag cannot be null");
|
||||||
|
}
|
||||||
|
|
||||||
// If empty list, use this as tag type.
|
// If empty list, use this as tag type.
|
||||||
if(this.type == null) {
|
if(this.type == null) {
|
||||||
|
|
|
@ -1,7 +1,6 @@
|
||||||
package com.github.steveice10.opennbt.tag.builtin;
|
package com.github.steveice10.opennbt.tag.builtin;
|
||||||
|
|
||||||
import com.github.steveice10.opennbt.tag.limiter.TagLimiter;
|
import com.github.steveice10.opennbt.tag.limiter.TagLimiter;
|
||||||
import com.google.common.base.Preconditions;
|
|
||||||
|
|
||||||
import java.io.DataInput;
|
import java.io.DataInput;
|
||||||
import java.io.DataOutput;
|
import java.io.DataOutput;
|
||||||
|
@ -29,7 +28,9 @@ public class LongArrayTag extends Tag {
|
||||||
* @param value The value of the tag.
|
* @param value The value of the tag.
|
||||||
*/
|
*/
|
||||||
public LongArrayTag(long[] value) {
|
public LongArrayTag(long[] value) {
|
||||||
Preconditions.checkNotNull(value);
|
if (value == null) {
|
||||||
|
throw new NullPointerException("value cannot be null");
|
||||||
|
}
|
||||||
this.value = value;
|
this.value = value;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -44,7 +45,9 @@ public class LongArrayTag extends Tag {
|
||||||
* @param value New value of this tag.
|
* @param value New value of this tag.
|
||||||
*/
|
*/
|
||||||
public void setValue(long[] value) {
|
public void setValue(long[] value) {
|
||||||
Preconditions.checkNotNull(value);
|
if (value == null) {
|
||||||
|
throw new NullPointerException("value cannot be null");
|
||||||
|
}
|
||||||
this.value = value;
|
this.value = value;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,7 +1,6 @@
|
||||||
package com.github.steveice10.opennbt.tag.builtin;
|
package com.github.steveice10.opennbt.tag.builtin;
|
||||||
|
|
||||||
import com.github.steveice10.opennbt.tag.limiter.TagLimiter;
|
import com.github.steveice10.opennbt.tag.limiter.TagLimiter;
|
||||||
import com.google.common.base.Preconditions;
|
|
||||||
|
|
||||||
import java.io.DataInput;
|
import java.io.DataInput;
|
||||||
import java.io.DataOutput;
|
import java.io.DataOutput;
|
||||||
|
@ -27,7 +26,9 @@ public class StringTag extends Tag {
|
||||||
* @param value The value of the tag.
|
* @param value The value of the tag.
|
||||||
*/
|
*/
|
||||||
public StringTag(String value) {
|
public StringTag(String value) {
|
||||||
Preconditions.checkNotNull(value);
|
if (value == null) {
|
||||||
|
throw new NullPointerException("value cannot be null");
|
||||||
|
}
|
||||||
this.value = value;
|
this.value = value;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -42,7 +43,9 @@ public class StringTag extends Tag {
|
||||||
* @param value New value of this tag.
|
* @param value New value of this tag.
|
||||||
*/
|
*/
|
||||||
public void setValue(String value) {
|
public void setValue(String value) {
|
||||||
Preconditions.checkNotNull(value);
|
if (value == null) {
|
||||||
|
throw new NullPointerException("value cannot be null");
|
||||||
|
}
|
||||||
this.value = value;
|
this.value = value;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue