From b09950dc644dfa6fcd2e080b59295cc30597d3d0 Mon Sep 17 00:00:00 2001 From: Nassim Jahnke Date: Sun, 10 Dec 2023 12:15:35 +0100 Subject: [PATCH] Update Via usage --- .../viabackwards/api/ViaBackwardsPlatform.java | 2 +- .../packets/BlockItemPackets1_16.java | 10 +++++----- .../protocol1_20_2to1_20_3/Protocol1_20_2To1_20_3.java | 6 +++--- .../rewriter/EntityPacketRewriter1_20_3.java | 6 +++--- gradle/libs.versions.toml | 2 +- 5 files changed, 13 insertions(+), 13 deletions(-) diff --git a/common/src/main/java/com/viaversion/viabackwards/api/ViaBackwardsPlatform.java b/common/src/main/java/com/viaversion/viabackwards/api/ViaBackwardsPlatform.java index a1563e1c..1a8274af 100644 --- a/common/src/main/java/com/viaversion/viabackwards/api/ViaBackwardsPlatform.java +++ b/common/src/main/java/com/viaversion/viabackwards/api/ViaBackwardsPlatform.java @@ -67,7 +67,7 @@ import java.util.logging.Logger; public interface ViaBackwardsPlatform { - String MINIMUM_VV_VERSION = "4.9.0"; + String MINIMUM_VV_VERSION = "4.9.3"; /** * Initialize ViaBackwards. diff --git a/common/src/main/java/com/viaversion/viabackwards/protocol/protocol1_15_2to1_16/packets/BlockItemPackets1_16.java b/common/src/main/java/com/viaversion/viabackwards/protocol/protocol1_15_2to1_16/packets/BlockItemPackets1_16.java index 8c1cdb58..3e183e04 100644 --- a/common/src/main/java/com/viaversion/viabackwards/protocol/protocol1_15_2to1_16/packets/BlockItemPackets1_16.java +++ b/common/src/main/java/com/viaversion/viabackwards/protocol/protocol1_15_2to1_16/packets/BlockItemPackets1_16.java @@ -32,7 +32,6 @@ import com.viaversion.viaversion.api.protocol.packet.PacketWrapper; import com.viaversion.viaversion.api.protocol.remapper.PacketHandlers; import com.viaversion.viaversion.api.protocol.version.ProtocolVersion; import com.viaversion.viaversion.api.type.Type; -import com.viaversion.viaversion.api.type.types.UUIDIntArrayType; import com.viaversion.viaversion.api.type.types.chunk.ChunkType1_15; import com.viaversion.viaversion.api.type.types.chunk.ChunkType1_16; import com.viaversion.viaversion.libs.gson.JsonElement; @@ -50,6 +49,7 @@ import com.viaversion.viaversion.rewriter.BlockRewriter; import com.viaversion.viaversion.rewriter.RecipeRewriter; import com.viaversion.viaversion.util.CompactArrayUtil; import com.viaversion.viaversion.util.Key; +import com.viaversion.viaversion.util.UUIDUtil; import java.util.ArrayList; import java.util.List; import java.util.Map; @@ -257,7 +257,7 @@ public class BlockItemPackets1_16 extends com.viaversion.viabackwards.api.rewrit if (!(targetUuidTag instanceof IntArrayTag)) return; // Target -> target_uuid - UUID targetUuid = UUIDIntArrayType.uuidFromIntArray((int[]) targetUuidTag.getValue()); + UUID targetUuid = UUIDUtil.fromIntArray((int[]) targetUuidTag.getValue()); tag.put("target_uuid", new StringTag(targetUuid.toString())); } else if (id.equals("minecraft:skull")) { Tag skullOwnerTag = tag.remove("SkullOwner"); @@ -266,7 +266,7 @@ public class BlockItemPackets1_16 extends com.viaversion.viabackwards.api.rewrit CompoundTag skullOwnerCompoundTag = (CompoundTag) skullOwnerTag; Tag ownerUuidTag = skullOwnerCompoundTag.remove("Id"); if (ownerUuidTag instanceof IntArrayTag) { - UUID ownerUuid = UUIDIntArrayType.uuidFromIntArray((int[]) ownerUuidTag.getValue()); + UUID ownerUuid = UUIDUtil.fromIntArray((int[]) ownerUuidTag.getValue()); skullOwnerCompoundTag.put("Id", new StringTag(ownerUuid.toString())); } @@ -298,7 +298,7 @@ public class BlockItemPackets1_16 extends com.viaversion.viabackwards.api.rewrit CompoundTag ownerCompundTag = (CompoundTag) ownerTag; Tag idTag = ownerCompundTag.get("Id"); if (idTag instanceof IntArrayTag) { - UUID ownerUuid = UUIDIntArrayType.uuidFromIntArray((int[]) idTag.getValue()); + UUID ownerUuid = UUIDUtil.fromIntArray((int[]) idTag.getValue()); ownerCompundTag.put("Id", new StringTag(ownerUuid.toString())); } } @@ -340,7 +340,7 @@ public class BlockItemPackets1_16 extends com.viaversion.viabackwards.api.rewrit Tag idTag = ownerCompundTag.get("Id"); if (idTag instanceof StringTag) { UUID ownerUuid = UUID.fromString((String) idTag.getValue()); - ownerCompundTag.put("Id", new IntArrayTag(UUIDIntArrayType.uuidToIntArray(ownerUuid))); + ownerCompundTag.put("Id", new IntArrayTag(UUIDUtil.toIntArray(ownerUuid))); } } } diff --git a/common/src/main/java/com/viaversion/viabackwards/protocol/protocol1_20_2to1_20_3/Protocol1_20_2To1_20_3.java b/common/src/main/java/com/viaversion/viabackwards/protocol/protocol1_20_2to1_20_3/Protocol1_20_2To1_20_3.java index 6e02a4e0..7afe1cba 100644 --- a/common/src/main/java/com/viaversion/viabackwards/protocol/protocol1_20_2to1_20_3/Protocol1_20_2To1_20_3.java +++ b/common/src/main/java/com/viaversion/viabackwards/protocol/protocol1_20_2to1_20_3/Protocol1_20_2To1_20_3.java @@ -47,10 +47,10 @@ import com.viaversion.viaversion.protocols.protocol1_20_3to1_20_2.Protocol1_20_3 import com.viaversion.viaversion.protocols.protocol1_20_3to1_20_2.packet.ClientboundConfigurationPackets1_20_3; import com.viaversion.viaversion.protocols.protocol1_20_3to1_20_2.packet.ClientboundPackets1_20_3; import com.viaversion.viaversion.protocols.protocol1_20_3to1_20_2.packet.ServerboundPackets1_20_3; +import com.viaversion.viaversion.protocols.protocol1_20_3to1_20_2.util.ComponentConverter; import com.viaversion.viaversion.rewriter.ComponentRewriter.ReadType; import com.viaversion.viaversion.rewriter.StatisticsRewriter; import com.viaversion.viaversion.rewriter.TagRewriter; - import java.util.BitSet; import java.util.UUID; @@ -368,13 +368,13 @@ public final class Protocol1_20_2To1_20_3 extends BackwardsProtocol { @@ -99,10 +99,10 @@ public final class EntityPacketRewriter1_20_3 extends EntityRewriter { final MetaType type = meta.metaType(); if (type == Types1_20_3.META_TYPES.componentType) { - meta.setTypeAndValue(Types1_20_2.META_TYPES.componentType, Protocol1_20_3To1_20_2.tagComponentToJson(meta.value())); + meta.setTypeAndValue(Types1_20_2.META_TYPES.componentType, ComponentConverter.tagComponentToJson(meta.value())); return; } else if (type == Types1_20_3.META_TYPES.optionalComponentType) { - meta.setTypeAndValue(Types1_20_2.META_TYPES.optionalComponentType, Protocol1_20_3To1_20_2.tagComponentToJson(meta.value())); + meta.setTypeAndValue(Types1_20_2.META_TYPES.optionalComponentType, ComponentConverter.tagComponentToJson(meta.value())); return; } else if (type == Types1_20_3.META_TYPES.particleType) { final Particle particle = (Particle) meta.getValue(); diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 21d95522..8bcfa4ca 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -3,7 +3,7 @@ metadata.format.version = "1.1" [versions] # ViaVersion -viaver = "4.9.0" +viaver = "4.9.3-SNAPSHOT" # Common provided netty = "4.0.20.Final"