Add NBT toString()

This commit is contained in:
Mike Primm 2021-12-15 02:14:12 -06:00
parent 8dbf972238
commit 3af5ac05e2
9 changed files with 55 additions and 1 deletions

View file

@ -89,6 +89,9 @@ public class NBT {
public GenericBitStorage makeBitStorage(int bits, int count, long[] data) { public GenericBitStorage makeBitStorage(int bits, int count, long[] data) {
return new OurBitStorage(bits, count, data); return new OurBitStorage(bits, count, data);
} }
public String toString() {
return obj.toString();
}
} }
public static class NBTList implements GenericNBTList { public static class NBTList implements GenericNBTList {
private final NBTTagList obj; private final NBTTagList obj;
@ -107,6 +110,9 @@ public class NBT {
public GenericNBTCompound getCompound(int idx) { public GenericNBTCompound getCompound(int idx) {
return new NBTCompound(obj.getCompound(idx)); return new NBTCompound(obj.getCompound(idx));
} }
public String toString() {
return obj.toString();
}
} }
public static class OurBitStorage implements GenericBitStorage { public static class OurBitStorage implements GenericBitStorage {
private final DataBits bs; private final DataBits bs;

View file

@ -88,6 +88,9 @@ public class NBT {
public GenericBitStorage makeBitStorage(int bits, int count, long[] data) { public GenericBitStorage makeBitStorage(int bits, int count, long[] data) {
return new OurBitStorage(bits, count, data); return new OurBitStorage(bits, count, data);
} }
public String toString() {
return obj.toString();
}
} }
public static class NBTList implements GenericNBTList { public static class NBTList implements GenericNBTList {
private final NBTTagList obj; private final NBTTagList obj;
@ -106,6 +109,9 @@ public class NBT {
public GenericNBTCompound getCompound(int idx) { public GenericNBTCompound getCompound(int idx) {
return new NBTCompound(obj.getCompound(idx)); return new NBTCompound(obj.getCompound(idx));
} }
public String toString() {
return obj.toString();
}
} }
public static class OurBitStorage implements GenericBitStorage { public static class OurBitStorage implements GenericBitStorage {
private final DataBits bs; private final DataBits bs;

View file

@ -88,6 +88,9 @@ public class NBT {
public GenericBitStorage makeBitStorage(int bits, int count, long[] data) { public GenericBitStorage makeBitStorage(int bits, int count, long[] data) {
return new OurBitStorage(bits, count, data); return new OurBitStorage(bits, count, data);
} }
public String toString() {
return obj.toString();
}
} }
public static class NBTList implements GenericNBTList { public static class NBTList implements GenericNBTList {
private final NBTTagList obj; private final NBTTagList obj;
@ -106,6 +109,9 @@ public class NBT {
public GenericNBTCompound getCompound(int idx) { public GenericNBTCompound getCompound(int idx) {
return new NBTCompound(obj.a(idx)); return new NBTCompound(obj.a(idx));
} }
public String toString() {
return obj.toString();
}
} }
public static class OurBitStorage implements GenericBitStorage { public static class OurBitStorage implements GenericBitStorage {
private final SimpleBitStorage bs; private final SimpleBitStorage bs;

View file

@ -88,6 +88,9 @@ public class NBT {
public GenericBitStorage makeBitStorage(int bits, int count, long[] data) { public GenericBitStorage makeBitStorage(int bits, int count, long[] data) {
return new OurBitStorage(bits, count, data); return new OurBitStorage(bits, count, data);
} }
public String toString() {
return obj.toString();
}
} }
public static class NBTList implements GenericNBTList { public static class NBTList implements GenericNBTList {
private final ListTag obj; private final ListTag obj;
@ -106,6 +109,9 @@ public class NBT {
public GenericNBTCompound getCompound(int idx) { public GenericNBTCompound getCompound(int idx) {
return new NBTCompound(obj.getCompound(idx)); return new NBTCompound(obj.getCompound(idx));
} }
public String toString() {
return obj.toString();
}
} }
public static class OurBitStorage implements GenericBitStorage { public static class OurBitStorage implements GenericBitStorage {
private final PackedIntegerArray bs; private final PackedIntegerArray bs;

View file

@ -88,6 +88,9 @@ public class NBT {
public GenericBitStorage makeBitStorage(int bits, int count, long[] data) { public GenericBitStorage makeBitStorage(int bits, int count, long[] data) {
return new OurBitStorage(bits, count, data); return new OurBitStorage(bits, count, data);
} }
public String toString() {
return obj.toString();
}
} }
public static class NBTList implements GenericNBTList { public static class NBTList implements GenericNBTList {
private final NbtList obj; private final NbtList obj;
@ -106,6 +109,9 @@ public class NBT {
public GenericNBTCompound getCompound(int idx) { public GenericNBTCompound getCompound(int idx) {
return new NBTCompound(obj.getCompound(idx)); return new NBTCompound(obj.getCompound(idx));
} }
public String toString() {
return obj.toString();
}
} }
public static class OurBitStorage implements GenericBitStorage { public static class OurBitStorage implements GenericBitStorage {
private final PackedIntegerArray bs; private final PackedIntegerArray bs;

View file

@ -88,6 +88,9 @@ public class NBT {
public GenericBitStorage makeBitStorage(int bits, int count, long[] data) { public GenericBitStorage makeBitStorage(int bits, int count, long[] data) {
return new OurBitStorage(bits, count, data); return new OurBitStorage(bits, count, data);
} }
public String toString() {
return obj.toString();
}
} }
public static class NBTList implements GenericNBTList { public static class NBTList implements GenericNBTList {
private final NbtList obj; private final NbtList obj;
@ -106,6 +109,9 @@ public class NBT {
public GenericNBTCompound getCompound(int idx) { public GenericNBTCompound getCompound(int idx) {
return new NBTCompound(obj.getCompound(idx)); return new NBTCompound(obj.getCompound(idx));
} }
public String toString() {
return obj.toString();
}
} }
public static class OurBitStorage implements GenericBitStorage { public static class OurBitStorage implements GenericBitStorage {
private final PackedIntegerArray bs; private final PackedIntegerArray bs;

View file

@ -88,6 +88,9 @@ public class NBT {
public GenericBitStorage makeBitStorage(int bits, int count, long[] data) { public GenericBitStorage makeBitStorage(int bits, int count, long[] data) {
return new OurBitStorage(bits, count, data); return new OurBitStorage(bits, count, data);
} }
public String toString() {
return obj.toString();
}
} }
public static class NBTList implements GenericNBTList { public static class NBTList implements GenericNBTList {
private final ListNBT obj; private final ListNBT obj;
@ -106,6 +109,9 @@ public class NBT {
public GenericNBTCompound getCompound(int idx) { public GenericNBTCompound getCompound(int idx) {
return new NBTCompound(obj.getCompound(idx)); return new NBTCompound(obj.getCompound(idx));
} }
public String toString() {
return obj.toString();
}
} }
public static class OurBitStorage implements GenericBitStorage { public static class OurBitStorage implements GenericBitStorage {
private final BitArray bs; private final BitArray bs;

View file

@ -88,6 +88,9 @@ public class NBT {
public GenericBitStorage makeBitStorage(int bits, int count, long[] data) { public GenericBitStorage makeBitStorage(int bits, int count, long[] data) {
return new OurBitStorage(bits, count, data); return new OurBitStorage(bits, count, data);
} }
public String toString() {
return obj.toString();
}
} }
public static class NBTList implements GenericNBTList { public static class NBTList implements GenericNBTList {
private final ListTag obj; private final ListTag obj;
@ -106,6 +109,9 @@ public class NBT {
public GenericNBTCompound getCompound(int idx) { public GenericNBTCompound getCompound(int idx) {
return new NBTCompound(obj.getCompound(idx)); return new NBTCompound(obj.getCompound(idx));
} }
public String toString() {
return obj.toString();
}
} }
public static class OurBitStorage implements GenericBitStorage { public static class OurBitStorage implements GenericBitStorage {
private final BitStorage bs; private final BitStorage bs;

View file

@ -88,6 +88,9 @@ public class NBT {
public GenericBitStorage makeBitStorage(int bits, int count, long[] data) { public GenericBitStorage makeBitStorage(int bits, int count, long[] data) {
return new OurBitStorage(bits, count, data); return new OurBitStorage(bits, count, data);
} }
public String toString() {
return obj.toString();
}
} }
public static class NBTList implements GenericNBTList { public static class NBTList implements GenericNBTList {
private final ListTag obj; private final ListTag obj;
@ -106,6 +109,9 @@ public class NBT {
public GenericNBTCompound getCompound(int idx) { public GenericNBTCompound getCompound(int idx) {
return new NBTCompound(obj.getCompound(idx)); return new NBTCompound(obj.getCompound(idx));
} }
public String toString() {
return obj.toString();
}
} }
public static class OurBitStorage implements GenericBitStorage { public static class OurBitStorage implements GenericBitStorage {
private final SimpleBitStorage bs; private final SimpleBitStorage bs;