This commit is contained in:
Jake Potrebic 2022-08-05 15:58:34 -07:00 committed by GitHub
parent 02831e3369
commit bef2c9d005
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
56 changed files with 250 additions and 266 deletions

View file

@ -38,7 +38,7 @@ How To (Plugin Developers)
<dependency> <dependency>
<groupId>io.papermc.paper</groupId> <groupId>io.papermc.paper</groupId>
<artifactId>paper-api</artifactId> <artifactId>paper-api</artifactId>
<version>1.19.1-R0.1-SNAPSHOT</version> <version>1.19.2-R0.1-SNAPSHOT</version>
<scope>provided</scope> <scope>provided</scope>
</dependency> </dependency>
``` ```
@ -54,7 +54,7 @@ repositories {
} }
dependencies { dependencies {
compileOnly("io.papermc.paper:paper-api:1.19.1-R0.1-SNAPSHOT") compileOnly("io.papermc.paper:paper-api:1.19.2-R0.1-SNAPSHOT")
} }
java { java {

View file

@ -61,7 +61,7 @@ repositories {
} }
dependencies { dependencies {
paramMappings("net.fabricmc:yarn:1.19.1+build.1:mergedv2") paramMappings("net.fabricmc:yarn:1.19.2+build.1:mergedv2")
remapper("net.fabricmc:tiny-remapper:0.8.2:fat") remapper("net.fabricmc:tiny-remapper:0.8.2:fat")
decompiler("net.minecraftforge:forgeflower:1.5.605.7") decompiler("net.minecraftforge:forgeflower:1.5.605.7")
spigotDecompiler("io.papermc:patched-spigot-fernflower:0.1+build.6") spigotDecompiler("io.papermc:patched-spigot-fernflower:0.1+build.6")

View file

@ -1,6 +1,6 @@
group=io.papermc.paper group=io.papermc.paper
version=1.19.1-R0.1-SNAPSHOT version=1.19.2-R0.1-SNAPSHOT
mcVersion=1.19.1 mcVersion=1.19.2
org.gradle.caching=true org.gradle.caching=true
org.gradle.parallel=true org.gradle.parallel=true

View file

@ -114,7 +114,7 @@ index 0000000000000000000000000000000000000000..2c096b3ec6d77d824de974f9a6615916
+} +}
diff --git a/pom.xml b/pom.xml diff --git a/pom.xml b/pom.xml
deleted file mode 100644 deleted file mode 100644
index 847d05f335e393240d2bafea9949545b2dd53069..0000000000000000000000000000000000000000 index 3dc372008395cace32b28e2f08544d70f67e4511..0000000000000000000000000000000000000000
--- a/pom.xml --- a/pom.xml
+++ /dev/null +++ /dev/null
@@ -1,252 +0,0 @@ @@ -1,252 +0,0 @@
@ -125,7 +125,7 @@ index 847d05f335e393240d2bafea9949545b2dd53069..00000000000000000000000000000000
- -
- <groupId>org.spigotmc</groupId> - <groupId>org.spigotmc</groupId>
- <artifactId>spigot-api</artifactId> - <artifactId>spigot-api</artifactId>
- <version>1.19.1-R0.1-SNAPSHOT</version> - <version>1.19.2-R0.1-SNAPSHOT</version>
- <packaging>jar</packaging> - <packaging>jar</packaging>
- -
- <name>Spigot-API</name> - <name>Spigot-API</name>

View file

@ -172,7 +172,7 @@ index 0000000000000000000000000000000000000000..d10ff4a52c22033e2adb2a4e7f2cee98
+} +}
diff --git a/pom.xml b/pom.xml diff --git a/pom.xml b/pom.xml
deleted file mode 100644 deleted file mode 100644
index a0701510d9e24d734a3e321bd20afbed80e3909b..0000000000000000000000000000000000000000 index 82a2b163a8b660d0f65dd9eca6651c520b571cd2..0000000000000000000000000000000000000000
--- a/pom.xml --- a/pom.xml
+++ /dev/null +++ /dev/null
@@ -1,623 +0,0 @@ @@ -1,623 +0,0 @@
@ -182,7 +182,7 @@ index a0701510d9e24d734a3e321bd20afbed80e3909b..00000000000000000000000000000000
- <groupId>org.spigotmc</groupId> - <groupId>org.spigotmc</groupId>
- <artifactId>spigot</artifactId> - <artifactId>spigot</artifactId>
- <packaging>jar</packaging> - <packaging>jar</packaging>
- <version>1.19.1-R0.1-SNAPSHOT</version> - <version>1.19.2-R0.1-SNAPSHOT</version>
- <name>Spigot</name> - <name>Spigot</name>
- <url>https://www.spigotmc.org/</url> - <url>https://www.spigotmc.org/</url>
- -

View file

