Skip to content

Commit

Permalink
Fix disable check out-of-order (#46)
Browse files Browse the repository at this point in the history
  • Loading branch information
s-yh-china committed Jun 15, 2023
1 parent f8783b7 commit b2b36fa
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions patches/server/0068-Disable-check-out-of-order-command.patch
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,15 @@ Subject: [PATCH] Disable check out-of-order command


diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
index 0cc4bd960383759abeabe20c52e9af84228527a1..3100ad9c7da7e48d5c0f8b2a976cba708c62dfcb 100644
index 0cc4bd960383759abeabe20c52e9af84228527a1..cfba0e8f527265099679096d1764602a148518aa 100644
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
@@ -2360,7 +2360,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
}

private Optional<LastSeenMessages> tryHandleChat(String message, Instant timestamp, LastSeenMessages.Update acknowledgment) {
- if (!this.updateChatOrder(timestamp)) {
+ if (!(top.leavesmc.leaves.LeavesConfig.disableCheckOutOfOrderCommand && message.startsWith("/")) && !this.updateChatOrder(timestamp)) { // Leaves - disable check to support Velocity
+ if (!top.leavesmc.leaves.LeavesConfig.disableCheckOutOfOrderCommand && !this.updateChatOrder(timestamp)) { // Leaves - disable check to support Velocity
ServerGamePacketListenerImpl.LOGGER.warn("{} sent out-of-order chat: '{}': {} > {}", this.player.getName().getString(), message, this.lastChatTimeStamp.get().getEpochSecond(), timestamp.getEpochSecond()); // Paper
this.server.scheduleOnMain(() -> { // Paper - push to main
this.disconnect(Component.translatable("multiplayer.disconnect.out_of_order_chat"), org.bukkit.event.player.PlayerKickEvent.Cause.OUT_OF_ORDER_CHAT); // Paper - kick event ca

0 comments on commit b2b36fa

Please sign in to comment.