mirror of
https://github.com/ViaVersion/Mappings.git
synced 2024-06-26 10:25:04 +02:00
Update ViaNBT
This commit is contained in:
parent
9ff7e02003
commit
6870850daf
|
@ -10,7 +10,7 @@ repositories {
|
|||
|
||||
dependencies {
|
||||
api("com.google.code.gson:gson:2.10.1")
|
||||
api("com.viaversion:nbt:4.2.0")
|
||||
api("com.viaversion:nbt:4.4.0")
|
||||
api("it.unimi.dsi:fastutil:8.5.12")
|
||||
api("ch.qos.logback:logback-classic:1.4.14")
|
||||
compileOnly("org.jetbrains:annotations:24.0.1")
|
||||
|
|
|
@ -429,7 +429,7 @@ public final class MappingsOptimizer {
|
|||
return;
|
||||
}
|
||||
|
||||
final ListTag list = new ListTag(StringTag.class);
|
||||
final ListTag<StringTag> list = new ListTag<>(StringTag.class);
|
||||
for (final JsonElement identifier : identifiers) {
|
||||
list.add(new StringTag(identifier.getAsString()));
|
||||
}
|
||||
|
|
|
@ -50,7 +50,7 @@ public final class BlockConnections {
|
|||
|
||||
final JsonObject object = MappingsLoader.load("extra/blockConnections.json");
|
||||
final CompoundTag tag = new CompoundTag();
|
||||
ListTag list = new ListTag();
|
||||
ListTag<CompoundTag> list = new ListTag<>(CompoundTag.class);
|
||||
tag.put("data", list);
|
||||
for (final Map.Entry<String, JsonElement> entry : object.entrySet()) {
|
||||
final CompoundTag blockTag = new CompoundTag();
|
||||
|
|
|
@ -32,7 +32,7 @@ public final class BlockStates1_13 {
|
|||
public static void main(final String[] args) throws IOException {
|
||||
final JsonArray blockstates = MappingsLoader.load("mapping-1.13.json").getAsJsonArray("blockstates");
|
||||
final CompoundTag tag = new CompoundTag();
|
||||
final ListTag list = new ListTag(StringTag.class);
|
||||
final ListTag<StringTag> list = new ListTag<>(StringTag.class);
|
||||
for (final JsonElement element : blockstates) {
|
||||
list.add(new StringTag(element.getAsString()));
|
||||
}
|
||||
|
|
|
@ -29,6 +29,8 @@ import com.google.gson.JsonArray;
|
|||
import com.google.gson.JsonElement;
|
||||
import com.google.gson.JsonObject;
|
||||
import com.google.gson.JsonPrimitive;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
public final class JsonConverter {
|
||||
|
@ -52,11 +54,11 @@ public final class JsonConverter {
|
|||
return new IntArrayTag(ints);
|
||||
}
|
||||
|
||||
final ListTag tag = new ListTag();
|
||||
final List<Tag> tags = new ArrayList<>();
|
||||
for (final JsonElement arrayElement : array) {
|
||||
tag.add(toTag(arrayElement));
|
||||
tags.add(toTag(arrayElement));
|
||||
}
|
||||
return tag;
|
||||
return new ListTag<>(tags);
|
||||
} else if (element.isJsonPrimitive()) {
|
||||
final JsonPrimitive primitive = element.getAsJsonPrimitive();
|
||||
if (primitive.isNumber()) {
|
||||
|
|
Loading…
Reference in New Issue
Block a user