wip on 1.14

This commit is contained in:
Jesse Boyd
2019-07-09 17:18:51 +10:00
229 changed files with 9489 additions and 3025 deletions

View File

@ -424,6 +424,16 @@ public class CompoundTag extends Tag {
}
}
@Override
public Map<String, Object> toRaw() {
HashMap<String, Object> raw = new HashMap<>();
if (this.value.isEmpty()) return raw;
for (Map.Entry<String, Tag> entry : value.entrySet()) {
raw.put(entry.getKey(), entry.getValue().toRaw());
}
return raw;
}
@Override
public String toString() {
StringBuilder bldr = new StringBuilder();

View File

@ -21,6 +21,7 @@ package com.sk89q.jnbt;
import static com.google.common.base.Preconditions.checkNotNull;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
@ -416,6 +417,18 @@ public final class ListTag extends Tag {
}
}
@Override
public ArrayList toRaw() {
ArrayList raw = new ArrayList<>();
if (this.value.isEmpty()) {
return raw;
}
for (Tag elem : this.value) {
raw.add(elem.toRaw());
}
return raw;
}
@Override
public String toString() {
StringBuilder bldr = new StringBuilder();

View File

@ -31,4 +31,8 @@ public abstract class Tag {
*/
public abstract Object getValue();
public Object toRaw() {
return getValue();
}
}