Fix issue with kick event causes being passed improperly

This commit is contained in:
Shane Freeder 2024-01-18 19:35:56 +00:00
parent 3e20d3a275
commit f61ebdce91
No known key found for this signature in database
GPG key ID: A3F61EA5A085289C

View file

@ -5,7 +5,7 @@ Subject: [PATCH] Add PlayerKickEvent causes
diff --git a/src/main/java/net/minecraft/network/chat/SignedMessageChain.java b/src/main/java/net/minecraft/network/chat/SignedMessageChain.java diff --git a/src/main/java/net/minecraft/network/chat/SignedMessageChain.java b/src/main/java/net/minecraft/network/chat/SignedMessageChain.java
index 96814e626a95e4e3c2f4df1a0339d37bb02f2e61..85a8a687b1568a56e3e646b37ef78b562c1b8a82 100644 index 96814e626a95e4e3c2f4df1a0339d37bb02f2e61..22ead092ae984d1eaa052fe97981ce3c49b521d8 100644
--- a/src/main/java/net/minecraft/network/chat/SignedMessageChain.java --- a/src/main/java/net/minecraft/network/chat/SignedMessageChain.java
+++ b/src/main/java/net/minecraft/network/chat/SignedMessageChain.java +++ b/src/main/java/net/minecraft/network/chat/SignedMessageChain.java
@@ -35,16 +35,16 @@ public class SignedMessageChain { @@ -35,16 +35,16 @@ public class SignedMessageChain {
@ -16,10 +16,10 @@ index 96814e626a95e4e3c2f4df1a0339d37bb02f2e61..85a8a687b1568a56e3e646b37ef78b56
+ throw new SignedMessageChain.DecodeException(Component.translatable("chat.disabled.chain_broken"), false); // Paper - diff on change (if disconnects, need a new kick event cause) + throw new SignedMessageChain.DecodeException(Component.translatable("chat.disabled.chain_broken"), false); // Paper - diff on change (if disconnects, need a new kick event cause)
} else if (playerPublicKey.data().hasExpired()) { } else if (playerPublicKey.data().hasExpired()) {
- throw new SignedMessageChain.DecodeException(Component.translatable("chat.disabled.expiredProfileKey"), false); - throw new SignedMessageChain.DecodeException(Component.translatable("chat.disabled.expiredProfileKey"), false);
+ throw new SignedMessageChain.DecodeException(Component.translatable("chat.disabled.expiredProfileKey", org.bukkit.event.player.PlayerKickEvent.Cause.EXPIRED_PROFILE_PUBLIC_KEY), false); // Paper - kick event causes + throw new SignedMessageChain.DecodeException(Component.translatable("chat.disabled.expiredProfileKey"), false, org.bukkit.event.player.PlayerKickEvent.Cause.EXPIRED_PROFILE_PUBLIC_KEY); // Paper - kick event causes
} else if (body.timeStamp().isBefore(this.lastTimeStamp)) { } else if (body.timeStamp().isBefore(this.lastTimeStamp)) {
- throw new SignedMessageChain.DecodeException(Component.translatable("multiplayer.disconnect.out_of_order_chat"), true); - throw new SignedMessageChain.DecodeException(Component.translatable("multiplayer.disconnect.out_of_order_chat"), true);
+ throw new SignedMessageChain.DecodeException(Component.translatable("multiplayer.disconnect.out_of_order_chat", org.bukkit.event.player.PlayerKickEvent.Cause.OUT_OF_ORDER_CHAT), true); // Paper - kick event causes + throw new SignedMessageChain.DecodeException(Component.translatable("multiplayer.disconnect.out_of_order_chat"), true, org.bukkit.event.player.PlayerKickEvent.Cause.OUT_OF_ORDER_CHAT); // Paper - kick event causes
} else { } else {
this.lastTimeStamp = body.timeStamp(); this.lastTimeStamp = body.timeStamp();
PlayerChatMessage playerChatMessage = new PlayerChatMessage(signedMessageLink, signature, body, (Component)null, FilterMask.PASS_THROUGH); PlayerChatMessage playerChatMessage = new PlayerChatMessage(signedMessageLink, signature, body, (Component)null, FilterMask.PASS_THROUGH);