@ -1421,7 +1421,7 @@ index 98f2def9125d6faf5859572a004fa8d2fa066417..436f381c727cda72c04859c540dce471
public static ChatFormatting getById(int colorIndex) { public static ChatFormatting getById(int colorIndex) {
if (colorIndex < 0) { if (colorIndex < 0) {
diff --git a/src/main/java/net/minecraft/commands/arguments/MessageArgument.java b/src/main/java/net/minecraft/commands/arguments/MessageArgument.java diff --git a/src/main/java/net/minecraft/commands/arguments/MessageArgument.java b/src/main/java/net/minecraft/commands/arguments/MessageArgument.java
index 6f65ee8bb555dfbfa96363e0a4cf8aadfd92fde3..30a9ff0fd92a1de6c1bce46719549b7803d0c716 100644 index 83ffb7a08630fdaf8655569d82974625c0eaf1ff..4da1ebcd0226897f8b03bd00a851f793df3506f4 100644
--- a/src/main/java/net/minecraft/commands/arguments/MessageArgument.java --- a/src/main/java/net/minecraft/commands/arguments/MessageArgument.java
+++ b/src/main/java/net/minecraft/commands/arguments/MessageArgument.java +++ b/src/main/java/net/minecraft/commands/arguments/MessageArgument.java
@@ -88,7 +88,7 @@ public class MessageArgument implements SignedArgument<MessageArgument.Message> @@ -88,7 +88,7 @@ public class MessageArgument implements SignedArgument<MessageArgument.Message>
@ -1500,16 +1500,22 @@ index 021a26a6b1c258deffc26c035ab52a4ea027d9a1..00d432bd395e7f7fb6ee24e371818d13
try { try {
int i = friendlyByteBuf.writerIndex(); int i = friendlyByteBuf.writerIndex();
diff --git a/src/main/java/net/minecraft/network/chat/ChatDecorator.java b/src/main/java/net/minecraft/network/chat/ChatDecorator.java diff --git a/src/main/java/net/minecraft/network/chat/ChatDecorator.java b/src/main/java/net/minecraft/network/chat/ChatDecorator.java
index b9cdd89a3871d934a0449ed70766c2e9d6369ab9..52307bdaed93de1c3ddb06477b3a5b434a8f7a68 100644 index 0906160cb6b6b211ad50a29e5ab80ac99ac8b85b..1fbd30c52c2f1aa0594bd744ab4590709f5d34dd 100644
--- a/src/main/java/net/minecraft/network/chat/ChatDecorator.java --- a/src/main/java/net/minecraft/network/chat/ChatDecorator.java
+++ b/src/main/java/net/minecraft/network/chat/ChatDecorator.java +++ b/src/main/java/net/minecraft/network/chat/ChatDecorator.java
@@ -10,10 +10,81 @@ public interface ChatDecorator { @@ -10,12 +10,82 @@ public interface ChatDecorator {
return CompletableFuture.completedFuture(message); return CompletableFuture.completedFuture(message);
}; };
+ @io.papermc.paper.annotation.DoNotUse // Paper + @io.papermc.paper.annotation.DoNotUse // Paper
CompletableFuture<Component> decorate(@Nullable ServerPlayer sender, Component message); CompletableFuture<Component> decorate(@Nullable ServerPlayer sender, Component message);
+ @io.papermc.paper.annotation.DoNotUse // Paper
default CompletableFuture<PlayerChatMessage> decorate(@Nullable ServerPlayer sender, PlayerChatMessage message) {
- return message.signedContent().isDecorated() ? CompletableFuture.completedFuture(message) : this.decorate(sender, message.serverContent()).thenApply(message::withUnsignedContent);
+ return this.decorate(sender, null, message); // Paper
}
+ // Paper start + // Paper start
+ default CompletableFuture<Result> decorate(@Nullable ServerPlayer sender, @Nullable net.minecraft.commands.CommandSourceStack commandSourceStack, Component message, boolean isPreview) { + default CompletableFuture<Result> decorate(@Nullable ServerPlayer sender, @Nullable net.minecraft.commands.CommandSourceStack commandSourceStack, Component message, boolean isPreview) {
+ throw new UnsupportedOperationException("Must override this implementation"); + throw new UnsupportedOperationException("Must override this implementation");
@ -1576,16 +1582,11 @@ index b9cdd89a3871d934a0449ed70766c2e9d6369ab9..52307bdaed93de1c3ddb06477b3a5b43
+ return new PlayerChatMessage(playerChatMessage.signedHeader(), playerChatMessage.headerSignature(), playerChatMessage.signedBody().withContent(playerChatMessage.signedContent().withDecorationResult(result)), playerChatMessage.unsignedContent(), playerChatMessage.filterMask()).withUnsignedContent(result.component()); + return new PlayerChatMessage(playerChatMessage.signedHeader(), playerChatMessage.headerSignature(), playerChatMessage.signedBody().withContent(playerChatMessage.signedContent().withDecorationResult(result)), playerChatMessage.unsignedContent(), playerChatMessage.filterMask()).withUnsignedContent(result.component());
+ }); + });
+ } + }
+
+ // Paper end + // Paper end
+ +
+ @io.papermc.paper.annotation.DoNotUse // Paper static PlayerChatMessage attachIfNotDecorated(PlayerChatMessage message, Component attached) {
default CompletableFuture<PlayerChatMessage> decorate(@Nullable ServerPlayer serverPlayer, PlayerChatMessage playerChatMessage) { return !message.signedContent().isDecorated() ? message.withUnsignedContent(attached) : message;
- return playerChatMessage.signedContent().isDecorated() ? CompletableFuture.completedFuture(playerChatMessage) : this.decorate(serverPlayer, playerChatMessage.serverContent()).thenApply(playerChatMessage::withUnsignedContent);
+ return this.decorate(serverPlayer, null, playerChatMessage); // Paper
} }
static PlayerChatMessage attachIfNotDecorated(PlayerChatMessage playerChatMessage, Component component) {
diff --git a/src/main/java/net/minecraft/network/chat/ChatMessageContent.java b/src/main/java/net/minecraft/network/chat/ChatMessageContent.java diff --git a/src/main/java/net/minecraft/network/chat/ChatMessageContent.java b/src/main/java/net/minecraft/network/chat/ChatMessageContent.java
index b1c76ccfb4527337ac2c9ad2d2c7e34df0c4c660..e7caa6380b07f9bd34c2f8c821c0f6d3cb4e7649 100644 index b1c76ccfb4527337ac2c9ad2d2c7e34df0c4c660..e7caa6380b07f9bd34c2f8c821c0f6d3cb4e7649 100644
--- a/src/main/java/net/minecraft/network/chat/ChatMessageContent.java --- a/src/main/java/net/minecraft/network/chat/ChatMessageContent.java
@ -1690,53 +1691,54 @@ index 06736982f7625c1a532315afe94e5e0c45ec1331..e7d9e2d8c87ddf3658b1c2e0f2a3e98e
if (!ichatbasecomponent.getStyle().isEmpty()) { if (!ichatbasecomponent.getStyle().isEmpty()) {
diff --git a/src/main/java/net/minecraft/network/chat/OutgoingPlayerChatMessage.java b/src/main/java/net/minecraft/network/chat/OutgoingPlayerChatMessage.java diff --git a/src/main/java/net/minecraft/network/chat/OutgoingPlayerChatMessage.java b/src/main/java/net/minecraft/network/chat/OutgoingPlayerChatMessage.java
index 952dfc9ce81bc8ce2efb120884a5723145445f3c..fc43cc6f5bbb3485b9ddcc441a13399e57289586 100644 index de717cf25308bbade7b2c0a9187cf89238663636..bd82f0316df85b621c1970ff30bbbec0d2712ccd 100644
--- a/src/main/java/net/minecraft/network/chat/OutgoingPlayerChatMessage.java --- a/src/main/java/net/minecraft/network/chat/OutgoingPlayerChatMessage.java
+++ b/src/main/java/net/minecraft/network/chat/OutgoingPlayerChatMessage.java +++ b/src/main/java/net/minecraft/network/chat/OutgoingPlayerChatMessage.java
@@ -13,6 +13,11 @@ public interface OutgoingPlayerChatMessage { @@ -14,6 +14,12 @@ public interface OutgoingPlayerChatMessage {
Component serverContent();
void sendToPlayer(ServerPlayer sender, boolean filterMaskEnabled, ChatType.Bound params);
void sendToPlayer(ServerPlayer serverPlayer, boolean bl, ChatType.Bound bound);
+ // Paper start + // Paper start
+ default void sendToPlayer(ServerPlayer serverPlayer, boolean shouldFilter, ChatType.Bound bound, @javax.annotation.Nullable Component unsigned) { + default void sendToPlayer(ServerPlayer sender, boolean filterMaskEnabled, ChatType.Bound params, @javax.annotation.Nullable Component unsigned) {
+ this.sendToPlayer(serverPlayer, shouldFilter, bound); + this.sendToPlayer(sender, filterMaskEnabled, params);
+ } + }
+ // Paper end + // Paper end
+
void sendHeadersToRemainingPlayers(PlayerList playerManager); void sendHeadersToRemainingPlayers(PlayerList playerManager);
@@ -34,7 +39,15 @@ public interface OutgoingPlayerChatMessage { static OutgoingPlayerChatMessage create(PlayerChatMessage message) {
@@ -34,7 +40,15 @@ public interface OutgoingPlayerChatMessage {
@Override @Override
public void sendToPlayer(ServerPlayer serverPlayer, boolean bl, ChatType.Bound bound) { public void sendToPlayer(ServerPlayer sender, boolean filterMaskEnabled, ChatType.Bound params) {
+ // Paper start + // Paper start
+ this.sendToPlayer(serverPlayer, bl, bound, null); + this.sendToPlayer(sender, filterMaskEnabled, params, null);
+ } + }
+ +
+ @Override + @Override
+ public void sendToPlayer(ServerPlayer serverPlayer, boolean bl, ChatType.Bound bound, @javax.annotation.Nullable Component unsigned) { + public void sendToPlayer(ServerPlayer sender, boolean filterMaskEnabled, ChatType.Bound params, @javax.annotation.Nullable Component unsigned) {
+ // Paper end + // Paper end
PlayerChatMessage playerChatMessage = this.message.filter(bl); PlayerChatMessage playerChatMessage = this.message.filter(filterMaskEnabled);
+ playerChatMessage = unsigned != null ? playerChatMessage.withUnsignedContent(unsigned) : playerChatMessage; // Paper + playerChatMessage = unsigned != null ? playerChatMessage.withUnsignedContent(unsigned) : playerChatMessage; // Paper
if (!playerChatMessage.isFullyFiltered()) { if (!playerChatMessage.isFullyFiltered()) {
RegistryAccess registryAccess = serverPlayer.level.registryAccess(); RegistryAccess registryAccess = sender.level.registryAccess();
ChatType.BoundNetwork boundNetwork = bound.toNetwork(registryAccess); ChatType.BoundNetwork boundNetwork = params.toNetwork(registryAccess);
@@ -64,7 +77,15 @@ public interface OutgoingPlayerChatMessage { @@ -64,7 +78,15 @@ public interface OutgoingPlayerChatMessage {
@Override @Override
public void sendToPlayer(ServerPlayer serverPlayer, boolean bl, ChatType.Bound bound) { public void sendToPlayer(ServerPlayer sender, boolean filterMaskEnabled, ChatType.Bound params) {
+ // Paper start + // Paper start
+ this.sendToPlayer(serverPlayer, bl, bound, null); + this.sendToPlayer(sender, filterMaskEnabled, params, null);
+ } + }
+ +
+ @Override + @Override
+ public void sendToPlayer(ServerPlayer serverPlayer, boolean bl, ChatType.Bound bound, @javax.annotation.Nullable Component unsigned) { + public void sendToPlayer(ServerPlayer sender, boolean filterMaskEnabled, ChatType.Bound params, @javax.annotation.Nullable Component unsigned) {
+ // Paper end + // Paper end
PlayerChatMessage playerChatMessage = this.message.filter(bl); PlayerChatMessage playerChatMessage = this.message.filter(filterMaskEnabled);
+ playerChatMessage = unsigned != null ? playerChatMessage.withUnsignedContent(unsigned) : playerChatMessage; // Paper + playerChatMessage = unsigned != null ? playerChatMessage.withUnsignedContent(unsigned) : playerChatMessage; // Paper
if (!playerChatMessage.isFullyFiltered()) { if (!playerChatMessage.isFullyFiltered()) {
this.playersWithFullMessage.add(serverPlayer); this.playersWithFullMessage.add(sender);
RegistryAccess registryAccess = serverPlayer.level.registryAccess(); RegistryAccess registryAccess = sender.level.registryAccess();
diff --git a/src/main/java/net/minecraft/network/protocol/game/ClientboundSetActionBarTextPacket.java b/src/main/java/net/minecraft/network/protocol/game/ClientboundSetActionBarTextPacket.java diff --git a/src/main/java/net/minecraft/network/protocol/game/ClientboundSetActionBarTextPacket.java b/src/main/java/net/minecraft/network/protocol/game/ClientboundSetActionBarTextPacket.java
index 02183c810f9968621b9b20c1f7b54258b620c507..32ef3edebe94a2014168b7e438752a80b2687e5f 100644 index 02183c810f9968621b9b20c1f7b54258b620c507..32ef3edebe94a2014168b7e438752a80b2687e5f 100644
--- a/src/main/java/net/minecraft/network/protocol/game/ClientboundSetActionBarTextPacket.java --- a/src/main/java/net/minecraft/network/protocol/game/ClientboundSetActionBarTextPacket.java
@ -1954,7 +1956,7 @@ index 20a0a14f331ed891a64bd3ed69ade9cf2d917922..b9a6533afbfe07ff544f9f03f3c25489
} }
diff --git a/src/main/java/net/minecraft/server/level/ServerPlayer.java b/src/main/java/net/minecraft/server/level/ServerPlayer.java diff --git a/src/main/java/net/minecraft/server/level/ServerPlayer.java b/src/main/java/net/minecraft/server/level/ServerPlayer.java
index 4759a0eceeccf28b62cb8865b423235d47d07443..bee13e04481f57bf6778b66cd0bc2891e069547a 100644 index 84564ca128d2dfc79c0b5a13b699cf6fc80bdea7..9ab4588e4e512176b881ad4c252e400ff6ea97bd 100644
--- a/src/main/java/net/minecraft/server/level/ServerPlayer.java --- a/src/main/java/net/minecraft/server/level/ServerPlayer.java
+++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java +++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java
@@ -154,6 +154,7 @@ import net.minecraft.world.scores.Score; @@ -154,6 +154,7 @@ import net.minecraft.world.scores.Score;
@ -2011,15 +2013,15 @@ index 4759a0eceeccf28b62cb8865b423235d47d07443..bee13e04481f57bf6778b66cd0bc2891
@@ -1729,8 +1727,13 @@ public class ServerPlayer extends Player { @@ -1729,8 +1727,13 @@ public class ServerPlayer extends Player {
} }
public void sendChatMessage(OutgoingPlayerChatMessage message, boolean flag, ChatType.Bound chatmessagetype_a) { public void sendChatMessage(OutgoingPlayerChatMessage message, boolean filterMaskEnabled, ChatType.Bound params) {
+ // Paper start + // Paper start
+ this.sendChatMessage(message, flag, chatmessagetype_a, null); + this.sendChatMessage(message, filterMaskEnabled, params, null);
+ } + }
+ public void sendChatMessage(OutgoingPlayerChatMessage message, boolean flag, ChatType.Bound chatmessagetype_a, @Nullable Component unsigned) { + public void sendChatMessage(OutgoingPlayerChatMessage message, boolean filterMaskEnabled, ChatType.Bound params, @Nullable Component unsigned) {
+ // Paper end + // Paper end
if (this.acceptsChatMessages()) { if (this.acceptsChatMessages()) {
- message.sendToPlayer(this, flag, chatmessagetype_a); - message.sendToPlayer(this, filterMaskEnabled, params);
+ message.sendToPlayer(this, flag, chatmessagetype_a, unsigned); // Paper + message.sendToPlayer(this, filterMaskEnabled, params, unsigned); // Paper
} }
} }
@ -2043,7 +2045,7 @@ index 4759a0eceeccf28b62cb8865b423235d47d07443..bee13e04481f57bf6778b66cd0bc2891
// CraftBukkit end // CraftBukkit end
this.chatVisibility = packet.chatVisibility(); this.chatVisibility = packet.chatVisibility();
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
index 13f996d163739f419b701854b5248a02edfc93c0..0620ba3f5e26279e0165d86f589d73f423d633f0 100644 index 047f158fbd267e5ae570ec9bc0a9292a6a894968..b6436801ab2f10c68c8d6c529997223f84735a4e 100644
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java --- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
@@ -187,6 +187,8 @@ import org.apache.commons.lang3.StringUtils; @@ -187,6 +187,8 @@ import org.apache.commons.lang3.StringUtils;
@ -2161,8 +2163,8 @@ index 13f996d163739f419b701854b5248a02edfc93c0..0620ba3f5e26279e0165d86f589d73f4
+ return packet.signedPreview() && ichatbasecomponent != null ? new ChatMessageContent(packet.message(), ichatbasecomponent, result.decoratorResult()) : new ChatMessageContent(packet.message()); // Paper end + return packet.signedPreview() && ichatbasecomponent != null ? new ChatMessageContent(packet.message(), ichatbasecomponent, result.decoratorResult()) : new ChatMessageContent(packet.message()); // Paper end
} }
private void broadcastChatMessage(PlayerChatMessage playerchatmessage) { private void broadcastChatMessage(PlayerChatMessage message) {
@@ -2269,14 +2284,17 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic @@ -2277,14 +2292,17 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
private CompletableFuture<Component> queryChatPreview(String query) { private CompletableFuture<Component> queryChatPreview(String query) {
MutableComponent ichatmutablecomponent = Component.literal(query); MutableComponent ichatmutablecomponent = Component.literal(query);
@ -2184,7 +2186,7 @@ index 13f996d163739f419b701854b5248a02edfc93c0..0620ba3f5e26279e0165d86f589d73f4
} }
private CompletableFuture<Component> queryCommandPreview(String query) { private CompletableFuture<Component> queryCommandPreview(String query) {
@@ -2285,7 +2303,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic @@ -2293,7 +2311,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
CompletableFuture<Component> completablefuture = this.getPreviewedArgument(commandlistenerwrapper, PreviewableCommand.of(parseresults)); CompletableFuture<Component> completablefuture = this.getPreviewedArgument(commandlistenerwrapper, PreviewableCommand.of(parseresults));
completablefuture.thenAcceptAsync((ichatbasecomponent) -> { completablefuture.thenAcceptAsync((ichatbasecomponent) -> {
@ -2193,7 +2195,7 @@ index 13f996d163739f419b701854b5248a02edfc93c0..0620ba3f5e26279e0165d86f589d73f4
}, this.server); }, this.server);
return completablefuture; return completablefuture;
} }
@@ -3076,30 +3094,30 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic @@ -3084,30 +3102,30 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
return; return;
} }
@ -2232,10 +2234,10 @@ index 13f996d163739f419b701854b5248a02edfc93c0..0620ba3f5e26279e0165d86f589d73f4
} }
// CraftBukkit end // CraftBukkit end
diff --git a/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java diff --git a/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java
index fed3a8c5a23f3a7b279f209aaaab5f6ffa3f137c..5054c3208d1723a33a96d23edcbc9f1483b879e5 100644 index 4fe70fee37685c3011e8212d6d47fee19da87824..bcf189d0ae917b99fff62167740ddb0012082138 100644
--- a/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java --- a/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java
@@ -379,7 +379,7 @@ public class ServerLoginPacketListenerImpl implements TickablePacketListener, Se @@ -363,7 +363,7 @@ public class ServerLoginPacketListenerImpl implements TickablePacketListener, Se
if (PlayerPreLoginEvent.getHandlerList().getRegisteredListeners().length != 0) { if (PlayerPreLoginEvent.getHandlerList().getRegisteredListeners().length != 0) {
final PlayerPreLoginEvent event = new PlayerPreLoginEvent(playerName, address, uniqueId); final PlayerPreLoginEvent event = new PlayerPreLoginEvent(playerName, address, uniqueId);
if (asyncEvent.getResult() != PlayerPreLoginEvent.Result.ALLOWED) { if (asyncEvent.getResult() != PlayerPreLoginEvent.Result.ALLOWED) {
@ -2244,7 +2246,7 @@ index fed3a8c5a23f3a7b279f209aaaab5f6ffa3f137c..5054c3208d1723a33a96d23edcbc9f14
} }
Waitable<PlayerPreLoginEvent.Result> waitable = new Waitable<PlayerPreLoginEvent.Result>() { Waitable<PlayerPreLoginEvent.Result> waitable = new Waitable<PlayerPreLoginEvent.Result>() {
@Override @Override
@@ -390,12 +390,12 @@ public class ServerLoginPacketListenerImpl implements TickablePacketListener, Se @@ -374,12 +374,12 @@ public class ServerLoginPacketListenerImpl implements TickablePacketListener, Se
ServerLoginPacketListenerImpl.this.server.processQueue.add(waitable); ServerLoginPacketListenerImpl.this.server.processQueue.add(waitable);
if (waitable.get() != PlayerPreLoginEvent.Result.ALLOWED) { if (waitable.get() != PlayerPreLoginEvent.Result.ALLOWED) {
@ -2273,7 +2275,7 @@ index 3a587073dbe5e8a599d342c5f758d842b7b6cddb..a426adfba3fccf1815177e0b8065684c
@Override @Override
diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java
index ba6f4e9f74a524201390bd0e9106a6cf6afe0375..68ea3623dedefbc695bbb53e163911d3dfbfbf7e 100644 index 6987bee4bf2c1f3d47ffdd5329f6c0c63a2962a5..521f485366c65527ac3289dd27d8f2e311706a10 100644
--- a/src/main/java/net/minecraft/server/players/PlayerList.java --- a/src/main/java/net/minecraft/server/players/PlayerList.java
+++ b/src/main/java/net/minecraft/server/players/PlayerList.java +++ b/src/main/java/net/minecraft/server/players/PlayerList.java
@@ -8,6 +8,7 @@ import com.mojang.logging.LogUtils; @@ -8,6 +8,7 @@ import com.mojang.logging.LogUtils;
@ -2391,38 +2393,38 @@ index ba6f4e9f74a524201390bd0e9106a6cf6afe0375..68ea3623dedefbc695bbb53e163911d3
@@ -1169,14 +1169,25 @@ public abstract class PlayerList { @@ -1169,14 +1169,25 @@ public abstract class PlayerList {
} }
public void broadcastChatMessage(PlayerChatMessage playerchatmessage, ServerPlayer sender, ChatType.Bound params) { public void broadcastChatMessage(PlayerChatMessage message, ServerPlayer sender, ChatType.Bound params) {
+ // Paper start + // Paper start
+ this.broadcastChatMessage(playerchatmessage, sender, params, null); + this.broadcastChatMessage(message, sender, params, null);
+ } + }
+ public void broadcastChatMessage(PlayerChatMessage playerchatmessage, ServerPlayer sender, ChatType.Bound params, @Nullable Function<net.kyori.adventure.audience.Audience, Component> unsignedFunction) { + public void broadcastChatMessage(PlayerChatMessage message, ServerPlayer sender, ChatType.Bound params, @Nullable Function<net.kyori.adventure.audience.Audience, Component> unsignedFunction) {
+ // Paper end + // Paper end
Objects.requireNonNull(sender); Objects.requireNonNull(sender);
- this.broadcastChatMessage(playerchatmessage, sender::shouldFilterMessageTo, sender, sender.asChatSender(), params); - this.broadcastChatMessage(message, sender::shouldFilterMessageTo, sender, sender.asChatSender(), params);
+ this.broadcastChatMessage(playerchatmessage, sender::shouldFilterMessageTo, sender, sender.asChatSender(), params, unsignedFunction); // Paper + this.broadcastChatMessage(message, sender::shouldFilterMessageTo, sender, sender.asChatSender(), params, unsignedFunction); // Paper
} }
private void broadcastChatMessage(PlayerChatMessage playerchatmessage, Predicate<ServerPlayer> shouldSendFiltered, @Nullable ServerPlayer entityplayer, ChatSender chatsender, ChatType.Bound chatmessagetype_a) { private void broadcastChatMessage(PlayerChatMessage message, Predicate<ServerPlayer> shouldSendFiltered, @Nullable ServerPlayer sender, ChatSender sourceProfile, ChatType.Bound params) {
+ // Paper start + // Paper start
+ this.broadcastChatMessage(playerchatmessage, shouldSendFiltered, entityplayer, chatsender, chatmessagetype_a, null); + this.broadcastChatMessage(message, shouldSendFiltered, sender, sourceProfile, params, null);
+ } + }
+ +
+ private void broadcastChatMessage(PlayerChatMessage playerchatmessage, Predicate<ServerPlayer> shouldSendFiltered, @Nullable ServerPlayer entityplayer, ChatSender chatsender, ChatType.Bound chatmessagetype_a, @Nullable Function<net.kyori.adventure.audience.Audience, Component> unsignedFunction) { + private void broadcastChatMessage(PlayerChatMessage message, Predicate<ServerPlayer> shouldSendFiltered, @Nullable ServerPlayer sender, ChatSender sourceProfile, ChatType.Bound params, @Nullable Function<net.kyori.adventure.audience.Audience, Component> unsignedFunction) {
+ // Paper end + // Paper end
boolean flag = this.verifyChatTrusted(playerchatmessage, chatsender); boolean flag = this.verifyChatTrusted(message, sourceProfile);
- this.server.logChatMessage(playerchatmessage.serverContent(), chatmessagetype_a, flag ? null : "Not Secure"); - this.server.logChatMessage(message.serverContent(), params, flag ? null : "Not Secure");
+ this.server.logChatMessage((unsignedFunction == null ? playerchatmessage : playerchatmessage.withUnsignedContent(unsignedFunction.apply(this.server.console))).serverContent(), chatmessagetype_a, flag ? null : "Not Secure"); // Paper + this.server.logChatMessage((unsignedFunction == null ? message : message.withUnsignedContent(unsignedFunction.apply(this.server.console))).serverContent(), params, flag ? null : "Not Secure"); // Paper
OutgoingPlayerChatMessage outgoingplayerchatmessage = OutgoingPlayerChatMessage.create(playerchatmessage); OutgoingPlayerChatMessage outgoingplayerchatmessage = OutgoingPlayerChatMessage.create(message);
boolean flag1 = playerchatmessage.isFullyFiltered(); boolean flag1 = message.isFullyFiltered();
boolean flag2 = false; boolean flag2 = false;
@@ -1186,7 +1197,7 @@ public abstract class PlayerList { @@ -1186,7 +1197,7 @@ public abstract class PlayerList {
ServerPlayer entityplayer1 = (ServerPlayer) iterator.next(); ServerPlayer entityplayer1 = (ServerPlayer) iterator.next();
boolean flag3 = shouldSendFiltered.test(entityplayer1); boolean flag3 = shouldSendFiltered.test(entityplayer1);
- entityplayer1.sendChatMessage(outgoingplayerchatmessage, flag3, chatmessagetype_a); - entityplayer1.sendChatMessage(outgoingplayerchatmessage, flag3, params);
+ entityplayer1.sendChatMessage(outgoingplayerchatmessage, flag3, chatmessagetype_a, unsignedFunction == null ? null : unsignedFunction.apply(entityplayer1.getBukkitEntity())); + entityplayer1.sendChatMessage(outgoingplayerchatmessage, flag3, params, unsignedFunction == null ? null : unsignedFunction.apply(entityplayer1.getBukkitEntity())); // Paper
if (entityplayer != entityplayer1) { if (sender != entityplayer1) {
flag2 |= flag1 && flag3; flag2 |= flag1 && flag3;
} }
@@ -1213,7 +1224,7 @@ public abstract class PlayerList { @@ -1213,7 +1224,7 @@ public abstract class PlayerList {
@ -4386,7 +4388,7 @@ index 78ea79b66cc9e90402ef5cdc2e5e04e0c74b1c26..4fede2161792ba3e7cdf0cc5a1f53318
boolean hadFormat = false; boolean hadFormat = false;
diff --git a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java diff --git a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java
index 8c5165c449f740e51aad3f41405aaad1cfe5c657..a9a900f09b95d84b53adbe0405c322d36b6edad1 100644 index d805ac4274fb6149bf8efea6b771ecfe79aea76f..56a3dc9dcbd2229c60aa64e2d4c0ed147539a5ef 100644
--- a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java --- a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java
+++ b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java +++ b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java
@@ -69,6 +69,38 @@ public final class CraftMagicNumbers implements UnsafeValues { @@ -69,6 +69,38 @@ public final class CraftMagicNumbers implements UnsafeValues {

View file

@ -20,10 +20,10 @@ index 8834ed411a7db86b4d2b88183a1315317107d719..c45b5ab6776f3ac79f856c3a6467c510
static final ServerboundInteractPacket.Action ATTACK_ACTION = new ServerboundInteractPacket.Action() { static final ServerboundInteractPacket.Action ATTACK_ACTION = new ServerboundInteractPacket.Action() {
@Override @Override
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
index 101dde32d7ad708d4826f0dbf81263f07c31085b..ce3b68275ca399b5900012d5170e70fb35602695 100644 index 405e7a4b959bf288d6740ca6a789af4a137a2d8b..0c2cb67a037c40ac1abef36ce315c56b58370987 100644
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java --- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
@@ -2619,8 +2619,37 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic @@ -2627,8 +2627,37 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
}); });
} }
} }

View file

@ -5,10 +5,10 @@ Subject: [PATCH] Cache user authenticator threads
diff --git a/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java diff --git a/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java
index 5054c3208d1723a33a96d23edcbc9f1483b879e5..72bc5648706380639440456fc938d9350e12f1cc 100644 index bcf189d0ae917b99fff62167740ddb0012082138..6e315a2e87bbc4b03e4e0f38ba0b0f6b592a433e 100644
--- a/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java --- a/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java
@@ -122,6 +122,18 @@ public class ServerLoginPacketListenerImpl implements TickablePacketListener, Se @@ -118,6 +118,18 @@ public class ServerLoginPacketListenerImpl implements TickablePacketListener, Se
} }
@ -27,7 +27,7 @@ index 5054c3208d1723a33a96d23edcbc9f1483b879e5..72bc5648706380639440456fc938d935
// Spigot start // Spigot start
public void initUUID() public void initUUID()
{ {
@@ -258,8 +270,8 @@ public class ServerLoginPacketListenerImpl implements TickablePacketListener, Se @@ -242,8 +254,8 @@ public class ServerLoginPacketListenerImpl implements TickablePacketListener, Se
this.connection.send(new ClientboundHelloPacket("", this.server.getKeyPair().getPublic().getEncoded(), this.nonce)); this.connection.send(new ClientboundHelloPacket("", this.server.getKeyPair().getPublic().getEncoded(), this.nonce));
} else { } else {
// Spigot start // Spigot start
@ -38,7 +38,7 @@ index 5054c3208d1723a33a96d23edcbc9f1483b879e5..72bc5648706380639440456fc938d935
@Override @Override
public void run() { public void run() {
try { try {
@@ -270,7 +282,8 @@ public class ServerLoginPacketListenerImpl implements TickablePacketListener, Se @@ -254,7 +266,8 @@ public class ServerLoginPacketListenerImpl implements TickablePacketListener, Se
server.server.getLogger().log(java.util.logging.Level.WARNING, "Exception verifying " + ServerLoginPacketListenerImpl.this.gameProfile.getName(), ex); server.server.getLogger().log(java.util.logging.Level.WARNING, "Exception verifying " + ServerLoginPacketListenerImpl.this.gameProfile.getName(), ex);
} }
} }
@ -48,7 +48,7 @@ index 5054c3208d1723a33a96d23edcbc9f1483b879e5..72bc5648706380639440456fc938d935
// Spigot end // Spigot end
} }
@@ -313,7 +326,8 @@ public class ServerLoginPacketListenerImpl implements TickablePacketListener, Se @@ -297,7 +310,8 @@ public class ServerLoginPacketListenerImpl implements TickablePacketListener, Se
throw new IllegalStateException("Protocol error", cryptographyexception); throw new IllegalStateException("Protocol error", cryptographyexception);
} }
@ -58,7 +58,7 @@ index 5054c3208d1723a33a96d23edcbc9f1483b879e5..72bc5648706380639440456fc938d935
public void run() { public void run() {
GameProfile gameprofile = ServerLoginPacketListenerImpl.this.gameProfile; GameProfile gameprofile = ServerLoginPacketListenerImpl.this.gameProfile;
@@ -358,10 +372,8 @@ public class ServerLoginPacketListenerImpl implements TickablePacketListener, Se @@ -342,10 +356,8 @@ public class ServerLoginPacketListenerImpl implements TickablePacketListener, Se
return ServerLoginPacketListenerImpl.this.server.getPreventProxyConnections() && socketaddress instanceof InetSocketAddress ? ((InetSocketAddress) socketaddress).getAddress() : null; return ServerLoginPacketListenerImpl.this.server.getPreventProxyConnections() && socketaddress instanceof InetSocketAddress ? ((InetSocketAddress) socketaddress).getAddress() : null;
} }

View file

@ -6,7 +6,7 @@ Subject: [PATCH] Properly fix item duplication bug
Credit to prplz for figuring out the real issue Credit to prplz for figuring out the real issue
diff --git a/src/main/java/net/minecraft/server/level/ServerPlayer.java b/src/main/java/net/minecraft/server/level/ServerPlayer.java diff --git a/src/main/java/net/minecraft/server/level/ServerPlayer.java b/src/main/java/net/minecraft/server/level/ServerPlayer.java
index 9cd5bf2890fbb0bdb8eb79b1659fe7058dbe08e9..b239654eb92f95cb855cd3d750c79f98893f9980 100644 index 5b568d8f3f2e8bd466ac1edae9cafc602a226175..69dc4063ae0a3e7271ce0e4ca79c0b059de24bc8 100644
--- a/src/main/java/net/minecraft/server/level/ServerPlayer.java --- a/src/main/java/net/minecraft/server/level/ServerPlayer.java
+++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java +++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java
@@ -2194,7 +2194,7 @@ public class ServerPlayer extends Player { @@ -2194,7 +2194,7 @@ public class ServerPlayer extends Player {
@ -19,10 +19,10 @@ index 9cd5bf2890fbb0bdb8eb79b1659fe7058dbe08e9..b239654eb92f95cb855cd3d750c79f98
@Override @Override
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
index 26e10d245adbac49f9c30ada74729444fe0fedaf..21e1520e30a4655c679b3f3b4f8f8e053f245aca 100644 index a991d961145c6b86df482dbf029bc8e1d3c9e209..6e041f695f060ca79dcc26d56273afcf79d725f5 100644
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java --- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
@@ -3258,7 +3258,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic @@ -3266,7 +3266,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
} }
public final boolean isDisconnected() { public final boolean isDisconnected() {

View file

@ -11,10 +11,10 @@ I suspect Mojang may switch to this behavior before full release.
To be converted into a Paper-API event at some point in the future? To be converted into a Paper-API event at some point in the future?
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
index 21e1520e30a4655c679b3f3b4f8f8e053f245aca..7a55caac4bf216484780e243ae2b58798ceea520 100644 index 6e041f695f060ca79dcc26d56273afcf79d725f5..b3bdff6de8ad38bdb75b19a7dc70888234a39153 100644
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java --- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
@@ -2444,6 +2444,13 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic @@ -2452,6 +2452,13 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
switch (packet.getAction()) { switch (packet.getAction()) {
case PRESS_SHIFT_KEY: case PRESS_SHIFT_KEY:
this.player.setShiftKeyDown(true); this.player.setShiftKeyDown(true);

View file

@ -598,24 +598,6 @@ index a48a12a31a3d09a9373b688dcc093035f8f8a300..97b29bcb20e199c2d02457f8025e67e2
// CraftBukkit start // CraftBukkit start
String s = (String) Optional.ofNullable((String) optionset.valueOf("world")).orElse(dedicatedserversettings.getProperties().levelName); String s = (String) Optional.ofNullable((String) optionset.valueOf("world")).orElse(dedicatedserversettings.getProperties().levelName);
LevelStorageSource convertable = LevelStorageSource.createDefault(file.toPath()); LevelStorageSource convertable = LevelStorageSource.createDefault(file.toPath());
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
index dc18cc9818fef3e7193a22353aea957a47dbbdb5..ae676b46937f821e358ca4176b162bbca7048e62 100644
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
@@ -1989,6 +1989,13 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
}
private boolean tryHandleChat(String message, Instant timestamp, LastSeenMessages.Update acknowledgment) {
+ // Paper start
+ final ProfilePublicKey key = this.player.getProfilePublicKey();
+ if (key != null && key.data().hasExpired()) {
+ this.disconnect(Component.translatable("multiplayer.disconnect.missing_public_key"), org.bukkit.event.player.PlayerKickEvent.Cause.CHAT_VALIDATION_FAILED);
+ return false;
+ }
+ // Paper end
if (!this.updateChatOrder(timestamp)) {
ServerGamePacketListenerImpl.LOGGER.warn("{} sent out-of-order chat: '{}'", this.player.getName().getString(), message);
this.disconnect(Component.translatable("multiplayer.disconnect.out_of_order_chat"));
diff --git a/src/main/java/net/minecraft/server/players/GameProfileCache.java b/src/main/java/net/minecraft/server/players/GameProfileCache.java diff --git a/src/main/java/net/minecraft/server/players/GameProfileCache.java b/src/main/java/net/minecraft/server/players/GameProfileCache.java
index 2a0cf0a8a79c09566c598197fc6f8c447d4bbd72..5e3bc0590e59770490b1c6c818d99be054214a8a 100644 index 2a0cf0a8a79c09566c598197fc6f8c447d4bbd72..5e3bc0590e59770490b1c6c818d99be054214a8a 100644
--- a/src/main/java/net/minecraft/server/players/GameProfileCache.java --- a/src/main/java/net/minecraft/server/players/GameProfileCache.java

View file

@ -5,10 +5,10 @@ Subject: [PATCH] Block player logins during server shutdown
diff --git a/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java diff --git a/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java
index 72bc5648706380639440456fc938d9350e12f1cc..fcdd6c954552cf0b7eb914d34b94de248010765b 100644 index 6e315a2e87bbc4b03e4e0f38ba0b0f6b592a433e..a00636626e2ef2975a3506fd6cfb7e4444d41e3f 100644
--- a/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java --- a/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java
@@ -81,6 +81,12 @@ public class ServerLoginPacketListenerImpl implements TickablePacketListener, Se @@ -77,6 +77,12 @@ public class ServerLoginPacketListenerImpl implements TickablePacketListener, Se
@Override @Override
public void tick() { public void tick() {

View file

@ -6,10 +6,10 @@ Subject: [PATCH] Allow specifying a custom "authentication servers down" kick
diff --git a/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java diff --git a/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java
index fcdd6c954552cf0b7eb914d34b94de248010765b..6a0cd6763202a0a0e301a3a64f09f8cc60aa6b1d 100644 index a00636626e2ef2975a3506fd6cfb7e4444d41e3f..552b7d612d0f833f3280a2a60839e2ef93b59271 100644
--- a/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java --- a/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java
@@ -360,7 +360,7 @@ public class ServerLoginPacketListenerImpl implements TickablePacketListener, Se @@ -344,7 +344,7 @@ public class ServerLoginPacketListenerImpl implements TickablePacketListener, Se
ServerLoginPacketListenerImpl.this.gameProfile = gameprofile; ServerLoginPacketListenerImpl.this.gameProfile = gameprofile;
ServerLoginPacketListenerImpl.this.state = ServerLoginPacketListenerImpl.State.READY_TO_ACCEPT; ServerLoginPacketListenerImpl.this.state = ServerLoginPacketListenerImpl.State.READY_TO_ACCEPT;
} else { } else {

View file

@ -15,10 +15,10 @@ also adding some additional logging in order to help work out what is causing
random disconnections for clients. random disconnections for clients.
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
index c61d51360f610e15c4cefa62b74d267646fe9c0c..e288e1dafa9fa4b485e3dc985d5764e9a0050f51 100644 index 796c40afe5e9853bba2c23dbd2136e969c78f7cd..11b409b97529afe837a63620807958dbf602cf4e 100644
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java --- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
@@ -3224,14 +3224,18 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic @@ -3225,14 +3225,18 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
@Override @Override
public void handleKeepAlive(ServerboundKeepAlivePacket packet) { public void handleKeepAlive(ServerboundKeepAlivePacket packet) {

View file

@ -6,10 +6,10 @@ Subject: [PATCH] Prevent logins from being processed when the player has
diff --git a/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java diff --git a/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java
index 6a0cd6763202a0a0e301a3a64f09f8cc60aa6b1d..85f2c4673b18126dce748051a20ababc6cbbf221 100644 index 552b7d612d0f833f3280a2a60839e2ef93b59271..158862d2ea50a34dea10e074f3776bc5ed5a327f 100644
--- a/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java --- a/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java
@@ -88,7 +88,11 @@ public class ServerLoginPacketListenerImpl implements TickablePacketListener, Se @@ -84,7 +84,11 @@ public class ServerLoginPacketListenerImpl implements TickablePacketListener, Se
} }
// Paper end // Paper end
if (this.state == ServerLoginPacketListenerImpl.State.READY_TO_ACCEPT) { if (this.state == ServerLoginPacketListenerImpl.State.READY_TO_ACCEPT) {

View file

@ -6,10 +6,10 @@ Subject: [PATCH] Ability to change PlayerProfile in AsyncPreLoginEvent
This will allow you to change the players name or skin on login. This will allow you to change the players name or skin on login.
diff --git a/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java diff --git a/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java
index 85f2c4673b18126dce748051a20ababc6cbbf221..681c4dddac4ffc5997f3ea92befaeafc36da99c4 100644 index 158862d2ea50a34dea10e074f3776bc5ed5a327f..fa949d01da7b6c1a489d17955108f7082f959c66 100644
--- a/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java --- a/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java
@@ -395,8 +395,16 @@ public class ServerLoginPacketListenerImpl implements TickablePacketListener, Se @@ -379,8 +379,16 @@ public class ServerLoginPacketListenerImpl implements TickablePacketListener, Se
java.util.UUID uniqueId = ServerLoginPacketListenerImpl.this.gameProfile.getId(); java.util.UUID uniqueId = ServerLoginPacketListenerImpl.this.gameProfile.getId();
final org.bukkit.craftbukkit.CraftServer server = ServerLoginPacketListenerImpl.this.server.server; final org.bukkit.craftbukkit.CraftServer server = ServerLoginPacketListenerImpl.this.server.server;

View file

@ -6,10 +6,10 @@ Subject: [PATCH] Player.setPlayerProfile API
This can be useful for changing name or skins after a player has logged in. This can be useful for changing name or skins after a player has logged in.
diff --git a/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java diff --git a/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java
index 681c4dddac4ffc5997f3ea92befaeafc36da99c4..7c3c76b7ef169e0c0832e26212775111deb505c0 100644 index fa949d01da7b6c1a489d17955108f7082f959c66..c83395364edb4f2ba8515326b19c4f1a436a0502 100644
--- a/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java --- a/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java
@@ -396,11 +396,11 @@ public class ServerLoginPacketListenerImpl implements TickablePacketListener, Se @@ -380,11 +380,11 @@ public class ServerLoginPacketListenerImpl implements TickablePacketListener, Se
final org.bukkit.craftbukkit.CraftServer server = ServerLoginPacketListenerImpl.this.server.server; final org.bukkit.craftbukkit.CraftServer server = ServerLoginPacketListenerImpl.this.server.server;
// Paper start // Paper start
@ -24,7 +24,7 @@ index 681c4dddac4ffc5997f3ea92befaeafc36da99c4..7c3c76b7ef169e0c0832e26212775111
playerName = gameProfile.getName(); playerName = gameProfile.getName();
uniqueId = gameProfile.getId(); uniqueId = gameProfile.getId();
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
index d1271b9c31502407dfeaf8eb47b73f515bf6c0fd..32554bad10cccec164bc36063333244344c16473 100644 index c5164abae83cf6b0535d72c78adff5b72bc6f22e..63327bb4a57dea10f421bff15664ffa57c56cf65 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
@@ -75,6 +75,7 @@ import net.minecraft.world.entity.ai.attributes.Attributes; @@ -75,6 +75,7 @@ import net.minecraft.world.entity.ai.attributes.Attributes;

View file

@ -5,10 +5,10 @@ Subject: [PATCH] Fix exploit that allowed colored signs to be created
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
index 23c229d807cb039edb814433e3761a06396fd579..e0a770839b5567718382a97a6007b6b1e2d5a035 100644 index a9c52b6759aa1f17ecc4c365892c48d8e80c3fe3..9e0905b5cd2648f606276fa4408301e08aa0bc62 100644
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java --- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
@@ -3238,9 +3238,9 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic @@ -3239,9 +3239,9 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
FilteredText filteredtext = (FilteredText) signText.get(i); FilteredText filteredtext = (FilteredText) signText.get(i);
if (this.player.isTextFilteringEnabled()) { if (this.player.isTextFilteringEnabled()) {

View file

@ -29,7 +29,7 @@ index 3d3926a14229d922fb7b7e76c9babb031bf7d9ab..5029436157fe7279a2a583f06b7d02a0
} }
// Spigot End // Spigot End
diff --git a/src/main/java/net/minecraft/server/level/ServerPlayer.java b/src/main/java/net/minecraft/server/level/ServerPlayer.java diff --git a/src/main/java/net/minecraft/server/level/ServerPlayer.java b/src/main/java/net/minecraft/server/level/ServerPlayer.java
index 73de8e676a68fa77301ad0417d86bcc7dc0c47e4..367546d6ebaf6227b097f3afb2e57a2f596a69ee 100644 index 4eb69b62b4c3f568cad83fdc4b19cbde2c588be7..35a6dd9cfed631f66e31c71911433ec880711905 100644
--- a/src/main/java/net/minecraft/server/level/ServerPlayer.java --- a/src/main/java/net/minecraft/server/level/ServerPlayer.java
+++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java +++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java
@@ -610,7 +610,7 @@ public class ServerPlayer extends Player { @@ -610,7 +610,7 @@ public class ServerPlayer extends Player {
@ -75,7 +75,7 @@ index 73de8e676a68fa77301ad0417d86bcc7dc0c47e4..367546d6ebaf6227b097f3afb2e57a2f
this.doCloseContainer(); this.doCloseContainer();
} }
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
index e0a770839b5567718382a97a6007b6b1e2d5a035..de79397e763edc36333b1f57508228bd4b2e1dab 100644 index 9e0905b5cd2648f606276fa4408301e08aa0bc62..6f5ee7d4645eb5f5d3235c8b6fe8da476aa371e4 100644
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java --- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
@@ -216,6 +216,7 @@ import org.bukkit.event.inventory.ClickType; @@ -216,6 +216,7 @@ import org.bukkit.event.inventory.ClickType;
@ -86,7 +86,7 @@ index e0a770839b5567718382a97a6007b6b1e2d5a035..de79397e763edc36333b1f57508228bd
import org.bukkit.event.inventory.InventoryCreativeEvent; import org.bukkit.event.inventory.InventoryCreativeEvent;
import org.bukkit.event.inventory.InventoryType.SlotType; import org.bukkit.event.inventory.InventoryType.SlotType;
import org.bukkit.event.inventory.SmithItemEvent; import org.bukkit.event.inventory.SmithItemEvent;
@@ -2764,10 +2765,15 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic @@ -2765,10 +2766,15 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
@Override @Override
public void handleContainerClose(ServerboundContainerClosePacket packet) { public void handleContainerClose(ServerboundContainerClosePacket packet) {
@ -104,7 +104,7 @@ index e0a770839b5567718382a97a6007b6b1e2d5a035..de79397e763edc36333b1f57508228bd
this.player.doCloseContainer(); this.player.doCloseContainer();
} }
diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java
index 8a626d55e4516d6c918ea49425a8f985bf3f956e..b2d023c7c3f595b46c386831131cc9c3b91705d8 100644 index 8d46d3a77fa9717075dcfef44a42948c2f274182..04a41c3ab90fcdfaedb1646137fb5dde12a9331b 100644
--- a/src/main/java/net/minecraft/server/players/PlayerList.java --- a/src/main/java/net/minecraft/server/players/PlayerList.java
+++ b/src/main/java/net/minecraft/server/players/PlayerList.java +++ b/src/main/java/net/minecraft/server/players/PlayerList.java
@@ -507,7 +507,7 @@ public abstract class PlayerList { @@ -507,7 +507,7 @@ public abstract class PlayerList {

View file

@ -16,10 +16,10 @@ Refresh the player inventory when PlayerInteractEntityEvent is
cancelled to avoid this problem. cancelled to avoid this problem.
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
index de79397e763edc36333b1f57508228bd4b2e1dab..8f9cfa9b42a0ccbf325b4c031a85ff1ae82ab42d 100644 index 6f5ee7d4645eb5f5d3235c8b6fe8da476aa371e4..bc4a9c972c04114f1dc37d1789fccd2e05d46d58 100644
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java --- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
@@ -2649,6 +2649,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic @@ -2650,6 +2650,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
} }
if (event.isCancelled()) { if (event.isCancelled()) {

View file

@ -88,10 +88,10 @@ index 0000000000000000000000000000000000000000..980e2b4dc308adf9a6cb2596b28eaeee
+ } + }
+} +}
diff --git a/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java diff --git a/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java
index 7c3c76b7ef169e0c0832e26212775111deb505c0..63abdc84bbd8d3ef78e18ffe792f2f1e5035e2ff 100644 index c83395364edb4f2ba8515326b19c4f1a436a0502..6629fee181b8d0c6ece3d23a028b971e98f8799b 100644
--- a/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java --- a/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java
@@ -70,6 +70,7 @@ public class ServerLoginPacketListenerImpl implements TickablePacketListener, Se @@ -66,6 +66,7 @@ public class ServerLoginPacketListenerImpl implements TickablePacketListener, Se
@Nullable @Nullable
private ProfilePublicKey.Data profilePublicKeyData; private ProfilePublicKey.Data profilePublicKeyData;
public String hostname = ""; // CraftBukkit - add field public String hostname = ""; // CraftBukkit - add field
@ -99,7 +99,7 @@ index 7c3c76b7ef169e0c0832e26212775111deb505c0..63abdc84bbd8d3ef78e18ffe792f2f1e
public ServerLoginPacketListenerImpl(MinecraftServer server, Connection connection) { public ServerLoginPacketListenerImpl(MinecraftServer server, Connection connection) {
this.state = ServerLoginPacketListenerImpl.State.HELLO; this.state = ServerLoginPacketListenerImpl.State.HELLO;
@@ -279,6 +280,16 @@ public class ServerLoginPacketListenerImpl implements TickablePacketListener, Se @@ -263,6 +264,16 @@ public class ServerLoginPacketListenerImpl implements TickablePacketListener, Se
this.state = ServerLoginPacketListenerImpl.State.KEY; this.state = ServerLoginPacketListenerImpl.State.KEY;
this.connection.send(new ClientboundHelloPacket("", this.server.getKeyPair().getPublic().getEncoded(), this.nonce)); this.connection.send(new ClientboundHelloPacket("", this.server.getKeyPair().getPublic().getEncoded(), this.nonce));
} else { } else {
@ -116,7 +116,7 @@ index 7c3c76b7ef169e0c0832e26212775111deb505c0..63abdc84bbd8d3ef78e18ffe792f2f1e
// Spigot start // Spigot start
// Paper start - Cache authenticator threads // Paper start - Cache authenticator threads
authenticatorPool.execute(new Runnable() { authenticatorPool.execute(new Runnable() {
@@ -390,6 +401,12 @@ public class ServerLoginPacketListenerImpl implements TickablePacketListener, Se @@ -374,6 +385,12 @@ public class ServerLoginPacketListenerImpl implements TickablePacketListener, Se
public class LoginHandler { public class LoginHandler {
public void fireEvents() throws Exception { public void fireEvents() throws Exception {
@ -129,7 +129,7 @@ index 7c3c76b7ef169e0c0832e26212775111deb505c0..63abdc84bbd8d3ef78e18ffe792f2f1e
String playerName = ServerLoginPacketListenerImpl.this.gameProfile.getName(); String playerName = ServerLoginPacketListenerImpl.this.gameProfile.getName();
java.net.InetAddress address = ((java.net.InetSocketAddress) ServerLoginPacketListenerImpl.this.connection.getRemoteAddress()).getAddress(); java.net.InetAddress address = ((java.net.InetSocketAddress) ServerLoginPacketListenerImpl.this.connection.getRemoteAddress()).getAddress();
java.util.UUID uniqueId = ServerLoginPacketListenerImpl.this.gameProfile.getId(); java.util.UUID uniqueId = ServerLoginPacketListenerImpl.this.gameProfile.getId();
@@ -437,6 +454,59 @@ public class ServerLoginPacketListenerImpl implements TickablePacketListener, Se @@ -421,6 +438,59 @@ public class ServerLoginPacketListenerImpl implements TickablePacketListener, Se
// Spigot end // Spigot end
public void handleCustomQueryPacket(ServerboundCustomQueryPacket packet) { public void handleCustomQueryPacket(ServerboundCustomQueryPacket packet) {
@ -166,9 +166,9 @@ index 7c3c76b7ef169e0c0832e26212775111deb505c0..63abdc84bbd8d3ef78e18ffe792f2f1e
+ final ProfilePublicKey.Data forwardedKey = com.destroystokyo.paper.proxy.VelocityProxy.readForwardedKey(buf); + final ProfilePublicKey.Data forwardedKey = com.destroystokyo.paper.proxy.VelocityProxy.readForwardedKey(buf);
+ if (this.profilePublicKeyData == null) { + if (this.profilePublicKeyData == null) {
+ try { + try {
+ ProfilePublicKey.createValidated(this.server.getServiceSignatureValidator(), this.gameProfile.getId(), forwardedKey); + ProfilePublicKey.createValidated(this.server.getServiceSignatureValidator(), this.gameProfile.getId(), forwardedKey, Duration.ZERO);
+ this.profilePublicKeyData = forwardedKey; + this.profilePublicKeyData = forwardedKey;
+ } catch (CryptException e) { + } catch (ProfilePublicKey.ValidationException e) {
+ this.disconnect("Unable to validate forwarded player key"); + this.disconnect("Unable to validate forwarded player key");
+ } + }
+ } + }

View file

@ -22,7 +22,7 @@ it only impacts data sent from the client.
Set -DPaper.maxSignLength=XX to change limit or -1 to disable Set -DPaper.maxSignLength=XX to change limit or -1 to disable
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
index 4f9adc601ccc84beaee91a6ca9d6cd2740c4416e..b7425dce2bd65716896bd37477514faa2ceb68e8 100644 index 81c6dd957eb990708fd5f6a1b991a5e8370acf80..933d74f48dfedc15eec76b4e376e51c40bc4bea5 100644
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java --- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
@@ -293,6 +293,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic @@ -293,6 +293,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
@ -33,7 +33,7 @@ index 4f9adc601ccc84beaee91a6ca9d6cd2740c4416e..b7425dce2bd65716896bd37477514faa
public ServerGamePacketListenerImpl(MinecraftServer server, Connection connection, ServerPlayer player) { public ServerGamePacketListenerImpl(MinecraftServer server, Connection connection, ServerPlayer player) {
this.lastChatTimeStamp = new AtomicReference(Instant.EPOCH); this.lastChatTimeStamp = new AtomicReference(Instant.EPOCH);
@@ -3285,7 +3286,19 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic @@ -3286,7 +3287,19 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
@Override @Override
public void handleSignUpdate(ServerboundSignUpdatePacket packet) { public void handleSignUpdate(ServerboundSignUpdatePacket packet) {

View file

@ -28,7 +28,7 @@ and then catch exceptions and close if they fire.
Part of this commit was authored by: Spottedleaf Part of this commit was authored by: Spottedleaf
diff --git a/src/main/java/net/minecraft/network/Connection.java b/src/main/java/net/minecraft/network/Connection.java diff --git a/src/main/java/net/minecraft/network/Connection.java b/src/main/java/net/minecraft/network/Connection.java
index f6162d65d341ef3df1a9b3f45d7d0c25d52f35cf..2d1db70456b746c8fab77893cb34240e573b92ca 100644 index 527acbc15f3fe30541eef555480e158ab83a6130..31d35af5d0efbd0bd8528c3f05e660a203e67ac9 100644
--- a/src/main/java/net/minecraft/network/Connection.java --- a/src/main/java/net/minecraft/network/Connection.java
+++ b/src/main/java/net/minecraft/network/Connection.java +++ b/src/main/java/net/minecraft/network/Connection.java
@@ -93,6 +93,10 @@ public class Connection extends SimpleChannelInboundHandler<Packet<?>> { @@ -93,6 +93,10 @@ public class Connection extends SimpleChannelInboundHandler<Packet<?>> {
@ -105,7 +105,7 @@ index f6162d65d341ef3df1a9b3f45d7d0c25d52f35cf..2d1db70456b746c8fab77893cb34240e
this.send(packet, (PacketSendListener) null); this.send(packet, (PacketSendListener) null);
} }
public void send(Packet<?> packet, @Nullable PacketSendListener packetsendlistener) { public void send(Packet<?> packet, @Nullable PacketSendListener callbacks) {
- if (this.isConnected()) { - if (this.isConnected()) {
- this.flushQueue(); - this.flushQueue();
+ // Paper start - handle oversized packets better + // Paper start - handle oversized packets better
@ -118,16 +118,16 @@ index f6162d65d341ef3df1a9b3f45d7d0c25d52f35cf..2d1db70456b746c8fab77893cb34240e
+ net.minecraft.server.MCUtil.isMainThread() && packet.isReady() && this.queue.isEmpty() && + net.minecraft.server.MCUtil.isMainThread() && packet.isReady() && this.queue.isEmpty() &&
+ (packet.getExtraPackets() == null || packet.getExtraPackets().isEmpty()) + (packet.getExtraPackets() == null || packet.getExtraPackets().isEmpty())
+ ))) { + ))) {
this.sendPacket(packet, packetsendlistener); this.sendPacket(packet, callbacks);
- } else { - } else {
- this.queue.add(new Connection.PacketHolder(packet, packetsendlistener)); - this.queue.add(new Connection.PacketHolder(packet, callbacks));
+ return; + return;
} }
+ // write the packets to the queue, then flush - antixray hooks there already + // write the packets to the queue, then flush - antixray hooks there already
+ java.util.List<Packet> extraPackets = InnerUtil.buildExtraPackets(packet); + java.util.List<Packet> extraPackets = InnerUtil.buildExtraPackets(packet);
+ boolean hasExtraPackets = extraPackets != null && !extraPackets.isEmpty(); + boolean hasExtraPackets = extraPackets != null && !extraPackets.isEmpty();
+ if (!hasExtraPackets) { + if (!hasExtraPackets) {
+ this.queue.add(new Connection.PacketHolder(packet, packetsendlistener)); + this.queue.add(new Connection.PacketHolder(packet, callbacks));
+ } else { + } else {
+ java.util.List<Connection.PacketHolder> packets = new java.util.ArrayList<>(1 + extraPackets.size()); + java.util.List<Connection.PacketHolder> packets = new java.util.ArrayList<>(1 + extraPackets.size());
+ packets.add(new Connection.PacketHolder(packet, null)); // delay the future listener until the end of the extra packets + packets.add(new Connection.PacketHolder(packet, null)); // delay the future listener until the end of the extra packets
@ -135,7 +135,7 @@ index f6162d65d341ef3df1a9b3f45d7d0c25d52f35cf..2d1db70456b746c8fab77893cb34240e
+ for (int i = 0, len = extraPackets.size(); i < len;) { + for (int i = 0, len = extraPackets.size(); i < len;) {
+ Packet extra = extraPackets.get(i); + Packet extra = extraPackets.get(i);
+ boolean end = ++i == len; + boolean end = ++i == len;
+ packets.add(new Connection.PacketHolder(extra, end ? packetsendlistener : null)); // append listener to the end + packets.add(new Connection.PacketHolder(extra, end ? callbacks : null)); // append listener to the end
+ } + }
+ this.queue.addAll(packets); // atomic + this.queue.addAll(packets); // atomic
+ } + }
@ -143,7 +143,7 @@ index f6162d65d341ef3df1a9b3f45d7d0c25d52f35cf..2d1db70456b746c8fab77893cb34240e
+ // Paper end + // Paper end
} }
private void sendPacket(Packet<?> packet, @Nullable PacketSendListener packetsendlistener) { private void sendPacket(Packet<?> packet, @Nullable PacketSendListener callbacks) {
@@ -234,6 +309,15 @@ public class Connection extends SimpleChannelInboundHandler<Packet<?>> { @@ -234,6 +309,15 @@ public class Connection extends SimpleChannelInboundHandler<Packet<?>> {
this.setProtocol(packetState); this.setProtocol(packetState);
} }
@ -159,7 +159,7 @@ index f6162d65d341ef3df1a9b3f45d7d0c25d52f35cf..2d1db70456b746c8fab77893cb34240e
+ // Paper end + // Paper end
ChannelFuture channelfuture = this.channel.writeAndFlush(packet); ChannelFuture channelfuture = this.channel.writeAndFlush(packet);
if (packetsendlistener != null) { if (callbacks != null) {
@@ -252,28 +336,65 @@ public class Connection extends SimpleChannelInboundHandler<Packet<?>> { @@ -252,28 +336,65 @@ public class Connection extends SimpleChannelInboundHandler<Packet<?>> {
}); });

View file

@ -22,10 +22,10 @@ index d6f34adbdf45bbef4a39e629dd7cb6d7fcb5db0f..7881176a900daa3306c691454f688c1f
this.broadcast.accept(packet); this.broadcast.accept(packet);
if (this.entity instanceof ServerPlayer) { if (this.entity instanceof ServerPlayer) {
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
index b7425dce2bd65716896bd37477514faa2ceb68e8..2cd75a2411aa184ce80b7b7f8c5a09d0cd6fec26 100644 index 933d74f48dfedc15eec76b4e376e51c40bc4bea5..90af6b5e7f6188eec4a4e311a0d273857d3d1c5c 100644
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java --- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
@@ -2726,7 +2726,14 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic @@ -2727,7 +2727,14 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
if (event.isCancelled() || ServerGamePacketListenerImpl.this.player.getInventory().getSelected() == null || ServerGamePacketListenerImpl.this.player.getInventory().getSelected().getItem() != origItem) { if (event.isCancelled() || ServerGamePacketListenerImpl.this.player.getInventory().getSelected() == null || ServerGamePacketListenerImpl.this.player.getInventory().getSelected().getItem() != origItem) {
// Refresh the current entity metadata // Refresh the current entity metadata

View file

@ -5,7 +5,7 @@ Subject: [PATCH] Fix CB call to changed postToMainThread method
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
index c3a2c3acaacff9a2570a54cab5239b888946728f..b3a23434a5111d6ad393a7b3c0da67cb48dbaad9 100644 index e2bcaa862c6d69e0989587deb42f2e9adcb971df..18395a47a9d44784359b07e8478229fa202bea9a 100644
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java --- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
@@ -516,7 +516,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic @@ -516,7 +516,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
@ -16,4 +16,4 @@ index c3a2c3acaacff9a2570a54cab5239b888946728f..b3a23434a5111d6ad393a7b3c0da67cb
+ minecraftserver.scheduleOnMain(networkmanager::handleDisconnection); // Paper + minecraftserver.scheduleOnMain(networkmanager::handleDisconnection); // Paper
} }
private <T, R> CompletableFuture<R> filterTextPacket(T text, BiFunction<TextFilter, T, CompletableFuture<R>> bifunction) { private <T, R> CompletableFuture<R> filterTextPacket(T text, BiFunction<TextFilter, T, CompletableFuture<R>> filterer) {

View file

@ -5,10 +5,10 @@ Subject: [PATCH] Dont send unnecessary sign update
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
index fc05bdab6653bdc9da7a6f4cea4a5323fe114a30..c5d80c61f33aa0b1f1d97abe16f8175ec9259381 100644 index db079ad6516eba21915713be4d99f9566da47945..8138fbe3f991451134a179f3b0256f7d088375b8 100644
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java --- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
@@ -3330,6 +3330,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic @@ -3331,6 +3331,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
if (!tileentitysign.isEditable() || !this.player.getUUID().equals(tileentitysign.getPlayerWhoMayEdit())) { if (!tileentitysign.isEditable() || !this.player.getUUID().equals(tileentitysign.getPlayerWhoMayEdit())) {
ServerGamePacketListenerImpl.LOGGER.warn("Player {} just tried to change non-editable sign", this.player.getName().getString()); ServerGamePacketListenerImpl.LOGGER.warn("Player {} just tried to change non-editable sign", this.player.getName().getString());

View file

@ -5,7 +5,7 @@ Subject: [PATCH] Load Chunks for Login Asynchronously
diff --git a/src/main/java/net/minecraft/server/level/ServerPlayer.java b/src/main/java/net/minecraft/server/level/ServerPlayer.java diff --git a/src/main/java/net/minecraft/server/level/ServerPlayer.java b/src/main/java/net/minecraft/server/level/ServerPlayer.java
index 3a40d6fe9edbd997dc9a6b8ac009c3f621ecfe51..8dc31f65126db6b2527d4106a885cb9b6dbc7a75 100644 index 084521ed853fc2b15be355a17da8421c54716815..acc64abd9420b81ed4c8c17cf6a9f5bc5d35f116 100644
--- a/src/main/java/net/minecraft/server/level/ServerPlayer.java --- a/src/main/java/net/minecraft/server/level/ServerPlayer.java
+++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java +++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java
@@ -182,6 +182,7 @@ public class ServerPlayer extends Player { @@ -182,6 +182,7 @@ public class ServerPlayer extends Player {
@ -37,7 +37,7 @@ index be677d437d17b74c6188ce1bd5fc6fdc228fd92f..78fbb4c3e52e900956ae0811aaf934c8
public static final TicketType<ChunkPos> UNKNOWN = TicketType.create("unknown", Comparator.comparingLong(ChunkPos::toLong), 1); public static final TicketType<ChunkPos> UNKNOWN = TicketType.create("unknown", Comparator.comparingLong(ChunkPos::toLong), 1);
public static final TicketType<Unit> PLUGIN = TicketType.create("plugin", (a, b) -> 0); // CraftBukkit public static final TicketType<Unit> PLUGIN = TicketType.create("plugin", (a, b) -> 0); // CraftBukkit
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
index e1e35bd6fb827149b23da4d19876a9a6989dde7e..4408c30532119277abb1027cd5a08e4cb9ebe587 100644 index 256a6734455e89154e817bbf82de0d1c928b21cd..76100b605715ae530339da61bde8af634aa60017 100644
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java --- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
@@ -251,6 +251,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic @@ -251,6 +251,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
@ -74,10 +74,10 @@ index e1e35bd6fb827149b23da4d19876a9a6989dde7e..4408c30532119277abb1027cd5a08e4c
this.server.getProfiler().push("keepAlive"); this.server.getProfiler().push("keepAlive");
// Paper Start - give clients a longer time to respond to pings as per pre 1.12.2 timings // Paper Start - give clients a longer time to respond to pings as per pre 1.12.2 timings
diff --git a/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java diff --git a/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java
index 63abdc84bbd8d3ef78e18ffe792f2f1e5035e2ff..11a7b79b25f3ad83687f6f9076231e227ebea165 100644 index 6629fee181b8d0c6ece3d23a028b971e98f8799b..ed384e8ce0050ace3a96a8a5cc6007a1af1720bb 100644
--- a/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java --- a/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java
@@ -95,7 +95,7 @@ public class ServerLoginPacketListenerImpl implements TickablePacketListener, Se @@ -91,7 +91,7 @@ public class ServerLoginPacketListenerImpl implements TickablePacketListener, Se
} }
// Paper end // Paper end
} else if (this.state == ServerLoginPacketListenerImpl.State.DELAY_ACCEPT) { } else if (this.state == ServerLoginPacketListenerImpl.State.DELAY_ACCEPT) {
@ -86,7 +86,7 @@ index 63abdc84bbd8d3ef78e18ffe792f2f1e5035e2ff..11a7b79b25f3ad83687f6f9076231e22
if (entityplayer == null) { if (entityplayer == null) {
this.state = ServerLoginPacketListenerImpl.State.READY_TO_ACCEPT; this.state = ServerLoginPacketListenerImpl.State.READY_TO_ACCEPT;
@@ -204,7 +204,7 @@ public class ServerLoginPacketListenerImpl implements TickablePacketListener, Se @@ -200,7 +200,7 @@ public class ServerLoginPacketListenerImpl implements TickablePacketListener, Se
} }
this.connection.send(new ClientboundGameProfilePacket(this.gameProfile)); this.connection.send(new ClientboundGameProfilePacket(this.gameProfile));
@ -96,7 +96,7 @@ index 63abdc84bbd8d3ef78e18ffe792f2f1e5035e2ff..11a7b79b25f3ad83687f6f9076231e22
try { try {
ServerPlayer entityplayer1 = this.server.getPlayerList().getPlayerForLogin(this.gameProfile, s); // CraftBukkit - add player reference ServerPlayer entityplayer1 = this.server.getPlayerList().getPlayerForLogin(this.gameProfile, s); // CraftBukkit - add player reference
diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java
index 1f32ba033eedcb69b02c29da8594be9edf958f43..4173c9c364be3a266a8ba43b384ee230e6f98f62 100644 index b48641bbe371ffacbbd659a0ee1783437267a4dc..0d86536696657ba6eee5f12d3d3afa8e5a167060 100644
--- a/src/main/java/net/minecraft/server/players/PlayerList.java --- a/src/main/java/net/minecraft/server/players/PlayerList.java
+++ b/src/main/java/net/minecraft/server/players/PlayerList.java +++ b/src/main/java/net/minecraft/server/players/PlayerList.java
@@ -139,6 +139,7 @@ public abstract class PlayerList { @@ -139,6 +139,7 @@ public abstract class PlayerList {

View file

@ -29,7 +29,7 @@ index 0000000000000000000000000000000000000000..2d5494d2813b773e60ddba6790b750a9
+ } + }
+} +}
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
index e25451056b6eedde2c5ffc281918ca13967e0a67..af2d703fe3cb74ced502ca89c5bf6ca1f47474bb 100644 index 140ff101b8568fa6df0a793e0068f59d48e91e07..d6d398ad64ec923e36155f8617aeb8d0906a9d59 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java --- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java
@@ -871,6 +871,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa @@ -871,6 +871,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
@ -58,10 +58,10 @@ index e25451056b6eedde2c5ffc281918ca13967e0a67..af2d703fe3cb74ced502ca89c5bf6ca1
this.running = false; this.running = false;
if (flag) { if (flag) {
diff --git a/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java diff --git a/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java
index 31a506e78264f354394afc37fb7ebb3d0c7d6ebd..40b27dbdc15e07a6a9d63d41babe5ed0245c0e0b 100644 index ed384e8ce0050ace3a96a8a5cc6007a1af1720bb..2279e4cc2602bb66ac1da9822d9749999b73954e 100644
--- a/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java --- a/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java
@@ -218,6 +218,11 @@ public class ServerLoginPacketListenerImpl implements TickablePacketListener, Se @@ -214,6 +214,11 @@ public class ServerLoginPacketListenerImpl implements TickablePacketListener, Se
} catch (Exception exception) { } catch (Exception exception) {
ServerLoginPacketListenerImpl.LOGGER.error("Couldn't place player in world", exception); ServerLoginPacketListenerImpl.LOGGER.error("Couldn't place player in world", exception);
MutableComponent ichatmutablecomponent = Component.translatable("multiplayer.disconnect.invalid_player_data"); MutableComponent ichatmutablecomponent = Component.translatable("multiplayer.disconnect.invalid_player_data");

View file

@ -5,10 +5,10 @@ Subject: [PATCH] Add and implement PlayerRecipeBookClickEvent
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
index 760c2a7b532139ddcb0ae0177429940fea825254..01002d5b37863f1c072e4cb2909d82101a016a47 100644 index 870935874baa29edd1c641869c5f6a22155f2e8f..237bf7e97dc89a551feb28914317344207a28e13 100644
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java --- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
@@ -3227,9 +3227,15 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic @@ -3228,9 +3228,15 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
if (!this.player.containerMenu.stillValid(this.player)) { if (!this.player.containerMenu.stillValid(this.player)) {
ServerGamePacketListenerImpl.LOGGER.debug("Player {} interacted with invalid menu {}", this.player, this.player.containerMenu); ServerGamePacketListenerImpl.LOGGER.debug("Player {} interacted with invalid menu {}", this.player, this.player.containerMenu);
} else { } else {

View file

@ -76,7 +76,7 @@ index e42df2956e2d852a5a4c8fdeda395a3efd32c44c..da83f111199a6b4c712a9bb8ab6f1d1b
@Override @Override
diff --git a/src/main/java/net/minecraft/server/level/ServerPlayer.java b/src/main/java/net/minecraft/server/level/ServerPlayer.java diff --git a/src/main/java/net/minecraft/server/level/ServerPlayer.java b/src/main/java/net/minecraft/server/level/ServerPlayer.java
index 1d021366aa5ffd20365e96a335388aea3238845b..93e7f2dc5b5db8b3ec54e70b44f531d3caeb99dc 100644 index 06e711aa9a0afedda48395ba2ee369bb211584da..28944fc50ea43a3ea40bd1e69c560c8fe022337e 100644
--- a/src/main/java/net/minecraft/server/level/ServerPlayer.java --- a/src/main/java/net/minecraft/server/level/ServerPlayer.java
+++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java +++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java
@@ -1128,7 +1128,7 @@ public class ServerPlayer extends Player { @@ -1128,7 +1128,7 @@ public class ServerPlayer extends Player {
@ -89,10 +89,10 @@ index 1d021366aa5ffd20365e96a335388aea3238845b..93e7f2dc5b5db8b3ec54e70b44f531d3
playerlist.sendPlayerPermissionLevel(this); playerlist.sendPlayerPermissionLevel(this);
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
index e12a1e923dd7de6ccc4b8f06c402d6ede17b0b64..2f4e3363281a8a068353d433df42bc3b4e9d792c 100644 index 893b9557d742ad1d74a7f6a772c4f8f45a7172f6..aea4c331c1bb0e84fc4743dbec539143755555d2 100644
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java --- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
@@ -3497,7 +3497,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic @@ -3498,7 +3498,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
public void handleChangeDifficulty(ServerboundChangeDifficultyPacket packet) { public void handleChangeDifficulty(ServerboundChangeDifficultyPacket packet) {
PacketUtils.ensureRunningOnSameThread(packet, this, this.player.getLevel()); PacketUtils.ensureRunningOnSameThread(packet, this, this.player.getLevel());
if (this.player.hasPermissions(2) || this.isSingleplayerOwner()) { if (this.player.hasPermissions(2) || this.isSingleplayerOwner()) {

View file

@ -5,7 +5,7 @@ Subject: [PATCH] Brand support
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
index 2f4e3363281a8a068353d433df42bc3b4e9d792c..e3e8ced9fcf5888811eebe3b55777fa212829b2f 100644 index aea4c331c1bb0e84fc4743dbec539143755555d2..c489a3f2a0c62a15cd4de45dfc0e90245e1d9b25 100644
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java --- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
@@ -296,6 +296,8 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic @@ -296,6 +296,8 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
@ -17,7 +17,7 @@ index 2f4e3363281a8a068353d433df42bc3b4e9d792c..e3e8ced9fcf5888811eebe3b55777fa2
public ServerGamePacketListenerImpl(MinecraftServer server, Connection connection, ServerPlayer player) { public ServerGamePacketListenerImpl(MinecraftServer server, Connection connection, ServerPlayer player) {
this.lastChatTimeStamp = new AtomicReference(Instant.EPOCH); this.lastChatTimeStamp = new AtomicReference(Instant.EPOCH);
this.lastSeenMessagesValidator = new LastSeenMessagesValidator(); this.lastSeenMessagesValidator = new LastSeenMessagesValidator();
@@ -3452,6 +3454,8 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic @@ -3453,6 +3455,8 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
private static final ResourceLocation CUSTOM_REGISTER = new ResourceLocation("register"); private static final ResourceLocation CUSTOM_REGISTER = new ResourceLocation("register");
private static final ResourceLocation CUSTOM_UNREGISTER = new ResourceLocation("unregister"); private static final ResourceLocation CUSTOM_UNREGISTER = new ResourceLocation("unregister");
@ -26,7 +26,7 @@ index 2f4e3363281a8a068353d433df42bc3b4e9d792c..e3e8ced9fcf5888811eebe3b55777fa2
@Override @Override
public void handleCustomPayload(ServerboundCustomPayloadPacket packet) { public void handleCustomPayload(ServerboundCustomPayloadPacket packet) {
PacketUtils.ensureRunningOnSameThread(packet, this, this.player.getLevel()); PacketUtils.ensureRunningOnSameThread(packet, this, this.player.getLevel());
@@ -3479,6 +3483,15 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic @@ -3480,6 +3484,15 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
try { try {
byte[] data = new byte[packet.data.readableBytes()]; byte[] data = new byte[packet.data.readableBytes()];
packet.data.readBytes(data); packet.data.readBytes(data);
@ -42,7 +42,7 @@ index 2f4e3363281a8a068353d433df42bc3b4e9d792c..e3e8ced9fcf5888811eebe3b55777fa2
this.cserver.getMessenger().dispatchIncomingMessage(this.player.getBukkitEntity(), packet.identifier.toString(), data); this.cserver.getMessenger().dispatchIncomingMessage(this.player.getBukkitEntity(), packet.identifier.toString(), data);
} catch (Exception ex) { } catch (Exception ex) {
ServerGamePacketListenerImpl.LOGGER.error("Couldn\'t dispatch custom payload", ex); ServerGamePacketListenerImpl.LOGGER.error("Couldn\'t dispatch custom payload", ex);
@@ -3488,6 +3501,12 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic @@ -3489,6 +3502,12 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
} }

View file

@ -25,10 +25,10 @@ index 43759cdf3da0796d7969c6504ac9a6986c0f0518..750fef0f5b908b776a7306e54653eba4
this.connection.send(new ClientboundLoginDisconnectPacket(ichatmutablecomponent)); this.connection.send(new ClientboundLoginDisconnectPacket(ichatmutablecomponent));
diff --git a/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java diff --git a/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java
index 40b27dbdc15e07a6a9d63d41babe5ed0245c0e0b..0ad129adf726049c62f8d5c816cc32b3b6b9b2eb 100644 index 2279e4cc2602bb66ac1da9822d9749999b73954e..9d1b7748ceeba953150342d709e02bf3d5269863 100644
--- a/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java --- a/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java
@@ -113,7 +113,7 @@ public class ServerLoginPacketListenerImpl implements TickablePacketListener, Se @@ -109,7 +109,7 @@ public class ServerLoginPacketListenerImpl implements TickablePacketListener, Se
// CraftBukkit start // CraftBukkit start
@Deprecated @Deprecated
public void disconnect(String s) { public void disconnect(String s) {

View file

@ -5,7 +5,7 @@ Subject: [PATCH] Limit recipe packets
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
index 2b4e2a9c801f47ee64ebb3cb76f8c093b6ed1670..daaf71ba59fab7ed0b11f1fc6a182fe5f0537404 100644 index b0f9ebcf04a562ce2f0fbee01b731e4fa1c1eab8..25b44f5f83bf03fb6910b06c79f35ac10bf50e3a 100644
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java --- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
@@ -261,6 +261,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic @@ -261,6 +261,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
@ -24,7 +24,7 @@ index 2b4e2a9c801f47ee64ebb3cb76f8c093b6ed1670..daaf71ba59fab7ed0b11f1fc6a182fe5
/* Use thread-safe field access instead /* Use thread-safe field access instead
if (this.chatSpamTickCount > 0) { if (this.chatSpamTickCount > 0) {
--this.chatSpamTickCount; --this.chatSpamTickCount;
@@ -3246,6 +3248,14 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic @@ -3247,6 +3249,14 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
@Override @Override
public void handlePlaceRecipe(ServerboundPlaceRecipePacket packet) { public void handlePlaceRecipe(ServerboundPlaceRecipePacket packet) {

View file

@ -6,7 +6,7 @@ Subject: [PATCH] Fix interact event not being called in adventure
Call PlayerInteractEvent when left-clicking on a block in adventure mode Call PlayerInteractEvent when left-clicking on a block in adventure mode
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
index daaf71ba59fab7ed0b11f1fc6a182fe5f0537404..a4acceb3b944ce034e101f90b5df535fe0211ad0 100644 index 25b44f5f83bf03fb6910b06c79f35ac10bf50e3a..7db3c6502eb15192e876f5c766bf64c30f52e9c4 100644
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java --- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
@@ -1855,7 +1855,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic @@ -1855,7 +1855,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
@ -18,7 +18,7 @@ index daaf71ba59fab7ed0b11f1fc6a182fe5f0537404..a4acceb3b944ce034e101f90b5df535f
this.player.swing(enumhand, true); this.player.swing(enumhand, true);
} }
} }
@@ -2614,7 +2614,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic @@ -2615,7 +2615,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
Vec3 vec3d1 = vec3d.add((double) f7 * d3, (double) f6 * d3, (double) f8 * d3); Vec3 vec3d1 = vec3d.add((double) f7 * d3, (double) f6 * d3, (double) f8 * d3);
HitResult movingobjectposition = this.player.level.clip(new ClipContext(vec3d, vec3d1, ClipContext.Block.OUTLINE, ClipContext.Fluid.NONE, this.player)); HitResult movingobjectposition = this.player.level.clip(new ClipContext(vec3d, vec3d1, ClipContext.Block.OUTLINE, ClipContext.Fluid.NONE, this.player));

View file

@ -5,10 +5,10 @@ Subject: [PATCH] add RespawnFlags to PlayerRespawnEvent
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
index 3d3f7ce2dc77071b191da532f3baa05cac111f60..bcc08fee18c8dbe239ac996293bc8613d75f47da 100644 index 26c707199cb3c87b3b56c28b2d4a1eaa8dd0b106..9e3c6ff6b7db0c6add4fe76d20fdfaff88239660 100644
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java --- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
@@ -2893,7 +2893,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic @@ -2894,7 +2894,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
case PERFORM_RESPAWN: case PERFORM_RESPAWN:
if (this.player.wonGame) { if (this.player.wonGame) {
this.player.wonGame = false; this.player.wonGame = false;
@ -18,7 +18,7 @@ index 3d3f7ce2dc77071b191da532f3baa05cac111f60..bcc08fee18c8dbe239ac996293bc8613
} else { } else {
if (this.player.getHealth() > 0.0F) { if (this.player.getHealth() > 0.0F) {
diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java
index 10cdb5f5a3c7f2fd367f8bcd008433251152ecce..1cac9e3074551567960ae2e991414e62f7e089ee 100644 index 10b615ad0a038c7237f4664431996774b4e55e2f..63f92d68b91f1049802a1541c7ec4efaa324ac11 100644
--- a/src/main/java/net/minecraft/server/players/PlayerList.java --- a/src/main/java/net/minecraft/server/players/PlayerList.java
+++ b/src/main/java/net/minecraft/server/players/PlayerList.java +++ b/src/main/java/net/minecraft/server/players/PlayerList.java
@@ -811,6 +811,12 @@ public abstract class PlayerList { @@ -811,6 +811,12 @@ public abstract class PlayerList {

View file

@ -5,10 +5,10 @@ Subject: [PATCH] Add raw address to AsyncPlayerPreLoginEvent
diff --git a/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java diff --git a/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java
index 0048f5a1d844402b3e1a24008508797878066431..591b3b84a74f432f230112359e086d1429bbed92 100644 index 9d1b7748ceeba953150342d709e02bf3d5269863..45b0b4261c4b58296c6ddd1c989dab868f88030f 100644
--- a/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java --- a/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java
@@ -414,12 +414,13 @@ public class ServerLoginPacketListenerImpl implements TickablePacketListener, Se @@ -398,12 +398,13 @@ public class ServerLoginPacketListenerImpl implements TickablePacketListener, Se
// Paper end // Paper end
String playerName = ServerLoginPacketListenerImpl.this.gameProfile.getName(); String playerName = ServerLoginPacketListenerImpl.this.gameProfile.getName();
java.net.InetAddress address = ((java.net.InetSocketAddress) ServerLoginPacketListenerImpl.this.connection.getRemoteAddress()).getAddress(); java.net.InetAddress address = ((java.net.InetSocketAddress) ServerLoginPacketListenerImpl.this.connection.getRemoteAddress()).getAddress();

View file

@ -45,7 +45,7 @@ index 65089c0e78c9913a92ae9c66d664f48e2112ad92..7882ee2b7813d437d3b7580f046f38e7
} }
diff --git a/src/main/java/net/minecraft/server/level/ServerPlayer.java b/src/main/java/net/minecraft/server/level/ServerPlayer.java diff --git a/src/main/java/net/minecraft/server/level/ServerPlayer.java b/src/main/java/net/minecraft/server/level/ServerPlayer.java
index 01ec3d4a3ea2d5edf1d503cdb6a9532774a89480..0f5204733022955df059b3ccff260e1aa375916c 100644 index 66a3148985f864c2e4238cd3b27469d59ab3f354..4a35720430990b358ea5d7f2b6293e27e8d9f7ac 100644
--- a/src/main/java/net/minecraft/server/level/ServerPlayer.java --- a/src/main/java/net/minecraft/server/level/ServerPlayer.java
+++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java +++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java
@@ -1810,8 +1810,15 @@ public class ServerPlayer extends Player { @@ -1810,8 +1810,15 @@ public class ServerPlayer extends Player {
@ -126,10 +126,10 @@ index 32746dfbc2fdfc150583676b1bf0762398b76d75..1ad1f958a9b6e1bc21f1c505aa7ea549
} }
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
index bcc08fee18c8dbe239ac996293bc8613d75f47da..e18f8cc29683f886aef70ca29f1760ce63a1a748 100644 index 9e3c6ff6b7db0c6add4fe76d20fdfaff88239660..1811c6492d5fb5910b15b3d95506076245cd8b89 100644
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java --- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
@@ -2902,7 +2902,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic @@ -2903,7 +2903,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
this.player = this.server.getPlayerList().respawn(this.player, false); this.player = this.server.getPlayerList().respawn(this.player, false);
if (this.server.isHardcore()) { if (this.server.isHardcore()) {

View file

@ -57,7 +57,7 @@ index 65637a33ba171a4b598f70cd943d24b0ee44a69f..57a9146bf2dee7a60aab16716e25348f
} }
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
index 8b11a59c915b606b4b377dc335c6eae540314798..5d237142e5dfb0b0bd4a764dca924dccd8d9c52a 100644 index f54a2fd855c0a901ee72258b7a315d0c1caf4ff0..1b1bf6fdc29a78b70eb39ce0770056a0b92d5e55 100644
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java --- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
@@ -372,7 +372,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic @@ -372,7 +372,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
@ -258,8 +258,8 @@ index 8b11a59c915b606b4b377dc335c6eae540314798..5d237142e5dfb0b0bd4a764dca924dcc
} else { } else {
if (this.tryHandleChat(packet.command(), packet.timeStamp(), packet.lastSeenMessages())) { if (this.tryHandleChat(packet.command(), packet.timeStamp(), packet.lastSeenMessages())) {
this.server.submit(() -> { this.server.submit(() -> {
@@ -2212,7 +2222,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic @@ -2205,7 +2215,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
// Paper end private boolean tryHandleChat(String message, Instant timestamp, LastSeenMessages.Update acknowledgment) {
if (!this.updateChatOrder(timestamp)) { if (!this.updateChatOrder(timestamp)) {
ServerGamePacketListenerImpl.LOGGER.warn("{} sent out-of-order chat: '{}'", this.player.getName().getString(), message); ServerGamePacketListenerImpl.LOGGER.warn("{} sent out-of-order chat: '{}'", this.player.getName().getString(), message);
- this.disconnect(Component.translatable("multiplayer.disconnect.out_of_order_chat")); - this.disconnect(Component.translatable("multiplayer.disconnect.out_of_order_chat"));
@ -268,15 +268,15 @@ index 8b11a59c915b606b4b377dc335c6eae540314798..5d237142e5dfb0b0bd4a764dca924dcc
} else if (this.player.isRemoved() || this.player.getChatVisibility() == ChatVisiblity.HIDDEN) { // CraftBukkit - dead men tell no tales } else if (this.player.isRemoved() || this.player.getChatVisibility() == ChatVisiblity.HIDDEN) { // CraftBukkit - dead men tell no tales
this.send(new ClientboundSystemChatPacket(Component.translatable("chat.disabled.options").withStyle(ChatFormatting.RED), false)); this.send(new ClientboundSystemChatPacket(Component.translatable("chat.disabled.options").withStyle(ChatFormatting.RED), false));
@@ -2464,7 +2474,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic @@ -2464,7 +2474,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
ChatSender chatsender = this.player.asChatSender(); }
if (chatsender.profilePublicKey() != null && !message.verify(chatsender)) { if (!playerchatmessage.verify(chatsender)) {
- this.disconnect(Component.translatable("multiplayer.disconnect.unsigned_chat")); - this.disconnect(Component.translatable("multiplayer.disconnect.unsigned_chat"));
+ this.disconnect(Component.translatable("multiplayer.disconnect.unsigned_chat"), org.bukkit.event.player.PlayerKickEvent.Cause.UNSIGNED_CHAT); // Paper - kick event cause + this.disconnect(Component.translatable("multiplayer.disconnect.unsigned_chat"), org.bukkit.event.player.PlayerKickEvent.Cause.UNSIGNED_CHAT); // Paper - kick event cause
return false; return false;
} else { }
if (message.hasExpiredServer(Instant.now())) { }
@@ -2491,7 +2501,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic @@ -2492,7 +2502,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
// this.chatSpamTickCount += 20; // this.chatSpamTickCount += 20;
if (this.chatSpamTickCount.addAndGet(20) > 200 && !this.server.getPlayerList().isOp(this.player.getGameProfile())) { if (this.chatSpamTickCount.addAndGet(20) > 200 && !this.server.getPlayerList().isOp(this.player.getGameProfile())) {
// CraftBukkit end // CraftBukkit end
@ -285,7 +285,7 @@ index 8b11a59c915b606b4b377dc335c6eae540314798..5d237142e5dfb0b0bd4a764dca924dcc
} }
} }
@@ -2594,7 +2604,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic @@ -2595,7 +2605,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
private void handleValidationFailure(Set<LastSeenMessagesValidator.ErrorCondition> reasons) { private void handleValidationFailure(Set<LastSeenMessagesValidator.ErrorCondition> reasons) {
ServerGamePacketListenerImpl.LOGGER.warn("Failed to validate message from {}, reasons: {}", this.player.getName().getString(), reasons.stream().map(LastSeenMessagesValidator.ErrorCondition::message).collect(Collectors.joining(","))); ServerGamePacketListenerImpl.LOGGER.warn("Failed to validate message from {}, reasons: {}", this.player.getName().getString(), reasons.stream().map(LastSeenMessagesValidator.ErrorCondition::message).collect(Collectors.joining(",")));
@ -294,7 +294,7 @@ index 8b11a59c915b606b4b377dc335c6eae540314798..5d237142e5dfb0b0bd4a764dca924dcc
} }
@Override @Override
@@ -2741,7 +2751,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic @@ -2742,7 +2752,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
} }
if (i > 4096) { if (i > 4096) {
@ -303,7 +303,7 @@ index 8b11a59c915b606b4b377dc335c6eae540314798..5d237142e5dfb0b0bd4a764dca924dcc
} }
} }
@@ -2756,7 +2766,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic @@ -2757,7 +2767,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
// Spigot Start // Spigot Start
if ( entity == this.player && !this.player.isSpectator() ) if ( entity == this.player && !this.player.isSpectator() )
{ {
@ -312,7 +312,7 @@ index 8b11a59c915b606b4b377dc335c6eae540314798..5d237142e5dfb0b0bd4a764dca924dcc
return; return;
} }
// Spigot End // Spigot End
@@ -2849,7 +2859,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic @@ -2850,7 +2860,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
} }
// CraftBukkit end // CraftBukkit end
} else { } else {
@ -321,7 +321,7 @@ index 8b11a59c915b606b4b377dc335c6eae540314798..5d237142e5dfb0b0bd4a764dca924dcc
ServerGamePacketListenerImpl.LOGGER.warn("Player {} tried to attack an invalid entity", ServerGamePacketListenerImpl.this.player.getName().getString()); ServerGamePacketListenerImpl.LOGGER.warn("Player {} tried to attack an invalid entity", ServerGamePacketListenerImpl.this.player.getName().getString());
} }
} }
@@ -3257,7 +3267,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic @@ -3258,7 +3268,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
// Paper start // Paper start
if (!org.bukkit.Bukkit.isPrimaryThread()) { if (!org.bukkit.Bukkit.isPrimaryThread()) {
if (recipeSpamPackets.addAndGet(io.papermc.paper.configuration.GlobalConfiguration.get().spamLimiter.recipeSpamIncrement) > io.papermc.paper.configuration.GlobalConfiguration.get().spamLimiter.recipeSpamLimit) { if (recipeSpamPackets.addAndGet(io.papermc.paper.configuration.GlobalConfiguration.get().spamLimiter.recipeSpamIncrement) > io.papermc.paper.configuration.GlobalConfiguration.get().spamLimiter.recipeSpamLimit) {
@ -330,7 +330,7 @@ index 8b11a59c915b606b4b377dc335c6eae540314798..5d237142e5dfb0b0bd4a764dca924dcc
return; return;
} }
} }
@@ -3460,7 +3470,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic @@ -3461,7 +3471,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
} else if (!this.isSingleplayerOwner()) { } else if (!this.isSingleplayerOwner()) {
// Paper start - This needs to be handled on the main thread for plugins // Paper start - This needs to be handled on the main thread for plugins
server.submit(() -> { server.submit(() -> {
@ -339,7 +339,7 @@ index 8b11a59c915b606b4b377dc335c6eae540314798..5d237142e5dfb0b0bd4a764dca924dcc
}); });
// Paper end // Paper end
} }
@@ -3506,7 +3516,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic @@ -3507,7 +3517,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
} }
} catch (Exception ex) { } catch (Exception ex) {
ServerGamePacketListenerImpl.LOGGER.error("Couldn\'t register custom payload", ex); ServerGamePacketListenerImpl.LOGGER.error("Couldn\'t register custom payload", ex);
@ -348,7 +348,7 @@ index 8b11a59c915b606b4b377dc335c6eae540314798..5d237142e5dfb0b0bd4a764dca924dcc
} }
} else if (packet.identifier.equals(CUSTOM_UNREGISTER)) { } else if (packet.identifier.equals(CUSTOM_UNREGISTER)) {
try { try {
@@ -3516,7 +3526,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic @@ -3517,7 +3527,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
} }
} catch (Exception ex) { } catch (Exception ex) {
ServerGamePacketListenerImpl.LOGGER.error("Couldn\'t unregister custom payload", ex); ServerGamePacketListenerImpl.LOGGER.error("Couldn\'t unregister custom payload", ex);
@ -357,7 +357,7 @@ index 8b11a59c915b606b4b377dc335c6eae540314798..5d237142e5dfb0b0bd4a764dca924dcc
} }
} else { } else {
try { try {
@@ -3534,7 +3544,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic @@ -3535,7 +3545,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
this.cserver.getMessenger().dispatchIncomingMessage(this.player.getBukkitEntity(), packet.identifier.toString(), data); this.cserver.getMessenger().dispatchIncomingMessage(this.player.getBukkitEntity(), packet.identifier.toString(), data);
} catch (Exception ex) { } catch (Exception ex) {
ServerGamePacketListenerImpl.LOGGER.error("Couldn\'t dispatch custom payload", ex); ServerGamePacketListenerImpl.LOGGER.error("Couldn\'t dispatch custom payload", ex);
@ -367,7 +367,7 @@ index 8b11a59c915b606b4b377dc335c6eae540314798..5d237142e5dfb0b0bd4a764dca924dcc
} }
diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java
index 1cac9e3074551567960ae2e991414e62f7e089ee..8147396dc18fe199ffbb59437d0873c2f79b3ee7 100644 index 63f92d68b91f1049802a1541c7ec4efaa324ac11..c332750833cccee1264a3399ed0539f6fee6af44 100644
--- a/src/main/java/net/minecraft/server/players/PlayerList.java --- a/src/main/java/net/minecraft/server/players/PlayerList.java
+++ b/src/main/java/net/minecraft/server/players/PlayerList.java +++ b/src/main/java/net/minecraft/server/players/PlayerList.java
@@ -720,7 +720,7 @@ public abstract class PlayerList { @@ -720,7 +720,7 @@ public abstract class PlayerList {

View file

@ -5,10 +5,10 @@ Subject: [PATCH] Adds PlayerArmSwingEvent
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
index ad68a631c28e95eec5e35a60f9adeebbe3ecc6fc..e9869cc1ab42427f832d383eef0dc332a133efdd 100644 index 6fbba4cb8e3d00ea910c7d32b37b70df7f9cf133..dd1ec83feddecfdd8f2dd8248c3cbca0d55393ec 100644
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java --- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
@@ -2635,7 +2635,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic @@ -2636,7 +2636,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
} }
// Arm swing animation // Arm swing animation

View file

@ -9,7 +9,7 @@ This patch will be used to optimise out flush calls in later
patches. patches.
diff --git a/src/main/java/net/minecraft/network/Connection.java b/src/main/java/net/minecraft/network/Connection.java diff --git a/src/main/java/net/minecraft/network/Connection.java b/src/main/java/net/minecraft/network/Connection.java
index ec1fa6b6cb386542d9c83f5c49c1e8e98c87d417..dc6b467f51b6e17aa46ccce75aa40788afcdf010 100644 index b5f884d6671823085a2ab0e8da2d30afd2928f32..057a0be81b12bd8a4ac71106dc8ada91bd4c9bfd 100644
--- a/src/main/java/net/minecraft/network/Connection.java --- a/src/main/java/net/minecraft/network/Connection.java
+++ b/src/main/java/net/minecraft/network/Connection.java +++ b/src/main/java/net/minecraft/network/Connection.java
@@ -99,6 +99,39 @@ public class Connection extends SimpleChannelInboundHandler<Packet<?>> { @@ -99,6 +99,39 @@ public class Connection extends SimpleChannelInboundHandler<Packet<?>> {
@ -56,19 +56,19 @@ index ec1fa6b6cb386542d9c83f5c49c1e8e98c87d417..dc6b467f51b6e17aa46ccce75aa40788
net.minecraft.server.MCUtil.isMainThread() && packet.isReady() && this.queue.isEmpty() && net.minecraft.server.MCUtil.isMainThread() && packet.isReady() && this.queue.isEmpty() &&
(packet.getExtraPackets() == null || packet.getExtraPackets().isEmpty()) (packet.getExtraPackets() == null || packet.getExtraPackets().isEmpty())
))) { ))) {
- this.sendPacket(packet, packetsendlistener); - this.sendPacket(packet, callbacks);
+ this.sendPacket(packet, packetsendlistener, null); // Paper + this.sendPacket(packet, callbacks, null); // Paper
return; return;
} }
// write the packets to the queue, then flush - antixray hooks there already // write the packets to the queue, then flush - antixray hooks there already
@@ -288,6 +321,14 @@ public class Connection extends SimpleChannelInboundHandler<Packet<?>> { @@ -288,6 +321,14 @@ public class Connection extends SimpleChannelInboundHandler<Packet<?>> {
} }
private void sendPacket(Packet<?> packet, @Nullable PacketSendListener packetsendlistener) { private void sendPacket(Packet<?> packet, @Nullable PacketSendListener callbacks) {
+ // Paper start - add flush parameter + // Paper start - add flush parameter
+ this.sendPacket(packet, packetsendlistener, Boolean.TRUE); + this.sendPacket(packet, callbacks, Boolean.TRUE);
+ } + }
+ private void sendPacket(Packet<?> packet, @Nullable PacketSendListener packetsendlistener, Boolean flushConditional) { + private void sendPacket(Packet<?> packet, @Nullable PacketSendListener callbacks, Boolean flushConditional) {
+ this.packetWrites.getAndIncrement(); // must be befeore using canFlush + this.packetWrites.getAndIncrement(); // must be befeore using canFlush
+ boolean effectiveFlush = flushConditional == null ? this.canFlush : flushConditional.booleanValue(); + boolean effectiveFlush = flushConditional == null ? this.canFlush : flushConditional.booleanValue();
+ final boolean flush = effectiveFlush || packet instanceof net.minecraft.network.protocol.game.ClientboundKeepAlivePacket || packet instanceof ClientboundDisconnectPacket; // no delay for certain packets + final boolean flush = effectiveFlush || packet instanceof net.minecraft.network.protocol.game.ClientboundKeepAlivePacket || packet instanceof ClientboundDisconnectPacket; // no delay for certain packets
@ -80,22 +80,22 @@ index ec1fa6b6cb386542d9c83f5c49c1e8e98c87d417..dc6b467f51b6e17aa46ccce75aa40788
} }
if (this.channel.eventLoop().inEventLoop()) { if (this.channel.eventLoop().inEventLoop()) {
- this.doSendPacket(packet, packetsendlistener, enumprotocol, enumprotocol1); - this.doSendPacket(packet, callbacks, enumprotocol, enumprotocol1);
+ this.doSendPacket(packet, packetsendlistener, enumprotocol, enumprotocol1, flush); // Paper - add flush parameter + this.doSendPacket(packet, callbacks, enumprotocol, enumprotocol1, flush); // Paper
} else { } else {
this.channel.eventLoop().execute(() -> { this.channel.eventLoop().execute(() -> {
- this.doSendPacket(packet, packetsendlistener, enumprotocol, enumprotocol1); - this.doSendPacket(packet, callbacks, enumprotocol, enumprotocol1);
+ this.doSendPacket(packet, packetsendlistener, enumprotocol, enumprotocol1, flush); // Paper - add flush parameter + this.doSendPacket(packet, callbacks, enumprotocol, enumprotocol1, flush); // Paper
}); });
} }
} }
private void doSendPacket(Packet<?> packet, @Nullable PacketSendListener packetsendlistener, ConnectionProtocol packetState, ConnectionProtocol currentState) { private void doSendPacket(Packet<?> packet, @Nullable PacketSendListener callbacks, ConnectionProtocol packetState, ConnectionProtocol currentState) {
+ // Paper start - add flush parameter + // Paper start - add flush parameter
+ this.doSendPacket(packet, packetsendlistener, packetState, currentState, true); + this.doSendPacket(packet, callbacks, packetState, currentState, true);
+ } + }
+ private void doSendPacket(Packet<?> packet, @Nullable PacketSendListener packetsendlistener, ConnectionProtocol packetState, ConnectionProtocol currentState, boolean flush) { + private void doSendPacket(Packet<?> packet, @Nullable PacketSendListener callbacks, ConnectionProtocol packetState, ConnectionProtocol currentState, boolean flush) {
+ // Paper end - add flush parameter + // Paper end - add flush parameter
if (packetState != currentState) { if (packetState != currentState) {
this.setProtocol(packetState); this.setProtocol(packetState);
@ -107,7 +107,7 @@ index ec1fa6b6cb386542d9c83f5c49c1e8e98c87d417..dc6b467f51b6e17aa46ccce75aa40788
- ChannelFuture channelfuture = this.channel.writeAndFlush(packet); - ChannelFuture channelfuture = this.channel.writeAndFlush(packet);
+ ChannelFuture channelfuture = flush ? this.channel.writeAndFlush(packet) : this.channel.write(packet); // Paper - add flush parameter + ChannelFuture channelfuture = flush ? this.channel.writeAndFlush(packet) : this.channel.write(packet); // Paper - add flush parameter
if (packetsendlistener != null) { if (callbacks != null) {
channelfuture.addListener((future) -> { channelfuture.addListener((future) -> {
@@ -376,6 +422,10 @@ public class Connection extends SimpleChannelInboundHandler<Packet<?>> { @@ -376,6 +422,10 @@ public class Connection extends SimpleChannelInboundHandler<Packet<?>> {
} }

View file

@ -20,7 +20,7 @@ up on this optimisation before he came along.
Locally this patch drops the entity tracker tick by a full 1.5x. Locally this patch drops the entity tracker tick by a full 1.5x.
diff --git a/src/main/java/net/minecraft/network/Connection.java b/src/main/java/net/minecraft/network/Connection.java diff --git a/src/main/java/net/minecraft/network/Connection.java b/src/main/java/net/minecraft/network/Connection.java
index a5cba4a46f75a7097fb565346e91a73bdb74de55..0eba4caec2efc4d328f2e2351d5c5615b4c0b094 100644 index 51217798bfd549483ce456b44d14089f35642c55..fefda9868fd3c4b3392b2bf4c68c0b4b2f311f31 100644
--- a/src/main/java/net/minecraft/network/Connection.java --- a/src/main/java/net/minecraft/network/Connection.java
+++ b/src/main/java/net/minecraft/network/Connection.java +++ b/src/main/java/net/minecraft/network/Connection.java
@@ -46,6 +46,8 @@ import org.slf4j.Logger; @@ -46,6 +46,8 @@ import org.slf4j.Logger;
@ -34,20 +34,20 @@ index a5cba4a46f75a7097fb565346e91a73bdb74de55..0eba4caec2efc4d328f2e2351d5c5615
private static final float AVERAGE_PACKETS_SMOOTHING = 0.75F; private static final float AVERAGE_PACKETS_SMOOTHING = 0.75F;
@@ -396,9 +398,19 @@ public class Connection extends SimpleChannelInboundHandler<Packet<?>> { @@ -396,9 +398,19 @@ public class Connection extends SimpleChannelInboundHandler<Packet<?>> {
if (this.channel.eventLoop().inEventLoop()) { if (this.channel.eventLoop().inEventLoop()) {
this.doSendPacket(packet, packetsendlistener, enumprotocol, enumprotocol1, flush); // Paper - add flush parameter this.doSendPacket(packet, callbacks, enumprotocol, enumprotocol1, flush); // Paper
} else { } else {
+ // Paper start - optimise packets that are not flushed + // Paper start - optimise packets that are not flushed
+ // note: since the type is not dynamic here, we need to actually copy the old executor code + // note: since the type is not dynamic here, we need to actually copy the old executor code
+ // into two branches. On conflict, just re-copy - no changes were made inside the executor code. + // into two branches. On conflict, just re-copy - no changes were made inside the executor code.
+ if (!flush) { + if (!flush) {
+ AbstractEventExecutor.LazyRunnable run = () -> { + AbstractEventExecutor.LazyRunnable run = () -> {
+ this.doSendPacket(packet, packetsendlistener, enumprotocol, enumprotocol1, flush); // Paper - add flush parameter + this.doSendPacket(packet, callbacks, enumprotocol, enumprotocol1, flush); // Paper - add flush parameter
+ }; + };
+ this.channel.eventLoop().execute(run); + this.channel.eventLoop().execute(run);
+ } else { // Paper end - optimise packets that are not flushed + } else { // Paper end - optimise packets that are not flushed
this.channel.eventLoop().execute(() -> { this.channel.eventLoop().execute(() -> {
- this.doSendPacket(packet, packetsendlistener, enumprotocol, enumprotocol1, flush); // Paper - add flush parameter - this.doSendPacket(packet, callbacks, enumprotocol, enumprotocol1, flush); // Paper
+ this.doSendPacket(packet, packetsendlistener, enumprotocol, enumprotocol1, flush); // Paper - add flush parameter // Paper - diff on change + this.doSendPacket(packet, callbacks, enumprotocol, enumprotocol1, flush); // Paper - add flush parameter // Paper - diff on change
}); });
+ } // Paper + } // Paper
} }

View file

@ -268,7 +268,7 @@ index 792883afe53d2b7989c25a81c2f9a639d5e21d20..c04379ca8a4db0f4de46ad2b3b338431
return this.threshold; return this.threshold;
} }
diff --git a/src/main/java/net/minecraft/network/Connection.java b/src/main/java/net/minecraft/network/Connection.java diff --git a/src/main/java/net/minecraft/network/Connection.java b/src/main/java/net/minecraft/network/Connection.java
index 0eba4caec2efc4d328f2e2351d5c5615b4c0b094..c561a2f28fa1e9a327982c4587c4552cd85a7336 100644 index fefda9868fd3c4b3392b2bf4c68c0b4b2f311f31..66afd752fd7d327e141d49b477f07e1ff3645d02 100644
--- a/src/main/java/net/minecraft/network/Connection.java --- a/src/main/java/net/minecraft/network/Connection.java
+++ b/src/main/java/net/minecraft/network/Connection.java +++ b/src/main/java/net/minecraft/network/Connection.java
@@ -652,11 +652,28 @@ public class Connection extends SimpleChannelInboundHandler<Packet<?>> { @@ -652,11 +652,28 @@ public class Connection extends SimpleChannelInboundHandler<Packet<?>> {
@ -341,10 +341,10 @@ index b80aedd2002959b4026c27ce76b3ed17f0acfb5b..2985271132c9ae822dcb0d7a7e6f0c26
protected void initChannel(Channel channel) { protected void initChannel(Channel channel) {
try { try {
diff --git a/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java diff --git a/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java
index 591b3b84a74f432f230112359e086d1429bbed92..c246fbd3c155d74684c3a105818abef833f1ed96 100644 index 45b0b4261c4b58296c6ddd1c989dab868f88030f..b9beea9ff4091e7530adb92ecb7a7e5c3ea20373 100644
--- a/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java --- a/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java
@@ -342,12 +342,14 @@ public class ServerLoginPacketListenerImpl implements TickablePacketListener, Se @@ -326,12 +326,14 @@ public class ServerLoginPacketListenerImpl implements TickablePacketListener, Se
} }
SecretKey secretkey = packet.getSecretKey(privatekey); SecretKey secretkey = packet.getSecretKey(privatekey);

View file

@ -49,10 +49,10 @@ index 2985271132c9ae822dcb0d7a7e6f0c268d1736cc..cfdbcd024de6ad0f9d4e83b2f912b36e
networkmanager.send(new ClientboundDisconnectPacket(ichatmutablecomponent), PacketSendListener.thenRun(() -> { networkmanager.send(new ClientboundDisconnectPacket(ichatmutablecomponent), PacketSendListener.thenRun(() -> {
diff --git a/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java diff --git a/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java
index c246fbd3c155d74684c3a105818abef833f1ed96..c1cb1406bf00843568e94c5d72cf60b3e5455720 100644 index b9beea9ff4091e7530adb92ecb7a7e5c3ea20373..2128bafb9b64568ae01a0cfe134185a28be479aa 100644
--- a/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java --- a/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java
@@ -241,7 +241,10 @@ public class ServerLoginPacketListenerImpl implements TickablePacketListener, Se @@ -237,7 +237,10 @@ public class ServerLoginPacketListenerImpl implements TickablePacketListener, Se
} }
public String getUserName() { public String getUserName() {
@ -65,7 +65,7 @@ index c246fbd3c155d74684c3a105818abef833f1ed96..c1cb1406bf00843568e94c5d72cf60b3
@Nullable @Nullable
diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java
index 5d5663d929227b2376c57b130a5c32e349edf009..49305ca48798ba9047c27dfc9f1755b72689abcb 100644 index 03c413dfd16f415377749baa4fdd41949c6a12b9..d3c6c1b9ac00df265507db61301cae397214dca7 100644
--- a/src/main/java/net/minecraft/server/players/PlayerList.java --- a/src/main/java/net/minecraft/server/players/PlayerList.java
+++ b/src/main/java/net/minecraft/server/players/PlayerList.java +++ b/src/main/java/net/minecraft/server/players/PlayerList.java
@@ -241,7 +241,7 @@ public abstract class PlayerList { @@ -241,7 +241,7 @@ public abstract class PlayerList {

View file

@ -5,10 +5,10 @@ Subject: [PATCH] Validate usernames
diff --git a/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java diff --git a/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java
index c1cb1406bf00843568e94c5d72cf60b3e5455720..a3eeb252954201d3ac8ce0d0fcd1a22be53c32cd 100644 index 2128bafb9b64568ae01a0cfe134185a28be479aa..6445af64bc46270533b79270a3a0eaee15e5ef7b 100644
--- a/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java --- a/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java
@@ -71,6 +71,7 @@ public class ServerLoginPacketListenerImpl implements TickablePacketListener, Se @@ -67,6 +67,7 @@ public class ServerLoginPacketListenerImpl implements TickablePacketListener, Se
private ProfilePublicKey.Data profilePublicKeyData; private ProfilePublicKey.Data profilePublicKeyData;
public String hostname = ""; // CraftBukkit - add field public String hostname = ""; // CraftBukkit - add field
private int velocityLoginMessageId = -1; // Paper - Velocity support private int velocityLoginMessageId = -1; // Paper - Velocity support
@ -16,7 +16,7 @@ index c1cb1406bf00843568e94c5d72cf60b3e5455720..a3eeb252954201d3ac8ce0d0fcd1a22b
public ServerLoginPacketListenerImpl(MinecraftServer server, Connection connection) { public ServerLoginPacketListenerImpl(MinecraftServer server, Connection connection) {
this.state = ServerLoginPacketListenerImpl.State.HELLO; this.state = ServerLoginPacketListenerImpl.State.HELLO;
@@ -272,10 +273,38 @@ public class ServerLoginPacketListenerImpl implements TickablePacketListener, Se @@ -256,10 +257,38 @@ public class ServerLoginPacketListenerImpl implements TickablePacketListener, Se
} }
} }
@ -56,7 +56,7 @@ index c1cb1406bf00843568e94c5d72cf60b3e5455720..a3eeb252954201d3ac8ce0d0fcd1a22b
GameProfile gameprofile = this.server.getSingleplayerProfile(); GameProfile gameprofile = this.server.getSingleplayerProfile();
diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java
index 2595de3d40bc666c3b6e64538127fa9d83a3ef07..80ea6e59a96b1135823ef8bd228b924caf73faed 100644 index 8f89c694e08db71a8e1509a102ad96defe788828..dd06ed2a72df27a6f2bd4014ec9055729e7f2773 100644
--- a/src/main/java/net/minecraft/server/players/PlayerList.java --- a/src/main/java/net/minecraft/server/players/PlayerList.java
+++ b/src/main/java/net/minecraft/server/players/PlayerList.java +++ b/src/main/java/net/minecraft/server/players/PlayerList.java
@@ -708,7 +708,7 @@ public abstract class PlayerList { @@ -708,7 +708,7 @@ public abstract class PlayerList {

View file

@ -5,10 +5,10 @@ Subject: [PATCH] Added getHostname to AsyncPlayerPreLoginEvent
diff --git a/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java diff --git a/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java
index a3eeb252954201d3ac8ce0d0fcd1a22be53c32cd..c36babd85b7d5ba57c08708d0bbf01e16a70a4b2 100644 index 6445af64bc46270533b79270a3a0eaee15e5ef7b..4f194eb6cab2347bc6c61f6cd8c47db7c59ff369 100644
--- a/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java --- a/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java
@@ -454,7 +454,7 @@ public class ServerLoginPacketListenerImpl implements TickablePacketListener, Se @@ -438,7 +438,7 @@ public class ServerLoginPacketListenerImpl implements TickablePacketListener, Se
// Paper start // Paper start
com.destroystokyo.paper.profile.PlayerProfile profile = com.destroystokyo.paper.profile.CraftPlayerProfile.asBukkitMirror(ServerLoginPacketListenerImpl.this.gameProfile); com.destroystokyo.paper.profile.PlayerProfile profile = com.destroystokyo.paper.profile.CraftPlayerProfile.asBukkitMirror(ServerLoginPacketListenerImpl.this.gameProfile);

View file

@ -7,7 +7,7 @@ Makes the PlayerKickEvent fire on the main thread for
illegal characters or chat out-of-order errors. illegal characters or chat out-of-order errors.
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
index dfc4a0d7a5d91d6fb874203c88d051bf42cb7e5c..aedea81d08c2fb0df6471481c89c706c614e9a2f 100644 index c3ce4657e9eed5a398352b362d0ee6a1861708d7..9034b997fdbe5ca1c71eb154205510e99865dc3d 100644
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java --- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
@@ -2177,7 +2177,9 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic @@ -2177,7 +2177,9 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
@ -30,8 +30,8 @@ index dfc4a0d7a5d91d6fb874203c88d051bf42cb7e5c..aedea81d08c2fb0df6471481c89c706c
} else { } else {
if (this.tryHandleChat(packet.command(), packet.timeStamp(), packet.lastSeenMessages())) { if (this.tryHandleChat(packet.command(), packet.timeStamp(), packet.lastSeenMessages())) {
this.server.submit(() -> { this.server.submit(() -> {
@@ -2298,7 +2302,9 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic @@ -2291,7 +2295,9 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
// Paper end private boolean tryHandleChat(String message, Instant timestamp, LastSeenMessages.Update acknowledgment) {
if (!this.updateChatOrder(timestamp)) { if (!this.updateChatOrder(timestamp)) {
ServerGamePacketListenerImpl.LOGGER.warn("{} sent out-of-order chat: '{}'", this.player.getName().getString(), message); ServerGamePacketListenerImpl.LOGGER.warn("{} sent out-of-order chat: '{}'", this.player.getName().getString(), message);
+ this.server.scheduleOnMain(() -> { // Paper - push to main + this.server.scheduleOnMain(() -> { // Paper - push to main

View file

@ -5,10 +5,10 @@ Subject: [PATCH] Prevent tile entity copies loading chunks
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
index baf7d167435a2ebe99c00dfecf3a82079e4ec45a..b2b4c8369d7a1a4f7939621612c69abdb0e607d8 100644 index 79e5814adca6b38c533fae2288726aa1b99de010..ddc1e2d1d7800cbc846fa1fd6af4feb1dd402f63 100644
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java --- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
@@ -3410,7 +3410,12 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic @@ -3411,7 +3411,12 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
BlockPos blockposition = BlockEntity.getPosFromTag(nbttagcompound); BlockPos blockposition = BlockEntity.getPosFromTag(nbttagcompound);
if (this.player.level.isLoaded(blockposition)) { if (this.player.level.isLoaded(blockposition)) {

View file

@ -18,10 +18,10 @@ index 20670bc075c387ee0422eb1014207e26105efccd..bdd6560fe85950b0a857a949cb38c044
if (dedicatedserverproperties.enableQuery) { if (dedicatedserverproperties.enableQuery) {
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
index b2b4c8369d7a1a4f7939621612c69abdb0e607d8..5226d69712d372eaf2e82dca0d224f9853441687 100644 index ddc1e2d1d7800cbc846fa1fd6af4feb1dd402f63..79337f4bee57d86653603b4672d45b14fccec5db 100644
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java --- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
@@ -3006,7 +3006,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic @@ -3007,7 +3007,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
this.player = this.server.getPlayerList().respawn(this.player, false); this.player = this.server.getPlayerList().respawn(this.player, false);
if (this.server.isHardcore()) { if (this.server.isHardcore()) {
this.player.setGameMode(GameType.SPECTATOR, org.bukkit.event.player.PlayerGameModeChangeEvent.Cause.HARDCORE_DEATH, null); // Paper this.player.setGameMode(GameType.SPECTATOR, org.bukkit.event.player.PlayerGameModeChangeEvent.Cause.HARDCORE_DEATH, null); // Paper

View file

@ -5,10 +5,10 @@ Subject: [PATCH] Do not accept invalid client settings
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
index 5226d69712d372eaf2e82dca0d224f9853441687..b47af8a8fd42ba38191e22292f7bc8929ea4a0ed 100644 index 79337f4bee57d86653603b4672d45b14fccec5db..a990e92b9136da4e39497c41ef7d08d7879efc75 100644
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java --- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
@@ -3589,6 +3589,13 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic @@ -3590,6 +3590,13 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
@Override @Override
public void handleClientInformation(ServerboundClientInformationPacket packet) { public void handleClientInformation(ServerboundClientInformationPacket packet) {
PacketUtils.ensureRunningOnSameThread(packet, this, this.player.getLevel()); PacketUtils.ensureRunningOnSameThread(packet, this, this.player.getLevel());

View file

@ -6,24 +6,24 @@ Subject: [PATCH] Add some minimal debug information to chat packet errors
TODO: potentially add some kick leeway TODO: potentially add some kick leeway
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
index b6865ce0d6b0cc5c4366f6977bac2294b628b68e..456a542438e9e2ea47b024daf90d0132b936d02b 100644 index da19def22a2c965039f042766e310de56e126681..9ed83f352cf9d1ea0d869436796f0073412d72c7 100644
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java --- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
@@ -2307,7 +2307,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic @@ -2300,7 +2300,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
}
// Paper end private boolean tryHandleChat(String message, Instant timestamp, LastSeenMessages.Update acknowledgment) {
if (!this.updateChatOrder(timestamp)) { if (!this.updateChatOrder(timestamp)) {
- ServerGamePacketListenerImpl.LOGGER.warn("{} sent out-of-order chat: '{}'", this.player.getName().getString(), message); - ServerGamePacketListenerImpl.LOGGER.warn("{} sent out-of-order chat: '{}'", this.player.getName().getString(), message);
+ ServerGamePacketListenerImpl.LOGGER.warn("{} sent out-of-order chat: '{}': {} > {}", this.player.getName().getString(), message, this.lastChatTimeStamp.get().getEpochSecond(), timestamp.getEpochSecond()); // Paper + 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.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 cause this.disconnect(Component.translatable("multiplayer.disconnect.out_of_order_chat"), org.bukkit.event.player.PlayerKickEvent.Cause.OUT_OF_ORDER_CHAT); // Paper - kick event cause
}); // Paper - push to main }); // Paper - push to main
@@ -2566,7 +2566,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic @@ -2568,7 +2568,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
return false; }
} else {
if (message.hasExpiredServer(Instant.now())) { if (playerchatmessage.hasExpiredServer(Instant.now())) {
- ServerGamePacketListenerImpl.LOGGER.warn("{} sent expired chat: '{}'. Is the client/server system time unsynchronized?", this.player.getName().getString(), message.signedContent().plain()); - ServerGamePacketListenerImpl.LOGGER.warn("{} sent expired chat: '{}'. Is the client/server system time unsynchronized?", this.player.getName().getString(), playerchatmessage.signedContent().plain());
+ ServerGamePacketListenerImpl.LOGGER.warn("{} sent expired chat: '{}'. Is the client/server system time unsynchronized? c: {} s: {}", this.player.getName().getString(), message.signedContent().plain(), message.timeStamp().getEpochSecond(), Instant.now().getEpochSecond()); // Paper + ServerGamePacketListenerImpl.LOGGER.warn("{} sent expired chat: '{}'. Is the client/server system time unsynchronized? c: {} s: {}", this.player.getName().getString(), playerchatmessage.signedContent().plain(), playerchatmessage.timeStamp().getEpochSecond(), Instant.now().getEpochSecond()); // Paper
} }
return true; return true;

View file

@ -5,10 +5,10 @@ Subject: [PATCH] Fix Spigot Config not using commands.spam-exclusions
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
index 456a542438e9e2ea47b024daf90d0132b936d02b..3ec16bc35e29d178d4ed99fbeae559d41361efc3 100644 index 9ed83f352cf9d1ea0d869436796f0073412d72c7..71279d9c4d3c728f828eb8a5a2d7b435e527c01b 100644
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java --- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
@@ -2587,7 +2587,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic @@ -2588,7 +2588,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
} }
// Spigot end // Spigot end
// this.chatSpamTickCount += 20; // this.chatSpamTickCount += 20;

View file

@ -5,15 +5,15 @@ Subject: [PATCH] Remove invalid signature login stacktrace
diff --git a/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java diff --git a/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java
index c36babd85b7d5ba57c08708d0bbf01e16a70a4b2..9a5583696cb847514ada6d6cf05484c1b4f596a5 100644 index 4f194eb6cab2347bc6c61f6cd8c47db7c59ff369..881f6f61015c7f2f28b204467f984dbf8d37d89a 100644
--- a/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java --- a/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java
@@ -182,7 +182,7 @@ public class ServerLoginPacketListenerImpl implements TickablePacketListener, Se @@ -178,7 +178,7 @@ public class ServerLoginPacketListenerImpl implements TickablePacketListener, Se
profilepublickey = ServerLoginPacketListenerImpl.validatePublicKey(this.profilePublicKeyData, this.gameProfile.getId(), signaturevalidator, this.server.enforceSecureProfile()); profilepublickey = ServerLoginPacketListenerImpl.validatePublicKey(this.profilePublicKeyData, this.gameProfile.getId(), signaturevalidator, this.server.enforceSecureProfile());
} catch (ServerLoginPacketListenerImpl.PublicKeyValidationException loginlistener_a) { } catch (ProfilePublicKey.ValidationException profilepublickey_b) {
- ServerLoginPacketListenerImpl.LOGGER.error(loginlistener_a.getMessage(), loginlistener_a.getCause()); - ServerLoginPacketListenerImpl.LOGGER.error("Failed to validate profile key: {}", profilepublickey_b.getMessage());
+ //ServerLoginPacketListenerImpl.LOGGER.error(loginlistener_a.getMessage(), loginlistener_a.getCause()); // Paper - unnecessary stacktrace + // ServerLoginPacketListenerImpl.LOGGER.error("Failed to validate profile key: {}", profilepublickey_b.getMessage()); // Paper - unnecessary log
if (!this.connection.isMemoryConnection()) { if (!this.connection.isMemoryConnection()) {
this.disconnect(loginlistener_a.getComponent()); this.disconnect(profilepublickey_b.getComponent());
return; return;

@ -1 +1 @@
Subproject commit c540b6e228dc33c13c02b2af63a2691cda0cdea8 Subproject commit d96ad8e1e64b7c35bb632339c23621353be1f028

@ -1 +1 @@
Subproject commit caa7c4866ac49b04808b75284715543f221649a5 Subproject commit bf60995c031e1c046dfe1a322b94298426eb2f84

@ -1 +1 @@
Subproject commit 1e3bf58cdb2b099308d94dbc34d950155ee83ac3 Subproject commit ec2b5d4cd1f039ef34be82c2d3954fb1a88bf3b5

@ -1 +1 @@
Subproject commit 21831450a43f67f1730dd0dec987c7a7ff19caa9 Subproject commit 584b459dceac6e6f4708b70706671206d7a2c8ea