From 4e5b6fe876ab779b544f573c577bddc9a0213322 Mon Sep 17 00:00:00 2001 From: EnZaXD <60033407+FlorianMichael@users.noreply.github.com> Date: Mon, 1 Apr 2024 13:01:07 +0200 Subject: [PATCH] Fix minor inconsistencies in older protocols (#714) --- .../protocol/protocol1_10to1_11/Protocol1_10To1_11.java | 9 ++++----- .../{ => data}/PotionSplashHandler.java | 2 +- .../protocol1_10to1_11/packets/BlockItemPackets1_11.java | 2 +- .../protocol1_10to1_11/packets/EntityPackets1_11.java | 2 +- .../protocol1_10to1_11/packets/PlayerPackets1_11.java | 2 +- .../protocol1_11_1to1_12/Protocol1_11_1To1_12.java | 1 - .../protocol1_11to1_11_1/Protocol1_11To1_11_1.java | 1 - .../protocol1_12_1to1_12_2/Protocol1_12_1To1_12_2.java | 1 + .../{ => storage}/KeepAliveTracker.java | 2 +- .../protocol1_12_2to1_13/Protocol1_12_2To1_13.java | 1 - .../protocol1_13_2to1_14/Protocol1_13_2To1_14.java | 1 - .../protocol1_17_1to1_18/data/BlockEntityIds.java | 2 +- .../protocol1_18_2to1_19/Protocol1_18_2To1_19.java | 2 +- .../protocol1_9_4to1_10/Protocol1_9_4To1_10.java | 3 ++- 14 files changed, 14 insertions(+), 17 deletions(-) rename common/src/main/java/com/viaversion/viabackwards/protocol/protocol1_10to1_11/{ => data}/PotionSplashHandler.java (96%) rename common/src/main/java/com/viaversion/viabackwards/protocol/protocol1_12_1to1_12_2/{ => storage}/KeepAliveTracker.java (99%) diff --git a/common/src/main/java/com/viaversion/viabackwards/protocol/protocol1_10to1_11/Protocol1_10To1_11.java b/common/src/main/java/com/viaversion/viabackwards/protocol/protocol1_10to1_11/Protocol1_10To1_11.java index 0721b130..27b3d58f 100644 --- a/common/src/main/java/com/viaversion/viabackwards/protocol/protocol1_10to1_11/Protocol1_10To1_11.java +++ b/common/src/main/java/com/viaversion/viabackwards/protocol/protocol1_10to1_11/Protocol1_10To1_11.java @@ -35,8 +35,8 @@ import com.viaversion.viaversion.protocols.protocol1_9_3to1_9_1_2.ServerboundPac public class Protocol1_10To1_11 extends BackwardsProtocol { public static final BackwardsMappings MAPPINGS = new BackwardsMappings("1.11", "1.10"); - private final EntityPackets1_11 entityPackets = new EntityPackets1_11(this); // Required for the item rewriter - private BlockItemPackets1_11 blockItemPackets; + private final EntityPackets1_11 entityPackets = new EntityPackets1_11(this); + private final BlockItemPackets1_11 blockItemPackets = new BlockItemPackets1_11(this); public Protocol1_10To1_11() { super(ClientboundPackets1_9_3.class, ClientboundPackets1_9_3.class, ServerboundPackets1_9_3.class, ServerboundPackets1_9_3.class); @@ -44,9 +44,9 @@ public class Protocol1_10To1_11 extends BackwardsProtocol soundRewriter = new SoundRewriter<>(this); soundRewriter.registerNamedSound(ClientboundPackets1_9_3.NAMED_SOUND); @@ -55,7 +55,6 @@ public class Protocol1_10To1_11 extends BackwardsProtocol. */ -package com.viaversion.viabackwards.protocol.protocol1_10to1_11; +package com.viaversion.viabackwards.protocol.protocol1_10to1_11.data; import com.viaversion.viaversion.libs.fastutil.ints.Int2IntMap; import com.viaversion.viaversion.libs.fastutil.ints.Int2IntOpenHashMap; diff --git a/common/src/main/java/com/viaversion/viabackwards/protocol/protocol1_10to1_11/packets/BlockItemPackets1_11.java b/common/src/main/java/com/viaversion/viabackwards/protocol/protocol1_10to1_11/packets/BlockItemPackets1_11.java index b37d1e60..3509f61c 100644 --- a/common/src/main/java/com/viaversion/viabackwards/protocol/protocol1_10to1_11/packets/BlockItemPackets1_11.java +++ b/common/src/main/java/com/viaversion/viabackwards/protocol/protocol1_10to1_11/packets/BlockItemPackets1_11.java @@ -38,7 +38,7 @@ import com.viaversion.viaversion.api.type.Type; import com.viaversion.viaversion.api.type.types.chunk.ChunkType1_9_3; import com.viaversion.viaversion.libs.opennbt.tag.builtin.CompoundTag; import com.viaversion.viaversion.libs.opennbt.tag.builtin.StringTag; -import com.viaversion.viaversion.protocols.protocol1_11to1_10.EntityIdRewriter; +import com.viaversion.viaversion.protocols.protocol1_11to1_10.rewriter.EntityIdRewriter; import com.viaversion.viaversion.protocols.protocol1_9_3to1_9_1_2.ClientboundPackets1_9_3; import com.viaversion.viaversion.protocols.protocol1_9_3to1_9_1_2.ServerboundPackets1_9_3; import java.util.Arrays; diff --git a/common/src/main/java/com/viaversion/viabackwards/protocol/protocol1_10to1_11/packets/EntityPackets1_11.java b/common/src/main/java/com/viaversion/viabackwards/protocol/protocol1_10to1_11/packets/EntityPackets1_11.java index dd24014b..739780d0 100644 --- a/common/src/main/java/com/viaversion/viabackwards/protocol/protocol1_10to1_11/packets/EntityPackets1_11.java +++ b/common/src/main/java/com/viaversion/viabackwards/protocol/protocol1_10to1_11/packets/EntityPackets1_11.java @@ -21,7 +21,7 @@ package com.viaversion.viabackwards.protocol.protocol1_10to1_11.packets; import com.viaversion.viabackwards.api.entities.storage.EntityData; import com.viaversion.viabackwards.api.entities.storage.WrappedMetadata; import com.viaversion.viabackwards.api.rewriters.LegacyEntityRewriter; -import com.viaversion.viabackwards.protocol.protocol1_10to1_11.PotionSplashHandler; +import com.viaversion.viabackwards.protocol.protocol1_10to1_11.data.PotionSplashHandler; import com.viaversion.viabackwards.protocol.protocol1_10to1_11.Protocol1_10To1_11; import com.viaversion.viabackwards.protocol.protocol1_10to1_11.storage.ChestedHorseStorage; import com.viaversion.viaversion.api.data.entity.StoredEntityData; diff --git a/common/src/main/java/com/viaversion/viabackwards/protocol/protocol1_10to1_11/packets/PlayerPackets1_11.java b/common/src/main/java/com/viaversion/viabackwards/protocol/protocol1_10to1_11/packets/PlayerPackets1_11.java index 723881ae..73b21838 100644 --- a/common/src/main/java/com/viaversion/viabackwards/protocol/protocol1_10to1_11/packets/PlayerPackets1_11.java +++ b/common/src/main/java/com/viaversion/viabackwards/protocol/protocol1_10to1_11/packets/PlayerPackets1_11.java @@ -37,7 +37,7 @@ public class PlayerPackets1_11 { } }; - public void register(Protocol1_10To1_11 protocol) { + public static void register(Protocol1_10To1_11 protocol) { protocol.registerClientbound(ClientboundPackets1_9_3.TITLE, new PacketHandlers() { @Override public void register() { diff --git a/common/src/main/java/com/viaversion/viabackwards/protocol/protocol1_11_1to1_12/Protocol1_11_1To1_12.java b/common/src/main/java/com/viaversion/viabackwards/protocol/protocol1_11_1to1_12/Protocol1_11_1To1_12.java index 525ddd9e..ff64b3f6 100644 --- a/common/src/main/java/com/viaversion/viabackwards/protocol/protocol1_11_1to1_12/Protocol1_11_1To1_12.java +++ b/common/src/main/java/com/viaversion/viabackwards/protocol/protocol1_11_1to1_12/Protocol1_11_1To1_12.java @@ -69,7 +69,6 @@ public class Protocol1_11_1To1_12 extends BackwardsProtocol. */ -package com.viaversion.viabackwards.protocol.protocol1_12_1to1_12_2; +package com.viaversion.viabackwards.protocol.protocol1_12_1to1_12_2.storage; import com.viaversion.viaversion.api.connection.StorableObject; diff --git a/common/src/main/java/com/viaversion/viabackwards/protocol/protocol1_12_2to1_13/Protocol1_12_2To1_13.java b/common/src/main/java/com/viaversion/viabackwards/protocol/protocol1_12_2to1_13/Protocol1_12_2To1_13.java index fc34c976..fab7c8ea 100644 --- a/common/src/main/java/com/viaversion/viabackwards/protocol/protocol1_12_2to1_13/Protocol1_12_2To1_13.java +++ b/common/src/main/java/com/viaversion/viabackwards/protocol/protocol1_12_2to1_13/Protocol1_12_2To1_13.java @@ -112,7 +112,6 @@ public class Protocol1_12_2To1_13 extends BackwardsProtocol