diff --git a/api/src/main/java/com/velocitypowered/api/network/ProtocolVersion.java b/api/src/main/java/com/velocitypowered/api/network/ProtocolVersion.java index d7a616f738..edfd9383a6 100644 --- a/api/src/main/java/com/velocitypowered/api/network/ProtocolVersion.java +++ b/api/src/main/java/com/velocitypowered/api/network/ProtocolVersion.java @@ -59,7 +59,8 @@ public enum ProtocolVersion { MINECRAFT_1_18(757, "1.18", "1.18.1"), MINECRAFT_1_18_2(758, "1.18.2"), MINECRAFT_1_19(759, "1.19"), - MINECRAFT_1_19_1(760, "1.19.1", "1.19.2"); + MINECRAFT_1_19_1(760, "1.19.1", "1.19.2"), + MINECRAFT_1_20(-1, 102, "1.20"); // 22w42a private static final int SNAPSHOT_BIT = 30; diff --git a/proxy/src/main/java/com/velocitypowered/proxy/connection/client/ClientPlaySessionHandler.java b/proxy/src/main/java/com/velocitypowered/proxy/connection/client/ClientPlaySessionHandler.java index 05d3925f45..fc1d1a0d7c 100644 --- a/proxy/src/main/java/com/velocitypowered/proxy/connection/client/ClientPlaySessionHandler.java +++ b/proxy/src/main/java/com/velocitypowered/proxy/connection/client/ClientPlaySessionHandler.java @@ -187,18 +187,9 @@ private CompletableFuture callChat(MinecraftPacket original, Pl String messageNew = eventMsg.get(); if (playerKey != null) { if (signedMessage != null && !messageNew.equals(signedMessage.getMessage())) { - if (playerKey.getKeyRevision().compareTo(IdentifiedKey.Revision.LINKED_V2) >= 0) { - // Bad, very bad. - logger.fatal("A plugin tried to change a signed chat message. " - + "This is no longer possible in 1.19.1 and newer. " - + "Disconnecting player " + player.getUsername()); - player.disconnect(Component.text("A proxy plugin caused an illegal protocol state. " - + "Contact your network administrator.")); - } else { - logger.warn("A plugin changed a signed chat message. The server may not accept it."); - return ChatBuilder.builder(player.getProtocolVersion()) - .message(messageNew).toServer(); - } + logger.warn("A plugin changed a signed chat message. The server may not accept it."); + return ChatBuilder.builder(player.getProtocolVersion()) + .message(messageNew).toServer(); } else { return original; } @@ -209,14 +200,6 @@ private CompletableFuture callChat(MinecraftPacket original, Pl } else { return original; } - } else { - if (playerKey != null && playerKey.getKeyRevision().compareTo(IdentifiedKey.Revision.LINKED_V2) >= 0) { - logger.fatal("A plugin tried to cancel a signed chat message." - + " This is no longer possible in 1.19.1 and newer. " - + "Disconnecting player " + player.getUsername()); - player.disconnect(Component.text("A proxy plugin caused an illegal protocol state. " - + "Contact your network administrator.")); - } } return null; }) @@ -744,16 +727,6 @@ private CompletableFuture processCommandExecuteResult(String or Instant passedTimestamp) { IdentifiedKey playerKey = player.getIdentifiedKey(); if (result == CommandResult.denied()) { - if (playerKey != null) { - if (signedCommand != null && playerKey.getKeyRevision() - .compareTo(IdentifiedKey.Revision.LINKED_V2) >= 0) { - logger.fatal("A plugin tried to deny a command with signable component(s). " - + "This is not supported. " - + "Disconnecting player " + player.getUsername()); - player.disconnect(Component.text("A proxy plugin caused an illegal protocol state. " - + "Contact your network administrator.")); - } - } return CompletableFuture.completedFuture(null); } @@ -767,15 +740,6 @@ private CompletableFuture processCommandExecuteResult(String or if (signedCommand != null && commandToRun.equals(signedCommand.getBaseCommand())) { write.message(signedCommand); } else { - if (signedCommand != null && playerKey != null && playerKey.getKeyRevision() - .compareTo(IdentifiedKey.Revision.LINKED_V2) >= 0) { - logger.fatal("A plugin tried to change a command with signed component(s). " - + "This is not supported. " - + "Disconnecting player " + player.getUsername()); - player.disconnect(Component.text("A proxy plugin caused an illegal protocol state. " - + "Contact your network administrator.")); - return CompletableFuture.completedFuture(null); - } write.message("/" + commandToRun); } return CompletableFuture.completedFuture(write.toServer()); @@ -791,15 +755,6 @@ private CompletableFuture processCommandExecuteResult(String or if (signedCommand != null && commandToRun.equals(signedCommand.getBaseCommand())) { write.message(signedCommand); } else { - if (signedCommand != null && playerKey != null && playerKey.getKeyRevision() - .compareTo(IdentifiedKey.Revision.LINKED_V2) >= 0) { - logger.fatal("A plugin tried to change a command with signed component(s). " - + "This is not supported. " - + "Disconnecting player " + player.getUsername()); - player.disconnect(Component.text("A proxy plugin caused an illegal protocol state. " - + "Contact your network administrator.")); - return null; - } write.message("/" + commandToRun); } return write.toServer();