read from InputStream
This commit is contained in:
@@ -2,10 +2,8 @@ package mc.nbt;
|
|||||||
|
|
||||||
import lombok.Getter;
|
import lombok.Getter;
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
|
||||||
import mc.nbt.tag.*;
|
import mc.nbt.tag.*;
|
||||||
|
|
||||||
@Slf4j
|
|
||||||
@RequiredArgsConstructor
|
@RequiredArgsConstructor
|
||||||
@Getter
|
@Getter
|
||||||
public enum TypeTag {
|
public enum TypeTag {
|
||||||
@@ -24,18 +22,22 @@ public enum TypeTag {
|
|||||||
LONG_ARRAY(12, TagLongArray.class);
|
LONG_ARRAY(12, TagLongArray.class);
|
||||||
|
|
||||||
public static Tag getTagById(int id) {
|
public static Tag getTagById(int id) {
|
||||||
for (TypeTag type : TypeTag.values()) {
|
TypeTag type = getTypeById(id);
|
||||||
if (type.id == id) {
|
|
||||||
try {
|
try {
|
||||||
return type.classTag.newInstance();
|
return type.classTag.newInstance();
|
||||||
} catch (InstantiationException | IllegalAccessException e) {
|
} catch (InstantiationException | IllegalAccessException e) {
|
||||||
log.error("{}", e.getMessage(), e);
|
throw new RuntimeException(e); //FIXME
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return null;
|
public static TypeTag getTypeById(int id) {
|
||||||
|
for (TypeTag type : TypeTag.values()) {
|
||||||
|
if (type.id == id) {
|
||||||
|
return type;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
throw new RuntimeException("Unknown tag id: " + id); //FIXME
|
||||||
}
|
}
|
||||||
|
|
||||||
private final int id;
|
private final int id;
|
||||||
|
|||||||
87
src/main/java/mc/nbt/io/NbtInputStream.java
Normal file
87
src/main/java/mc/nbt/io/NbtInputStream.java
Normal file
@@ -0,0 +1,87 @@
|
|||||||
|
package mc.nbt.io;
|
||||||
|
|
||||||
|
import mc.nbt.TypeTag;
|
||||||
|
import mc.nbt.tag.Tag;
|
||||||
|
|
||||||
|
import java.io.DataInputStream;
|
||||||
|
import java.io.IOException;
|
||||||
|
import java.io.InputStream;
|
||||||
|
import java.nio.charset.StandardCharsets;
|
||||||
|
import java.util.zip.GZIPInputStream;
|
||||||
|
|
||||||
|
public class NbtInputStream extends InputStream {
|
||||||
|
|
||||||
|
private final DataInputStream dataInputStream;
|
||||||
|
|
||||||
|
public NbtInputStream(InputStream inputStream, boolean compressed) throws IOException {
|
||||||
|
this.dataInputStream = new DataInputStream(
|
||||||
|
compressed
|
||||||
|
? new GZIPInputStream(inputStream)
|
||||||
|
: inputStream);
|
||||||
|
}
|
||||||
|
|
||||||
|
public NbtInputStream(InputStream inputStream) throws IOException {
|
||||||
|
this(inputStream, false);
|
||||||
|
}
|
||||||
|
|
||||||
|
public Tag readTag() {
|
||||||
|
Tag tag = null;
|
||||||
|
|
||||||
|
try {
|
||||||
|
tag = TypeTag.getTagById(read());
|
||||||
|
if (tag.getType() != TypeTag.END) {
|
||||||
|
tag.setName(readString());
|
||||||
|
}
|
||||||
|
|
||||||
|
tag.readSelf(this);
|
||||||
|
|
||||||
|
} catch (IOException e) {
|
||||||
|
e.printStackTrace(); //FIXME
|
||||||
|
}
|
||||||
|
|
||||||
|
return tag;
|
||||||
|
}
|
||||||
|
|
||||||
|
public byte readByte() throws IOException {
|
||||||
|
return dataInputStream.readByte();
|
||||||
|
}
|
||||||
|
|
||||||
|
public short readShort() throws IOException {
|
||||||
|
return dataInputStream.readShort();
|
||||||
|
}
|
||||||
|
|
||||||
|
public int readInt() throws IOException {
|
||||||
|
return dataInputStream.readInt();
|
||||||
|
}
|
||||||
|
|
||||||
|
public long readLong() throws IOException {
|
||||||
|
return dataInputStream.readLong();
|
||||||
|
}
|
||||||
|
|
||||||
|
public String readString() throws IOException {
|
||||||
|
int length = readShort();
|
||||||
|
if (length > 0) {
|
||||||
|
byte[] buff = new byte[length];
|
||||||
|
if (read(buff, 0, length) < length) {
|
||||||
|
throw new IOException("Unexpected end of stream");
|
||||||
|
}
|
||||||
|
|
||||||
|
return new String(buff, StandardCharsets.UTF_8);
|
||||||
|
} else {
|
||||||
|
return "";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public float readFloat() throws IOException {
|
||||||
|
return dataInputStream.readFloat();
|
||||||
|
}
|
||||||
|
|
||||||
|
public double readDouble() throws IOException {
|
||||||
|
return dataInputStream.readDouble();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int read() throws IOException {
|
||||||
|
return dataInputStream.read();
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -3,6 +3,9 @@ package mc.nbt.tag;
|
|||||||
import lombok.Getter;
|
import lombok.Getter;
|
||||||
import lombok.Setter;
|
import lombok.Setter;
|
||||||
import mc.nbt.TypeTag;
|
import mc.nbt.TypeTag;
|
||||||
|
import mc.nbt.io.NbtInputStream;
|
||||||
|
|
||||||
|
import java.io.IOException;
|
||||||
|
|
||||||
public abstract class Tag {
|
public abstract class Tag {
|
||||||
|
|
||||||
@@ -12,4 +15,21 @@ public abstract class Tag {
|
|||||||
|
|
||||||
public abstract TypeTag getType();
|
public abstract TypeTag getType();
|
||||||
|
|
||||||
|
public abstract void readSelf(NbtInputStream nbtInputStream) throws IOException;
|
||||||
|
|
||||||
|
public TagCompound asTagCompound() {
|
||||||
|
return (TagCompound) this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public TagList asTagList() {
|
||||||
|
return (TagList) this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String toString() {
|
||||||
|
if (name != null && !name.isEmpty()) {
|
||||||
|
return "Tag(name=" + this.name + ")";
|
||||||
|
} else {
|
||||||
|
return "Tag";
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,8 +2,13 @@ package mc.nbt.tag;
|
|||||||
|
|
||||||
import lombok.Getter;
|
import lombok.Getter;
|
||||||
import lombok.Setter;
|
import lombok.Setter;
|
||||||
|
import lombok.ToString;
|
||||||
import mc.nbt.TypeTag;
|
import mc.nbt.TypeTag;
|
||||||
|
import mc.nbt.io.NbtInputStream;
|
||||||
|
|
||||||
|
import java.io.IOException;
|
||||||
|
|
||||||
|
@ToString(callSuper = true)
|
||||||
public class TagByte extends Tag {
|
public class TagByte extends Tag {
|
||||||
|
|
||||||
@Getter
|
@Getter
|
||||||
@@ -14,4 +19,9 @@ public class TagByte extends Tag {
|
|||||||
public TypeTag getType() {
|
public TypeTag getType() {
|
||||||
return TypeTag.BYTE;
|
return TypeTag.BYTE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void readSelf(NbtInputStream nbtInputStream) throws IOException {
|
||||||
|
value = nbtInputStream.readByte();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,8 +2,13 @@ package mc.nbt.tag;
|
|||||||
|
|
||||||
import lombok.Getter;
|
import lombok.Getter;
|
||||||
import lombok.Setter;
|
import lombok.Setter;
|
||||||
|
import lombok.ToString;
|
||||||
import mc.nbt.TypeTag;
|
import mc.nbt.TypeTag;
|
||||||
|
import mc.nbt.io.NbtInputStream;
|
||||||
|
|
||||||
|
import java.io.IOException;
|
||||||
|
|
||||||
|
@ToString(callSuper = true)
|
||||||
public class TagByteArray extends Tag {
|
public class TagByteArray extends Tag {
|
||||||
|
|
||||||
@Getter
|
@Getter
|
||||||
@@ -14,4 +19,10 @@ public class TagByteArray extends Tag {
|
|||||||
public TypeTag getType() {
|
public TypeTag getType() {
|
||||||
return TypeTag.BYTE_ARRAY;
|
return TypeTag.BYTE_ARRAY;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void readSelf(NbtInputStream nbtInputStream) throws IOException {
|
||||||
|
value = new byte[nbtInputStream.readInt()];
|
||||||
|
nbtInputStream.read(value); //FIXME
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,11 +2,16 @@ package mc.nbt.tag;
|
|||||||
|
|
||||||
import lombok.Getter;
|
import lombok.Getter;
|
||||||
import lombok.Setter;
|
import lombok.Setter;
|
||||||
|
import lombok.ToString;
|
||||||
import mc.nbt.TypeTag;
|
import mc.nbt.TypeTag;
|
||||||
|
import mc.nbt.io.NbtInputStream;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.Iterator;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
public class TagCompound extends Tag {
|
@ToString(callSuper = true)
|
||||||
|
public class TagCompound extends Tag implements Iterable<Tag> {
|
||||||
|
|
||||||
@Getter
|
@Getter
|
||||||
@Setter
|
@Setter
|
||||||
@@ -16,4 +21,23 @@ public class TagCompound extends Tag {
|
|||||||
public TypeTag getType() {
|
public TypeTag getType() {
|
||||||
return TypeTag.COMPOUND;
|
return TypeTag.COMPOUND;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void readSelf(NbtInputStream nbtInputStream) {
|
||||||
|
value = new ArrayList<>();
|
||||||
|
|
||||||
|
while (true) {
|
||||||
|
Tag tag = nbtInputStream.readTag();
|
||||||
|
if (tag.getType() == TypeTag.END) {
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
value.add(tag);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Iterator<Tag> iterator() {
|
||||||
|
return value.iterator();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,8 +2,13 @@ package mc.nbt.tag;
|
|||||||
|
|
||||||
import lombok.Getter;
|
import lombok.Getter;
|
||||||
import lombok.Setter;
|
import lombok.Setter;
|
||||||
|
import lombok.ToString;
|
||||||
import mc.nbt.TypeTag;
|
import mc.nbt.TypeTag;
|
||||||
|
import mc.nbt.io.NbtInputStream;
|
||||||
|
|
||||||
|
import java.io.IOException;
|
||||||
|
|
||||||
|
@ToString(callSuper = true)
|
||||||
public class TagDouble extends Tag {
|
public class TagDouble extends Tag {
|
||||||
|
|
||||||
@Getter
|
@Getter
|
||||||
@@ -14,4 +19,9 @@ public class TagDouble extends Tag {
|
|||||||
public TypeTag getType() {
|
public TypeTag getType() {
|
||||||
return TypeTag.DOUBLE;
|
return TypeTag.DOUBLE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void readSelf(NbtInputStream nbtInputStream) throws IOException {
|
||||||
|
value = nbtInputStream.readDouble();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,9 @@
|
|||||||
package mc.nbt.tag;
|
package mc.nbt.tag;
|
||||||
|
|
||||||
import mc.nbt.TypeTag;
|
import mc.nbt.TypeTag;
|
||||||
|
import mc.nbt.io.NbtInputStream;
|
||||||
|
|
||||||
|
import java.io.IOException;
|
||||||
|
|
||||||
public class TagEnd extends Tag {
|
public class TagEnd extends Tag {
|
||||||
|
|
||||||
@@ -18,4 +21,8 @@ public class TagEnd extends Tag {
|
|||||||
public TypeTag getType() {
|
public TypeTag getType() {
|
||||||
return TypeTag.END;
|
return TypeTag.END;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void readSelf(NbtInputStream nbtInputStream) throws IOException {
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,8 +2,13 @@ package mc.nbt.tag;
|
|||||||
|
|
||||||
import lombok.Getter;
|
import lombok.Getter;
|
||||||
import lombok.Setter;
|
import lombok.Setter;
|
||||||
|
import lombok.ToString;
|
||||||
import mc.nbt.TypeTag;
|
import mc.nbt.TypeTag;
|
||||||
|
import mc.nbt.io.NbtInputStream;
|
||||||
|
|
||||||
|
import java.io.IOException;
|
||||||
|
|
||||||
|
@ToString(callSuper = true)
|
||||||
public class TagFloat extends Tag {
|
public class TagFloat extends Tag {
|
||||||
|
|
||||||
@Getter
|
@Getter
|
||||||
@@ -14,4 +19,9 @@ public class TagFloat extends Tag {
|
|||||||
public TypeTag getType() {
|
public TypeTag getType() {
|
||||||
return TypeTag.FLOAT;
|
return TypeTag.FLOAT;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void readSelf(NbtInputStream nbtInputStream) throws IOException {
|
||||||
|
value = nbtInputStream.readFloat();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,8 +2,13 @@ package mc.nbt.tag;
|
|||||||
|
|
||||||
import lombok.Getter;
|
import lombok.Getter;
|
||||||
import lombok.Setter;
|
import lombok.Setter;
|
||||||
|
import lombok.ToString;
|
||||||
import mc.nbt.TypeTag;
|
import mc.nbt.TypeTag;
|
||||||
|
import mc.nbt.io.NbtInputStream;
|
||||||
|
|
||||||
|
import java.io.IOException;
|
||||||
|
|
||||||
|
@ToString(callSuper = true)
|
||||||
public class TagInt extends Tag {
|
public class TagInt extends Tag {
|
||||||
|
|
||||||
@Getter
|
@Getter
|
||||||
@@ -14,4 +19,9 @@ public class TagInt extends Tag {
|
|||||||
public TypeTag getType() {
|
public TypeTag getType() {
|
||||||
return TypeTag.INT;
|
return TypeTag.INT;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void readSelf(NbtInputStream nbtInputStream) throws IOException {
|
||||||
|
value = nbtInputStream.readInt();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,6 +3,9 @@ package mc.nbt.tag;
|
|||||||
import lombok.Getter;
|
import lombok.Getter;
|
||||||
import lombok.Setter;
|
import lombok.Setter;
|
||||||
import mc.nbt.TypeTag;
|
import mc.nbt.TypeTag;
|
||||||
|
import mc.nbt.io.NbtInputStream;
|
||||||
|
|
||||||
|
import java.io.IOException;
|
||||||
|
|
||||||
public class TagIntArray extends Tag {
|
public class TagIntArray extends Tag {
|
||||||
|
|
||||||
@@ -14,4 +17,14 @@ public class TagIntArray extends Tag {
|
|||||||
public TypeTag getType() {
|
public TypeTag getType() {
|
||||||
return TypeTag.INT_ARRAY;
|
return TypeTag.INT_ARRAY;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void readSelf(NbtInputStream nbtInputStream) throws IOException {
|
||||||
|
int count = nbtInputStream.readInt();
|
||||||
|
value = new int[count];
|
||||||
|
|
||||||
|
for (int i = 0; i < count; i++) {
|
||||||
|
value[i] = nbtInputStream.readInt();
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,18 +2,47 @@ package mc.nbt.tag;
|
|||||||
|
|
||||||
import lombok.Getter;
|
import lombok.Getter;
|
||||||
import lombok.Setter;
|
import lombok.Setter;
|
||||||
|
import lombok.ToString;
|
||||||
import mc.nbt.TypeTag;
|
import mc.nbt.TypeTag;
|
||||||
|
import mc.nbt.io.NbtInputStream;
|
||||||
|
|
||||||
|
import java.io.IOException;
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.Iterator;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
@Getter
|
@ToString(callSuper = true)
|
||||||
@Setter
|
public class TagList extends Tag implements Iterable<Tag> {
|
||||||
public class TagList extends Tag {
|
|
||||||
|
|
||||||
|
@Getter
|
||||||
|
@Setter
|
||||||
private List<Tag> value; //FIXME
|
private List<Tag> value; //FIXME
|
||||||
|
|
||||||
|
private TypeTag typeList;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public TypeTag getType() {
|
public TypeTag getType() {
|
||||||
return TypeTag.LIST;
|
return TypeTag.LIST;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void readSelf(NbtInputStream nbtInputStream) throws IOException {
|
||||||
|
typeList = TypeTag.getTypeById(nbtInputStream.readByte());
|
||||||
|
|
||||||
|
int size = nbtInputStream.readInt();
|
||||||
|
if (size > 0) {
|
||||||
|
value = new ArrayList<>(size);
|
||||||
|
|
||||||
|
for (int i = 0; i < size; i++) {
|
||||||
|
Tag tag = TypeTag.getTagById(typeList.getId());
|
||||||
|
tag.readSelf(nbtInputStream);
|
||||||
|
value.add(tag);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Iterator<Tag> iterator() {
|
||||||
|
return value.iterator();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,8 +2,13 @@ package mc.nbt.tag;
|
|||||||
|
|
||||||
import lombok.Getter;
|
import lombok.Getter;
|
||||||
import lombok.Setter;
|
import lombok.Setter;
|
||||||
|
import lombok.ToString;
|
||||||
import mc.nbt.TypeTag;
|
import mc.nbt.TypeTag;
|
||||||
|
import mc.nbt.io.NbtInputStream;
|
||||||
|
|
||||||
|
import java.io.IOException;
|
||||||
|
|
||||||
|
@ToString(callSuper = true)
|
||||||
public class TagLong extends Tag {
|
public class TagLong extends Tag {
|
||||||
|
|
||||||
@Getter
|
@Getter
|
||||||
@@ -14,4 +19,9 @@ public class TagLong extends Tag {
|
|||||||
public TypeTag getType() {
|
public TypeTag getType() {
|
||||||
return TypeTag.LONG;
|
return TypeTag.LONG;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void readSelf(NbtInputStream nbtInputStream) throws IOException {
|
||||||
|
value = nbtInputStream.readLong();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,6 +3,9 @@ package mc.nbt.tag;
|
|||||||
import lombok.Getter;
|
import lombok.Getter;
|
||||||
import lombok.Setter;
|
import lombok.Setter;
|
||||||
import mc.nbt.TypeTag;
|
import mc.nbt.TypeTag;
|
||||||
|
import mc.nbt.io.NbtInputStream;
|
||||||
|
|
||||||
|
import java.io.IOException;
|
||||||
|
|
||||||
public class TagLongArray extends Tag {
|
public class TagLongArray extends Tag {
|
||||||
|
|
||||||
@@ -14,4 +17,14 @@ public class TagLongArray extends Tag {
|
|||||||
public TypeTag getType() {
|
public TypeTag getType() {
|
||||||
return TypeTag.LONG_ARRAY;
|
return TypeTag.LONG_ARRAY;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void readSelf(NbtInputStream nbtInputStream) throws IOException {
|
||||||
|
int count = nbtInputStream.readInt();
|
||||||
|
value = new long[count];
|
||||||
|
|
||||||
|
for (int i = 0; i < count; i++) {
|
||||||
|
value[i] = nbtInputStream.readInt();
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,8 +2,13 @@ package mc.nbt.tag;
|
|||||||
|
|
||||||
import lombok.Getter;
|
import lombok.Getter;
|
||||||
import lombok.Setter;
|
import lombok.Setter;
|
||||||
|
import lombok.ToString;
|
||||||
import mc.nbt.TypeTag;
|
import mc.nbt.TypeTag;
|
||||||
|
import mc.nbt.io.NbtInputStream;
|
||||||
|
|
||||||
|
import java.io.IOException;
|
||||||
|
|
||||||
|
@ToString(callSuper = true)
|
||||||
public class TagShort extends Tag {
|
public class TagShort extends Tag {
|
||||||
|
|
||||||
@Getter
|
@Getter
|
||||||
@@ -14,4 +19,9 @@ public class TagShort extends Tag {
|
|||||||
public TypeTag getType() {
|
public TypeTag getType() {
|
||||||
return TypeTag.SHORT;
|
return TypeTag.SHORT;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void readSelf(NbtInputStream nbtInputStream) throws IOException {
|
||||||
|
value = nbtInputStream.readShort();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,8 +2,13 @@ package mc.nbt.tag;
|
|||||||
|
|
||||||
import lombok.Getter;
|
import lombok.Getter;
|
||||||
import lombok.Setter;
|
import lombok.Setter;
|
||||||
|
import lombok.ToString;
|
||||||
import mc.nbt.TypeTag;
|
import mc.nbt.TypeTag;
|
||||||
|
import mc.nbt.io.NbtInputStream;
|
||||||
|
|
||||||
|
import java.io.IOException;
|
||||||
|
|
||||||
|
@ToString(callSuper = true)
|
||||||
public class TagString extends Tag {
|
public class TagString extends Tag {
|
||||||
|
|
||||||
@Getter
|
@Getter
|
||||||
@@ -14,4 +19,9 @@ public class TagString extends Tag {
|
|||||||
public TypeTag getType() {
|
public TypeTag getType() {
|
||||||
return TypeTag.STRING;
|
return TypeTag.STRING;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void readSelf(NbtInputStream nbtInputStream) throws IOException {
|
||||||
|
value = nbtInputStream.readString();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user