From 994e011611f4915b97e30a640d9876efb5563b80 Mon Sep 17 00:00:00 2001 From: FlorianMichael Date: Wed, 3 Jul 2024 22:02:47 +0200 Subject: [PATCH] Fix protocol class names Protocol classes should be named the same as the package: server version To client version --- .../platform/ViaAprilFoolsPlatform.java | 12 ++++++------ ...hareware.java => Protocol3D_SharewareTo1_14.java} | 6 +++--- .../BlockItemPacketRewriter3D_Shareware.java | 6 +++--- .../rewriter/EntityPacketRewriter3D_Shareware.java | 6 +++--- ...Test8c.java => ProtocolCombatTest8cTo1_16_2.java} | 4 ++-- ...reto1_14.java => Protocol1_14To3D_Shareware.java} | 4 ++-- 6 files changed, 19 insertions(+), 19 deletions(-) rename src/main/java/net/raphimc/viaaprilfools/protocol/s3d_sharewaretov1_14/{Protocol1_14to3D_Shareware.java => Protocol3D_SharewareTo1_14.java} (96%) rename src/main/java/net/raphimc/viaaprilfools/protocol/scombattest8ctov1_16_2/{Protocol1_16_2toCombatTest8c.java => ProtocolCombatTest8cTo1_16_2.java} (95%) rename src/main/java/net/raphimc/viaaprilfools/protocol/v1_14tos3d_shareware/{Protocol3D_Sharewareto1_14.java => Protocol1_14To3D_Shareware.java} (94%) diff --git a/src/main/java/net/raphimc/viaaprilfools/platform/ViaAprilFoolsPlatform.java b/src/main/java/net/raphimc/viaaprilfools/platform/ViaAprilFoolsPlatform.java index a278c65..e73d267 100644 --- a/src/main/java/net/raphimc/viaaprilfools/platform/ViaAprilFoolsPlatform.java +++ b/src/main/java/net/raphimc/viaaprilfools/platform/ViaAprilFoolsPlatform.java @@ -23,10 +23,10 @@ import com.viaversion.viaversion.api.protocol.version.ProtocolVersion; import net.raphimc.viaaprilfools.ViaAprilFools; import net.raphimc.viaaprilfools.ViaAprilFoolsConfig; import net.raphimc.viaaprilfools.api.AprilFoolsProtocolVersion; -import net.raphimc.viaaprilfools.protocol.s3d_sharewaretov1_14.Protocol1_14to3D_Shareware; -import net.raphimc.viaaprilfools.protocol.scombattest8ctov1_16_2.Protocol1_16_2toCombatTest8c; +import net.raphimc.viaaprilfools.protocol.s3d_sharewaretov1_14.Protocol3D_SharewareTo1_14; +import net.raphimc.viaaprilfools.protocol.scombattest8ctov1_16_2.ProtocolCombatTest8cTo1_16_2; import net.raphimc.viaaprilfools.protocol.s20w14infinitetov1_16.Protocol20w14infiniteTo1_16; -import net.raphimc.viaaprilfools.protocol.v1_14tos3d_shareware.Protocol3D_Sharewareto1_14; +import net.raphimc.viaaprilfools.protocol.v1_14tos3d_shareware.Protocol1_14To3D_Shareware; import java.io.File; import java.util.logging.Logger; @@ -41,10 +41,10 @@ public interface ViaAprilFoolsPlatform { Via.getManager().getSubPlatforms().add(ViaAprilFools.IMPL_VERSION); final ProtocolManager protocolManager = Via.getManager().getProtocolManager(); - protocolManager.registerProtocol(new Protocol1_14to3D_Shareware(), ProtocolVersion.v1_14, AprilFoolsProtocolVersion.s3d_shareware); - protocolManager.registerProtocol(new Protocol3D_Sharewareto1_14(), AprilFoolsProtocolVersion.s3d_shareware, ProtocolVersion.v1_14); + protocolManager.registerProtocol(new Protocol3D_SharewareTo1_14(), ProtocolVersion.v1_14, AprilFoolsProtocolVersion.s3d_shareware); + protocolManager.registerProtocol(new Protocol1_14To3D_Shareware(), AprilFoolsProtocolVersion.s3d_shareware, ProtocolVersion.v1_14); protocolManager.registerProtocol(new Protocol20w14infiniteTo1_16(), ProtocolVersion.v1_16, AprilFoolsProtocolVersion.s20w14infinite); - protocolManager.registerProtocol(new Protocol1_16_2toCombatTest8c(), ProtocolVersion.v1_16_2, AprilFoolsProtocolVersion.sCombatTest8c); + protocolManager.registerProtocol(new ProtocolCombatTest8cTo1_16_2(), ProtocolVersion.v1_16_2, AprilFoolsProtocolVersion.sCombatTest8c); } Logger getLogger(); diff --git a/src/main/java/net/raphimc/viaaprilfools/protocol/s3d_sharewaretov1_14/Protocol1_14to3D_Shareware.java b/src/main/java/net/raphimc/viaaprilfools/protocol/s3d_sharewaretov1_14/Protocol3D_SharewareTo1_14.java similarity index 96% rename from src/main/java/net/raphimc/viaaprilfools/protocol/s3d_sharewaretov1_14/Protocol1_14to3D_Shareware.java rename to src/main/java/net/raphimc/viaaprilfools/protocol/s3d_sharewaretov1_14/Protocol3D_SharewareTo1_14.java index 729a7ae..0f95a5a 100644 --- a/src/main/java/net/raphimc/viaaprilfools/protocol/s3d_sharewaretov1_14/Protocol1_14to3D_Shareware.java +++ b/src/main/java/net/raphimc/viaaprilfools/protocol/s3d_sharewaretov1_14/Protocol3D_SharewareTo1_14.java @@ -35,14 +35,14 @@ import net.raphimc.viaaprilfools.protocol.s3d_sharewaretov1_14.rewriter.BlockIte import net.raphimc.viaaprilfools.protocol.s3d_sharewaretov1_14.rewriter.EntityPacketRewriter3D_Shareware; import net.raphimc.viaaprilfools.protocol.s3d_sharewaretov1_14.storage.ChunkCenterTracker3D_Shareware; -public class Protocol1_14to3D_Shareware extends BackwardsProtocol { +public class Protocol3D_SharewareTo1_14 extends BackwardsProtocol { public static final BackwardsMappingData MAPPINGS = new AprilFoolsMappingData("3D_Shareware", "1.14", Protocol1_13_2To1_14.class); private static final int SERVERSIDE_VIEW_DISTANCE = 64; private final BlockItemPacketRewriter3D_Shareware blockItemPackets = new BlockItemPacketRewriter3D_Shareware(this); - public Protocol1_14to3D_Shareware() { + public Protocol3D_SharewareTo1_14() { super(ClientboundPackets3D_Shareware.class, ClientboundPackets1_14.class, ServerboundPackets3D_Shareware.class, ServerboundPackets1_14.class); } @@ -68,7 +68,7 @@ public class Protocol1_14to3D_Shareware extends BackwardsProtocol { +public class BlockItemPacketRewriter3D_Shareware extends ItemRewriter { - public BlockItemPacketRewriter3D_Shareware(Protocol1_14to3D_Shareware protocol) { + public BlockItemPacketRewriter3D_Shareware(Protocol3D_SharewareTo1_14 protocol) { super(protocol, Types.ITEM1_13_2, Types.ITEM1_13_2_SHORT_ARRAY); } diff --git a/src/main/java/net/raphimc/viaaprilfools/protocol/s3d_sharewaretov1_14/rewriter/EntityPacketRewriter3D_Shareware.java b/src/main/java/net/raphimc/viaaprilfools/protocol/s3d_sharewaretov1_14/rewriter/EntityPacketRewriter3D_Shareware.java index b69beca..d7a1818 100644 --- a/src/main/java/net/raphimc/viaaprilfools/protocol/s3d_sharewaretov1_14/rewriter/EntityPacketRewriter3D_Shareware.java +++ b/src/main/java/net/raphimc/viaaprilfools/protocol/s3d_sharewaretov1_14/rewriter/EntityPacketRewriter3D_Shareware.java @@ -24,13 +24,13 @@ import com.viaversion.viaversion.api.rewriter.RewriterBase; import com.viaversion.viaversion.api.type.Types; import com.viaversion.viaversion.api.type.types.version.Types1_14; import net.raphimc.viaaprilfools.protocol.s3d_sharewaretov1_14.packet.ClientboundPackets3D_Shareware; -import net.raphimc.viaaprilfools.protocol.s3d_sharewaretov1_14.Protocol1_14to3D_Shareware; +import net.raphimc.viaaprilfools.protocol.s3d_sharewaretov1_14.Protocol3D_SharewareTo1_14; import java.util.List; -public class EntityPacketRewriter3D_Shareware extends RewriterBase { +public class EntityPacketRewriter3D_Shareware extends RewriterBase { - public EntityPacketRewriter3D_Shareware(Protocol1_14to3D_Shareware protocol) { + public EntityPacketRewriter3D_Shareware(Protocol3D_SharewareTo1_14 protocol) { super(protocol); } diff --git a/src/main/java/net/raphimc/viaaprilfools/protocol/scombattest8ctov1_16_2/Protocol1_16_2toCombatTest8c.java b/src/main/java/net/raphimc/viaaprilfools/protocol/scombattest8ctov1_16_2/ProtocolCombatTest8cTo1_16_2.java similarity index 95% rename from src/main/java/net/raphimc/viaaprilfools/protocol/scombattest8ctov1_16_2/Protocol1_16_2toCombatTest8c.java rename to src/main/java/net/raphimc/viaaprilfools/protocol/scombattest8ctov1_16_2/ProtocolCombatTest8cTo1_16_2.java index 88f19b1..e3fc564 100644 --- a/src/main/java/net/raphimc/viaaprilfools/protocol/scombattest8ctov1_16_2/Protocol1_16_2toCombatTest8c.java +++ b/src/main/java/net/raphimc/viaaprilfools/protocol/scombattest8ctov1_16_2/ProtocolCombatTest8cTo1_16_2.java @@ -26,9 +26,9 @@ import com.viaversion.viaversion.api.type.Types; import com.viaversion.viaversion.protocols.v1_16_1to1_16_2.packet.ClientboundPackets1_16_2; import com.viaversion.viaversion.protocols.v1_16_1to1_16_2.packet.ServerboundPackets1_16_2; -public class Protocol1_16_2toCombatTest8c extends AbstractProtocol { +public class ProtocolCombatTest8cTo1_16_2 extends AbstractProtocol { - public Protocol1_16_2toCombatTest8c() { + public ProtocolCombatTest8cTo1_16_2() { super(ClientboundPackets1_16_2.class, ClientboundPackets1_16_2.class, ServerboundPackets1_16_2.class, ServerboundPackets1_16_2.class); } diff --git a/src/main/java/net/raphimc/viaaprilfools/protocol/v1_14tos3d_shareware/Protocol3D_Sharewareto1_14.java b/src/main/java/net/raphimc/viaaprilfools/protocol/v1_14tos3d_shareware/Protocol1_14To3D_Shareware.java similarity index 94% rename from src/main/java/net/raphimc/viaaprilfools/protocol/v1_14tos3d_shareware/Protocol3D_Sharewareto1_14.java rename to src/main/java/net/raphimc/viaaprilfools/protocol/v1_14tos3d_shareware/Protocol1_14To3D_Shareware.java index 1e7bd54..f33bd15 100644 --- a/src/main/java/net/raphimc/viaaprilfools/protocol/v1_14tos3d_shareware/Protocol3D_Sharewareto1_14.java +++ b/src/main/java/net/raphimc/viaaprilfools/protocol/v1_14tos3d_shareware/Protocol1_14To3D_Shareware.java @@ -23,9 +23,9 @@ import com.viaversion.viaversion.protocols.v1_13_2to1_14.packet.ServerboundPacke import net.raphimc.viaaprilfools.protocol.s3d_sharewaretov1_14.packet.ClientboundPackets3D_Shareware; import net.raphimc.viaaprilfools.protocol.s3d_sharewaretov1_14.packet.ServerboundPackets3D_Shareware; -public class Protocol3D_Sharewareto1_14 extends BackwardsProtocol { +public class Protocol1_14To3D_Shareware extends BackwardsProtocol { - public Protocol3D_Sharewareto1_14() { + public Protocol1_14To3D_Shareware() { super(ClientboundPackets1_14.class, ClientboundPackets3D_Shareware.class, ServerboundPackets1_14.class, ServerboundPackets3D_Shareware.class); }