From 8d46239fca317151eb901b949bafe323ff418f9b Mon Sep 17 00:00:00 2001 From: Gero Date: Thu, 30 May 2024 18:40:51 +0200 Subject: [PATCH] use mojang names for new packets --- .../proxy/connection/MinecraftSessionHandler.java | 8 ++++---- .../connection/backend/ConfigSessionHandler.java | 8 ++++---- .../proxy/protocol/StateRegistry.java | 12 ++++++------ ...ava => ClientboundCustomReportDetailsPacket.java} | 6 +++--- ...Packet.java => ClientboundServerLinksPacket.java} | 6 +++--- 5 files changed, 20 insertions(+), 20 deletions(-) rename proxy/src/main/java/com/velocitypowered/proxy/protocol/packet/config/{CustomReportDetailsPacket.java => ClientboundCustomReportDetailsPacket.java} (90%) rename proxy/src/main/java/com/velocitypowered/proxy/protocol/packet/config/{ServerLinksPacket.java => ClientboundServerLinksPacket.java} (93%) diff --git a/proxy/src/main/java/com/velocitypowered/proxy/connection/MinecraftSessionHandler.java b/proxy/src/main/java/com/velocitypowered/proxy/connection/MinecraftSessionHandler.java index 17239346fe..60ae1636da 100644 --- a/proxy/src/main/java/com/velocitypowered/proxy/connection/MinecraftSessionHandler.java +++ b/proxy/src/main/java/com/velocitypowered/proxy/connection/MinecraftSessionHandler.java @@ -62,11 +62,11 @@ import com.velocitypowered.proxy.protocol.packet.chat.session.SessionPlayerChatPacket; import com.velocitypowered.proxy.protocol.packet.chat.session.SessionPlayerCommandPacket; import com.velocitypowered.proxy.protocol.packet.config.ActiveFeaturesPacket; -import com.velocitypowered.proxy.protocol.packet.config.CustomReportDetailsPacket; +import com.velocitypowered.proxy.protocol.packet.config.ClientboundCustomReportDetailsPacket; import com.velocitypowered.proxy.protocol.packet.config.FinishedUpdatePacket; import com.velocitypowered.proxy.protocol.packet.config.KnownPacksPacket; import com.velocitypowered.proxy.protocol.packet.config.RegistrySyncPacket; -import com.velocitypowered.proxy.protocol.packet.config.ServerLinksPacket; +import com.velocitypowered.proxy.protocol.packet.config.ClientboundServerLinksPacket; import com.velocitypowered.proxy.protocol.packet.config.StartUpdatePacket; import com.velocitypowered.proxy.protocol.packet.config.TagsUpdatePacket; import com.velocitypowered.proxy.protocol.packet.title.LegacyTitlePacket; @@ -342,11 +342,11 @@ default boolean handle(KnownPacksPacket packet) { return false; } - default boolean handle(CustomReportDetailsPacket packet) { + default boolean handle(ClientboundCustomReportDetailsPacket packet) { return false; } - default boolean handle(ServerLinksPacket packet) { + default boolean handle(ClientboundServerLinksPacket packet) { return false; } } diff --git a/proxy/src/main/java/com/velocitypowered/proxy/connection/backend/ConfigSessionHandler.java b/proxy/src/main/java/com/velocitypowered/proxy/connection/backend/ConfigSessionHandler.java index 655f17ac1a..10f232da73 100644 --- a/proxy/src/main/java/com/velocitypowered/proxy/connection/backend/ConfigSessionHandler.java +++ b/proxy/src/main/java/com/velocitypowered/proxy/connection/backend/ConfigSessionHandler.java @@ -40,10 +40,10 @@ import com.velocitypowered.proxy.protocol.packet.ResourcePackRequestPacket; import com.velocitypowered.proxy.protocol.packet.ResourcePackResponsePacket; import com.velocitypowered.proxy.protocol.packet.TransferPacket; -import com.velocitypowered.proxy.protocol.packet.config.CustomReportDetailsPacket; +import com.velocitypowered.proxy.protocol.packet.config.ClientboundCustomReportDetailsPacket; import com.velocitypowered.proxy.protocol.packet.config.FinishedUpdatePacket; import com.velocitypowered.proxy.protocol.packet.config.RegistrySyncPacket; -import com.velocitypowered.proxy.protocol.packet.config.ServerLinksPacket; +import com.velocitypowered.proxy.protocol.packet.config.ClientboundServerLinksPacket; import com.velocitypowered.proxy.protocol.packet.config.StartUpdatePacket; import com.velocitypowered.proxy.protocol.packet.config.TagsUpdatePacket; import com.velocitypowered.proxy.protocol.util.PluginMessageUtil; @@ -114,13 +114,13 @@ public boolean handle(TagsUpdatePacket packet) { } @Override - public boolean handle(CustomReportDetailsPacket packet) { + public boolean handle(ClientboundCustomReportDetailsPacket packet) { serverConn.getPlayer().getConnection().write(packet); return true; } @Override - public boolean handle(ServerLinksPacket packet) { + public boolean handle(ClientboundServerLinksPacket packet) { serverConn.getPlayer().getConnection().write(packet); return true; } diff --git a/proxy/src/main/java/com/velocitypowered/proxy/protocol/StateRegistry.java b/proxy/src/main/java/com/velocitypowered/proxy/protocol/StateRegistry.java index 0ee5e184d3..c4ca95c472 100644 --- a/proxy/src/main/java/com/velocitypowered/proxy/protocol/StateRegistry.java +++ b/proxy/src/main/java/com/velocitypowered/proxy/protocol/StateRegistry.java @@ -92,11 +92,11 @@ import com.velocitypowered.proxy.protocol.packet.chat.session.SessionPlayerCommandPacket; import com.velocitypowered.proxy.protocol.packet.chat.session.UnsignedPlayerCommandPacket; import com.velocitypowered.proxy.protocol.packet.config.ActiveFeaturesPacket; -import com.velocitypowered.proxy.protocol.packet.config.CustomReportDetailsPacket; +import com.velocitypowered.proxy.protocol.packet.config.ClientboundCustomReportDetailsPacket; import com.velocitypowered.proxy.protocol.packet.config.FinishedUpdatePacket; import com.velocitypowered.proxy.protocol.packet.config.KnownPacksPacket; import com.velocitypowered.proxy.protocol.packet.config.RegistrySyncPacket; -import com.velocitypowered.proxy.protocol.packet.config.ServerLinksPacket; +import com.velocitypowered.proxy.protocol.packet.config.ClientboundServerLinksPacket; import com.velocitypowered.proxy.protocol.packet.config.StartUpdatePacket; import com.velocitypowered.proxy.protocol.packet.config.TagsUpdatePacket; import com.velocitypowered.proxy.protocol.packet.title.LegacyTitlePacket; @@ -217,9 +217,9 @@ public enum StateRegistry { map(0x0D, MINECRAFT_1_20_5, false)); clientbound.register(KnownPacksPacket.class, KnownPacksPacket::new, map(0x0E, MINECRAFT_1_20_5, false)); - clientbound.register(CustomReportDetailsPacket.class, CustomReportDetailsPacket::new, + clientbound.register(ClientboundCustomReportDetailsPacket.class, ClientboundCustomReportDetailsPacket::new, map(0x0F, MINECRAFT_1_21, false)); - clientbound.register(ServerLinksPacket.class, ServerLinksPacket::new, + clientbound.register(ClientboundServerLinksPacket.class, ClientboundServerLinksPacket::new, map(0x10, MINECRAFT_1_21, false)); } }, @@ -645,9 +645,9 @@ public enum StateRegistry { TransferPacket::new, map(0x73, MINECRAFT_1_20_5, false) ); - clientbound.register(CustomReportDetailsPacket.class, CustomReportDetailsPacket::new, + clientbound.register(ClientboundCustomReportDetailsPacket.class, ClientboundCustomReportDetailsPacket::new, map(0x7A, MINECRAFT_1_21, false)); - clientbound.register(ServerLinksPacket.class, ServerLinksPacket::new, + clientbound.register(ClientboundServerLinksPacket.class, ClientboundServerLinksPacket::new, map(0x7B, MINECRAFT_1_21, false)); } }, diff --git a/proxy/src/main/java/com/velocitypowered/proxy/protocol/packet/config/CustomReportDetailsPacket.java b/proxy/src/main/java/com/velocitypowered/proxy/protocol/packet/config/ClientboundCustomReportDetailsPacket.java similarity index 90% rename from proxy/src/main/java/com/velocitypowered/proxy/protocol/packet/config/CustomReportDetailsPacket.java rename to proxy/src/main/java/com/velocitypowered/proxy/protocol/packet/config/ClientboundCustomReportDetailsPacket.java index 39a2d4dd38..6a3618cb73 100644 --- a/proxy/src/main/java/com/velocitypowered/proxy/protocol/packet/config/CustomReportDetailsPacket.java +++ b/proxy/src/main/java/com/velocitypowered/proxy/protocol/packet/config/ClientboundCustomReportDetailsPacket.java @@ -25,14 +25,14 @@ import java.util.HashMap; import java.util.Map; -public class CustomReportDetailsPacket implements MinecraftPacket { +public class ClientboundCustomReportDetailsPacket implements MinecraftPacket { private Map details; - public CustomReportDetailsPacket() { + public ClientboundCustomReportDetailsPacket() { } - public CustomReportDetailsPacket(Map details) { + public ClientboundCustomReportDetailsPacket(Map details) { this.details = details; } diff --git a/proxy/src/main/java/com/velocitypowered/proxy/protocol/packet/config/ServerLinksPacket.java b/proxy/src/main/java/com/velocitypowered/proxy/protocol/packet/config/ClientboundServerLinksPacket.java similarity index 93% rename from proxy/src/main/java/com/velocitypowered/proxy/protocol/packet/config/ServerLinksPacket.java rename to proxy/src/main/java/com/velocitypowered/proxy/protocol/packet/config/ClientboundServerLinksPacket.java index 9011bece09..bee080ee82 100644 --- a/proxy/src/main/java/com/velocitypowered/proxy/protocol/packet/config/ServerLinksPacket.java +++ b/proxy/src/main/java/com/velocitypowered/proxy/protocol/packet/config/ClientboundServerLinksPacket.java @@ -26,14 +26,14 @@ import java.util.ArrayList; import java.util.List; -public class ServerLinksPacket implements MinecraftPacket { +public class ClientboundServerLinksPacket implements MinecraftPacket { private List serverLinks; - public ServerLinksPacket() { + public ClientboundServerLinksPacket() { } - public ServerLinksPacket(List serverLinks) { + public ClientboundServerLinksPacket(List serverLinks) { this.serverLinks = serverLinks; }