From 9e883faa78f68f3f1d17c5e92c79b64f7e6c7ebc Mon Sep 17 00:00:00 2001 From: Nassim Jahnke Date: Sun, 8 Oct 2023 18:54:52 +1000 Subject: [PATCH] Update nbt lib usage --- .../protocol1_18_2to1_19/data/BackwardsMappings.java | 4 ++-- .../protocol1_19_4to1_20/data/BackwardsMappings.java | 5 ++--- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/common/src/main/java/com/viaversion/viabackwards/protocol/protocol1_18_2to1_19/data/BackwardsMappings.java b/common/src/main/java/com/viaversion/viabackwards/protocol/protocol1_18_2to1_19/data/BackwardsMappings.java index 734cd1f3..0c152f37 100644 --- a/common/src/main/java/com/viaversion/viabackwards/protocol/protocol1_18_2to1_19/data/BackwardsMappings.java +++ b/common/src/main/java/com/viaversion/viabackwards/protocol/protocol1_18_2to1_19/data/BackwardsMappings.java @@ -18,9 +18,9 @@ package com.viaversion.viabackwards.protocol.protocol1_18_2to1_19.data; import com.viaversion.viabackwards.api.data.VBMappingDataLoader; -import com.viaversion.viaversion.api.minecraft.nbt.BinaryTagIO; import com.viaversion.viaversion.libs.fastutil.ints.Int2ObjectMap; import com.viaversion.viaversion.libs.fastutil.ints.Int2ObjectOpenHashMap; +import com.viaversion.viaversion.libs.opennbt.NBTIO; import com.viaversion.viaversion.libs.opennbt.tag.builtin.CompoundTag; import com.viaversion.viaversion.libs.opennbt.tag.builtin.ListTag; import com.viaversion.viaversion.libs.opennbt.tag.builtin.NumberTag; @@ -42,7 +42,7 @@ public final class BackwardsMappings extends com.viaversion.viabackwards.api.dat super.loadExtras(data); try { - final ListTag chatTypes = BinaryTagIO.readInputStream(VBMappingDataLoader.getResource("chat-types-1.19.1.nbt")).get("values"); + final ListTag chatTypes = NBTIO.readTag(VBMappingDataLoader.getResource("chat-types-1.19.1.nbt")).get("values"); for (final Tag chatType : chatTypes) { final CompoundTag chatTypeCompound = (CompoundTag) chatType; final NumberTag idTag = chatTypeCompound.get("id"); diff --git a/common/src/main/java/com/viaversion/viabackwards/protocol/protocol1_19_4to1_20/data/BackwardsMappings.java b/common/src/main/java/com/viaversion/viabackwards/protocol/protocol1_19_4to1_20/data/BackwardsMappings.java index a9ae27bc..10a3e168 100644 --- a/common/src/main/java/com/viaversion/viabackwards/protocol/protocol1_19_4to1_20/data/BackwardsMappings.java +++ b/common/src/main/java/com/viaversion/viabackwards/protocol/protocol1_19_4to1_20/data/BackwardsMappings.java @@ -18,10 +18,9 @@ package com.viaversion.viabackwards.protocol.protocol1_19_4to1_20.data; import com.viaversion.viabackwards.api.data.VBMappingDataLoader; -import com.viaversion.viaversion.api.minecraft.nbt.BinaryTagIO; +import com.viaversion.viaversion.libs.opennbt.NBTIO; import com.viaversion.viaversion.libs.opennbt.tag.builtin.CompoundTag; import com.viaversion.viaversion.protocols.protocol1_20to1_19_4.Protocol1_20To1_19_4; - import java.io.IOException; public class BackwardsMappings extends com.viaversion.viabackwards.api.data.BackwardsMappings { @@ -37,7 +36,7 @@ public class BackwardsMappings extends com.viaversion.viabackwards.api.data.Back super.loadExtras(data); try { - trimPatternRegistry = BinaryTagIO.readInputStream(VBMappingDataLoader.getResource("trim_pattern-1.19.4.nbt")); + trimPatternRegistry = NBTIO.readTag(VBMappingDataLoader.getResource("trim_pattern-1.19.4.nbt")); } catch (final IOException e) { e.printStackTrace(); }