diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 7ef8340..12d80b7 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -6,7 +6,7 @@ coreprotect = "22.4" paper = "1.20.2-R0.1-SNAPSHOT" plotsquared = "7.3.9-20240513.192211-13" reflection-remapper = "0.1.2-20240315.033304-2" -viaversion-api = "4.10.1-20240505.124211-22" +viaversion-api = "5.0.1" worldguard-bukkit = "7.1.0-20240503.180049-12" zstd-jni = "1.5.5-4" diff --git a/src/main/java/com/moulberry/axiom/viaversion/ViaVersionHelper.java b/src/main/java/com/moulberry/axiom/viaversion/ViaVersionHelper.java index 896d313..f874de7 100644 --- a/src/main/java/com/moulberry/axiom/viaversion/ViaVersionHelper.java +++ b/src/main/java/com/moulberry/axiom/viaversion/ViaVersionHelper.java @@ -7,6 +7,7 @@ import com.viaversion.viaversion.api.data.MappingData; import com.viaversion.viaversion.api.data.Mappings; import com.viaversion.viaversion.api.protocol.ProtocolPathEntry; import com.viaversion.viaversion.api.type.Type; +import com.viaversion.viaversion.api.type.Types; import io.netty.buffer.Unpooled; import it.unimi.dsi.fastutil.ints.Int2ObjectOpenHashMap; import net.minecraft.SharedConstants; @@ -108,28 +109,28 @@ public class ViaVersionHelper { } public static CompoundTag readTagViaVersion(FriendlyByteBuf friendlyByteBuf, int playerVersion) throws Exception { - Type from = getTagType(playerVersion); - Type to = getTagType(SharedConstants.getProtocolVersion()); + Type from = getTagType(playerVersion); + Type to = getTagType(SharedConstants.getProtocolVersion()); return readTagViaVersion(friendlyByteBuf, from, to); } - private static Type getTagType(int version) { + private static Type getTagType(int version) { if (version < UNNAMED_COMPOUND_TAG_CHANGE_VERSION) { - return Type.NAMED_COMPOUND_TAG; + return Types.NAMED_COMPOUND_TAG; } else { - return Type.COMPOUND_TAG; + return Types.COMPOUND_TAG; } } private static CompoundTag readTagViaVersion(FriendlyByteBuf friendlyByteBuf, - Type from, - Type to) throws Exception { + Type from, + Type to) throws Exception { if (from == to) { return friendlyByteBuf.readNbt(); } - com.viaversion.viaversion.libs.opennbt.tag.builtin.CompoundTag tag = from.read(friendlyByteBuf); + com.viaversion.nbt.tag.CompoundTag tag = from.read(friendlyByteBuf); FriendlyByteBuf buffer = new FriendlyByteBuf(Unpooled.buffer()); to.write(buffer, tag); return buffer.readNbt();