Initial support for signed messages (#8198)

This commit is contained in:
Jake Potrebic 2022-08-01 12:34:55 -07:00 committed by GitHub
parent d60497ebf2
commit dd3e4e7bd6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
41 changed files with 1106 additions and 209 deletions

View file

@ -77,16 +77,15 @@ index 79bf95d5a19046b142d0162dd6b739b7f0f52e59..84432bf9dd99332098f952ea777ee97d
doLast {
diff --git a/src/main/java/io/papermc/paper/chat/ChatRenderer.java b/src/main/java/io/papermc/paper/chat/ChatRenderer.java
new file mode 100644
index 0000000000000000000000000000000000000000..2fc47afbb233e6e5727a7b672f61b88ad3bab097
index 0000000000000000000000000000000000000000..ffe0a921cc1ebbb95104f22b57e0e3af85e287a6
--- /dev/null
+++ b/src/main/java/io/papermc/paper/chat/ChatRenderer.java
@@ -0,0 +1,78 @@
@@ -0,0 +1,71 @@
+package io.papermc.paper.chat;
+
+import net.kyori.adventure.audience.Audience;
+import net.kyori.adventure.text.Component;
+import org.bukkit.entity.Player;
+import org.checkerframework.checker.nullness.qual.MonotonicNonNull;
+import org.jetbrains.annotations.ApiStatus;
+import org.jetbrains.annotations.NotNull;
+
@ -115,7 +114,11 @@ index 0000000000000000000000000000000000000000..2fc47afbb233e6e5727a7b672f61b88a
+ */
+ @NotNull
+ static ChatRenderer defaultRenderer() {
+ return viewerUnaware((source, sourceDisplayName, message) -> Component.translatable("chat.type.text", sourceDisplayName, message));
+ return new ViewerUnawareImpl.Default((source, sourceDisplayName, message) -> Component.translatable("chat.type.text", sourceDisplayName, message));
+ }
+
+ @ApiStatus.Internal
+ sealed interface Default extends ChatRenderer, ViewerUnaware permits ViewerUnawareImpl.Default {
+ }
+
+ /**
@ -127,17 +130,7 @@ index 0000000000000000000000000000000000000000..2fc47afbb233e6e5727a7b672f61b88a
+ */
+ @NotNull
+ static ChatRenderer viewerUnaware(final @NotNull ViewerUnaware renderer) {
+ return new ChatRenderer() {
+ private @MonotonicNonNull Component message;
+
+ @Override
+ public @NotNull Component render(final @NotNull Player source, final @NotNull Component sourceDisplayName, final @NotNull Component message, final @NotNull Audience viewer) {
+ if (this.message == null) {
+ this.message = renderer.render(source, sourceDisplayName, message);
+ }
+ return this.message;
+ }
+ };
+ return new ViewerUnawareImpl(renderer);
+ }
+
+ /**
@ -159,6 +152,50 @@ index 0000000000000000000000000000000000000000..2fc47afbb233e6e5727a7b672f61b88a
+ Component render(@NotNull Player source, @NotNull Component sourceDisplayName, @NotNull Component message);
+ }
+}
diff --git a/src/main/java/io/papermc/paper/chat/ViewerUnawareImpl.java b/src/main/java/io/papermc/paper/chat/ViewerUnawareImpl.java
new file mode 100644
index 0000000000000000000000000000000000000000..9adeb880f7948f937891d83e256c808b5eb40a27
--- /dev/null
+++ b/src/main/java/io/papermc/paper/chat/ViewerUnawareImpl.java
@@ -0,0 +1,38 @@
+package io.papermc.paper.chat;
+
+import net.kyori.adventure.audience.Audience;
+import net.kyori.adventure.text.Component;
+import org.bukkit.entity.Player;
+import org.checkerframework.checker.nullness.qual.MonotonicNonNull;
+import org.jetbrains.annotations.NotNull;
+
+sealed class ViewerUnawareImpl implements ChatRenderer, ChatRenderer.ViewerUnaware permits ViewerUnawareImpl.Default {
+
+ private final ViewerUnaware unaware;
+
+ private @MonotonicNonNull Component message;
+
+ ViewerUnawareImpl(final ViewerUnaware unaware) {
+ this.unaware = unaware;
+ }
+
+ @Override
+ public @NotNull Component render(final @NotNull Player source, final @NotNull Component sourceDisplayName, final @NotNull Component message, final @NotNull Audience viewer) {
+ return this.render(source, sourceDisplayName, message);
+ }
+
+ @Override
+ public @NotNull Component render(final @NotNull Player source, final @NotNull Component sourceDisplayName, final @NotNull Component message) {
+ if (this.message == null) {
+ this.message = this.unaware.render(source, sourceDisplayName, message);
+ }
+ return this.message;
+ }
+
+ static final class Default extends ViewerUnawareImpl implements ChatRenderer.Default {
+
+ Default(final ViewerUnaware unaware) {
+ super(unaware);
+ }
+ }
+}
diff --git a/src/main/java/io/papermc/paper/event/player/AbstractChatEvent.java b/src/main/java/io/papermc/paper/event/player/AbstractChatEvent.java
new file mode 100644
index 0000000000000000000000000000000000000000..fa03a5cb2d3e3e0a60d84bacc911d96c454f81da
@ -277,6 +314,164 @@ index 0000000000000000000000000000000000000000..fa03a5cb2d3e3e0a60d84bacc911d96c
+ this.cancelled = cancelled;
+ }
+}
diff --git a/src/main/java/io/papermc/paper/event/player/AsyncChatCommandDecorateEvent.java b/src/main/java/io/papermc/paper/event/player/AsyncChatCommandDecorateEvent.java
new file mode 100644
index 0000000000000000000000000000000000000000..bd216f7333795fc6bc5bec593f9cc0e3c2c1a27e
--- /dev/null
+++ b/src/main/java/io/papermc/paper/event/player/AsyncChatCommandDecorateEvent.java
@@ -0,0 +1,27 @@
+package io.papermc.paper.event.player;
+
+import net.kyori.adventure.text.Component;
+import org.bukkit.entity.Player;
+import org.bukkit.event.HandlerList;
+import org.jetbrains.annotations.ApiStatus;
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
+
+@ApiStatus.Experimental
+public class AsyncChatCommandDecorateEvent extends AsyncChatDecorateEvent {
+
+ private static final HandlerList HANDLER_LIST = new HandlerList();
+
+ public AsyncChatCommandDecorateEvent(boolean async, @Nullable Player player, @NotNull Component originalMessage, boolean isPreview, @NotNull Component result) {
+ super(async, player, originalMessage, isPreview, result);
+ }
+
+ @Override
+ public @NotNull HandlerList getHandlers() {
+ return HANDLER_LIST;
+ }
+
+ public static @NotNull HandlerList getHandlerList() {
+ return HANDLER_LIST;
+ }
+}
diff --git a/src/main/java/io/papermc/paper/event/player/AsyncChatDecorateEvent.java b/src/main/java/io/papermc/paper/event/player/AsyncChatDecorateEvent.java
new file mode 100644
index 0000000000000000000000000000000000000000..347122b12ad98115133ef98db69b271ee0cec194
--- /dev/null
+++ b/src/main/java/io/papermc/paper/event/player/AsyncChatDecorateEvent.java
@@ -0,0 +1,119 @@
+package io.papermc.paper.event.player;
+
+import net.kyori.adventure.text.Component;
+import org.bukkit.entity.Player;
+import org.bukkit.event.Cancellable;
+import org.bukkit.event.HandlerList;
+import org.bukkit.event.server.ServerEvent;
+import org.jetbrains.annotations.ApiStatus;
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
+
+/**
+ * This event is fired when the server decorates a component for chat purposes. It can be called
+ * under the following circumstances:
+ * <ul>
+ * <li><b>Previewing:</b> If the client requests a preview response, this event is fired to decorate the component
+ * before it is sent back to the client for signing.</li>
+ * <li><b>Chat:</b> If the client sends a chat packet without having signed a preview (the client could have previews
+ * disabled or they sent the message too quickly) this event is fired to generated the decorated component. Note
+ * that when this is the case, the message will show up as modified as the decorated component wasn't signed
+ * by the client.</li>
+ * </ul>
+ * @see AsyncChatCommandDecorateEvent for the decoration of messages sent via commands
+ */
+@ApiStatus.Experimental
+public class AsyncChatDecorateEvent extends ServerEvent implements Cancellable {
+
+ private static final HandlerList HANDLER_LIST = new HandlerList();
+
+ private final Player player;
+ private final Component originalMessage;
+ private final boolean isPreview;
+ private Component result;
+ private boolean cancelled;
+
+ @ApiStatus.Internal
+ public AsyncChatDecorateEvent(final boolean async, final @Nullable Player player, final @NotNull Component originalMessage, final boolean isPreview, final @NotNull Component result) {
+ super(async);
+ this.player = player;
+ this.originalMessage = originalMessage;
+ this.isPreview = isPreview;
+ this.result = result;
+ }
+
+ /**
+ * Gets the player (if available) associated with this event.
+ * <p>
+ * Certain commands request decorations without a player context
+ * which is why this is possibly null.
+ *
+ * @return the player or null
+ */
+ public @Nullable Player player() {
+ return this.player;
+ }
+
+ /**
+ * Gets the original decoration input
+ *
+ * @return the input
+ */
+ public @NotNull Component originalMessage() {
+ return this.originalMessage;
+ }
+
+ /**
+ * Gets the decoration result. This may already be different from
+ * {@link #originalMessage()} if some other listener to this event
+ * <b>OR</b> the legacy preview event ({@link org.bukkit.event.player.AsyncPlayerChatPreviewEvent}
+ * changed the result.
+ *
+ * @return the result
+ */
+ public @NotNull Component result() {
+ return this.result;
+ }
+
+ /**
+ * Sets the resulting decorated component.
+ *
+ * @param result the result
+ */
+ public void result(@NotNull Component result) {
+ this.result = result;
+ }
+
+ /**
+ * If this decorating is part of a preview request/response.
+ *
+ * @return true if part of previewing
+ */
+ public boolean isPreview() {
+ return this.isPreview;
+ }
+
+ @Override
+ public boolean isCancelled() {
+ return this.cancelled;
+ }
+
+ /**
+ * A cancelled decorating event means that no changes to the result component
+ * will have any effect. The decorated component will be equal to the original
+ * component.
+ */
+ @Override
+ public void setCancelled(boolean cancel) {
+ this.cancelled = cancel;
+ }
+
+ @Override
+ public @NotNull HandlerList getHandlers() {
+ return HANDLER_LIST;
+ }
+
+ public static @NotNull HandlerList getHandlerList() {
+ return HANDLER_LIST;
+ }
+}
diff --git a/src/main/java/io/papermc/paper/event/player/AsyncChatEvent.java b/src/main/java/io/papermc/paper/event/player/AsyncChatEvent.java
new file mode 100644
index 0000000000000000000000000000000000000000..0d9e3c23027e3af90cb70e4bb6fb0ac1da35fc4d

File diff suppressed because it is too large Load diff

View file

@ -5,10 +5,10 @@ Subject: [PATCH] Implement PlayerLocaleChangeEvent
diff --git a/src/main/java/net/minecraft/server/level/ServerPlayer.java b/src/main/java/net/minecraft/server/level/ServerPlayer.java
index 5ff3bf1c436fd69e6129e59c205f626df9d61e8d..a3410c8f89c4b7f68999aafb090555c7e7513316 100644
index 16c4df6bd5b84b5e7a820ba14f2b2ee80b5b401c..48ffa3fce91ad98d9e4c099aacf6c0a84b2093e4 100644
--- a/src/main/java/net/minecraft/server/level/ServerPlayer.java
+++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java
@@ -1749,7 +1749,7 @@ public class ServerPlayer extends Player {
@@ -1754,7 +1754,7 @@ public class ServerPlayer extends Player {
return s;
}
@ -17,7 +17,7 @@ index 5ff3bf1c436fd69e6129e59c205f626df9d61e8d..a3410c8f89c4b7f68999aafb090555c7
public java.util.Locale adventure$locale = java.util.Locale.US; // Paper
public void updateOptions(ServerboundClientInformationPacket packet) {
// CraftBukkit start
@@ -1757,9 +1757,10 @@ public class ServerPlayer extends Player {
@@ -1762,9 +1762,10 @@ public class ServerPlayer extends Player {
PlayerChangedMainHandEvent event = new PlayerChangedMainHandEvent(this.getBukkitEntity(), getMainArm() == HumanoidArm.LEFT ? MainHand.LEFT : MainHand.RIGHT);
this.server.server.getPluginManager().callEvent(event);
}
@ -30,7 +30,7 @@ index 5ff3bf1c436fd69e6129e59c205f626df9d61e8d..a3410c8f89c4b7f68999aafb090555c7
this.locale = packet.language;
// Paper start
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
index 46abb31a5330662f46949466e01c404ba2922027..b6d03bdd161da73492fb947cc4ca4f6c1ba172f1 100644
index 6d2609222afa3cd5f99118281c20281f8c2f792f..9bcffda912e3cc7322043e705dddfe052f4b1273 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
@@ -1965,8 +1965,10 @@ public class CraftPlayer extends CraftHumanEntity implements Player {

View file

@ -7,10 +7,10 @@ I hope to look at this more in-depth soon. It appears doable.
However this should not block the update.
diff --git a/src/main/java/net/minecraft/server/level/ServerPlayer.java b/src/main/java/net/minecraft/server/level/ServerPlayer.java
index a3410c8f89c4b7f68999aafb090555c7e7513316..b6a19cd2cfd8acfac6dde77033bbb82ef20586d0 100644
index 48ffa3fce91ad98d9e4c099aacf6c0a84b2093e4..28d8ba2f421245ab6707ea982e76d543916a1e51 100644
--- a/src/main/java/net/minecraft/server/level/ServerPlayer.java
+++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java
@@ -2232,4 +2232,6 @@ public class ServerPlayer extends Player {
@@ -2237,4 +2237,6 @@ public class ServerPlayer extends Player {
return (CraftPlayer) super.getBukkitEntity();
}
// CraftBukkit end
@ -60,7 +60,7 @@ index cf7762e76a2d35acdfc12627e9750fbec766d555..40d6b00fb40db167c6c80b6a3f79eb82
// Spigot start
private final org.bukkit.World.Spigot spigot = new org.bukkit.World.Spigot()
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
index b6d03bdd161da73492fb947cc4ca4f6c1ba172f1..b73b202a3c68ba559b65245186a97025bda25134 100644
index 9bcffda912e3cc7322043e705dddfe052f4b1273..62a4ae1ee2a0784787b6f45bff6393630e1d4219 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
@@ -402,6 +402,46 @@ public class CraftPlayer extends CraftHumanEntity implements Player {

View file

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

View file

@ -12,29 +12,31 @@ for this on CB at one point but I can't find it. We may need to do this
ourselves at some point in the future.
diff --git a/src/main/java/io/papermc/paper/adventure/ChatProcessor.java b/src/main/java/io/papermc/paper/adventure/ChatProcessor.java
index 3526bc0b6ad590776124966ea907fe2467cbbf5f..b13d516d91788713768b5c336537ffe31653b074 100644
index bc37199f1d181f572da518d9b93b2980504024b1..d5e0ed2adba4e22b9842110ddf009f47187840e4 100644
--- a/src/main/java/io/papermc/paper/adventure/ChatProcessor.java
+++ b/src/main/java/io/papermc/paper/adventure/ChatProcessor.java
@@ -16,6 +16,8 @@ import net.kyori.adventure.text.event.ClickEvent;
import net.kyori.adventure.text.serializer.legacy.LegacyComponentSerializer;
@@ -24,8 +24,10 @@ import net.minecraft.network.chat.PlayerChatMessage;
import net.minecraft.resources.ResourceKey;
import net.minecraft.server.MinecraftServer;
import net.minecraft.server.level.ServerPlayer;
+import org.bukkit.ChatColor;
import org.bukkit.command.CommandSender;
import org.bukkit.command.ConsoleCommandSender;
+import org.bukkit.craftbukkit.CraftWorld;
import org.bukkit.craftbukkit.entity.CraftPlayer;
import org.bukkit.craftbukkit.util.LazyPlayerSet;
import org.bukkit.craftbukkit.util.Waitable;
@@ -154,10 +156,16 @@ public final class ChatProcessor {
@@ -329,10 +331,16 @@ public final class ChatProcessor {
}
private static String legacyDisplayName(final CraftPlayer player) {
static String legacyDisplayName(final CraftPlayer player) {
+ if (((org.bukkit.craftbukkit.CraftWorld) player.getWorld()).getHandle().paperConfig().scoreboards.useVanillaWorldScoreboardNameColoring) {
+ return LegacyComponentSerializer.legacySection().serialize(player.teamDisplayName()) + ChatColor.RESET;
+ return legacySection().serialize(player.teamDisplayName()) + ChatColor.RESET;
+ }
return player.getDisplayName();
}
private static Component displayName(final CraftPlayer player) {
static Component displayName(final CraftPlayer player) {
+ if (((CraftWorld) player.getWorld()).getHandle().paperConfig().scoreboards.useVanillaWorldScoreboardNameColoring) {
+ return player.teamDisplayName();
+ }

View file

@ -6,10 +6,10 @@ Subject: [PATCH] Properly fix item duplication bug
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
index b117a98dea77755bee33f8a141f8df16b587beeb..8f4b8e4911d5c3bb82c9ac246c041c0eb51a3123 100644
index 9cd5bf2890fbb0bdb8eb79b1659fe7058dbe08e9..b239654eb92f95cb855cd3d750c79f98893f9980 100644
--- a/src/main/java/net/minecraft/server/level/ServerPlayer.java
+++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java
@@ -2189,7 +2189,7 @@ public class ServerPlayer extends Player {
@@ -2194,7 +2194,7 @@ public class ServerPlayer extends Player {
@Override
public boolean isImmobile() {
@ -19,10 +19,10 @@ index b117a98dea77755bee33f8a141f8df16b587beeb..8f4b8e4911d5c3bb82c9ac246c041c0e
@Override
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
index 50759c53b46b913ac7ff56476d2a49163e54fff4..44daf6210786748f44275a97ecebbd191837b5e5 100644
index 26e10d245adbac49f9c30ada74729444fe0fedaf..21e1520e30a4655c679b3f3b4f8f8e053f245aca 100644
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
@@ -3252,7 +3252,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
@@ -3258,7 +3258,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
}
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?
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
index 44daf6210786748f44275a97ecebbd191837b5e5..7bf555082539dc6cc4151df875b048b85fdba020 100644
index 21e1520e30a4655c679b3f3b4f8f8e053f245aca..7a55caac4bf216484780e243ae2b58798ceea520 100644
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
@@ -2438,6 +2438,13 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
@@ -2444,6 +2444,13 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
switch (packet.getAction()) {
case PRESS_SHIFT_KEY:
this.player.setShiftKeyDown(true);

View file

@ -15,10 +15,10 @@ also adding some additional logging in order to help work out what is causing
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
index f7da31103f75e6bdc06f28a35e3341ec360bd245..49f7840a04f12ae6a28f3e0282d3e4529496c736 100644
index 12325f4eafb7c7f4fd273464c1244d8c4f99fce7..d2641f1aad42f9e3930e5fe106a3a40f833e3945 100644
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
@@ -3211,14 +3211,18 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
@@ -3217,14 +3217,18 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
@Override
public void handleKeepAlive(ServerboundKeepAlivePacket packet) {

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
index dc3725622f8ae2832ff4329aa78395c5cc67c02f..5bd5cde911520eb0da695b961867a52845ad416f 100644
index b465bf1a3ffa9fd164592967c6ebbab85f374a73..a0b52f23170cc7b75b556dd8223c16881abd7f3b 100644
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
@@ -3217,9 +3217,9 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
@@ -3223,9 +3223,9 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
FilteredText filteredtext = (FilteredText) signText.get(i);
if (this.player.isTextFilteringEnabled()) {

View file

@ -29,7 +29,7 @@ index 3d3926a14229d922fb7b7e76c9babb031bf7d9ab..5029436157fe7279a2a583f06b7d02a0
}
// Spigot End
diff --git a/src/main/java/net/minecraft/server/level/ServerPlayer.java b/src/main/java/net/minecraft/server/level/ServerPlayer.java
index a9497e21c87e785631788968bc4922f6261169f9..522c8791edd87feb6cb32ef8e621ae35e53c9cb1 100644
index dac7d458f161bc7449fee7142ac6cc95bf92388d..c14854f653342a6c4c8e520c3821866472d3c8af 100644
--- a/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 {
@ -75,7 +75,7 @@ index a9497e21c87e785631788968bc4922f6261169f9..522c8791edd87feb6cb32ef8e621ae35
this.doCloseContainer();
}
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
index 5bd5cde911520eb0da695b961867a52845ad416f..57e3301e5b18d90d6f499fa6a544866a5eca01a9 100644
index a0b52f23170cc7b75b556dd8223c16881abd7f3b..231e3dfecbc2fee1889f29821201a574f22d73e5 100644
--- a/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;
@ -86,7 +86,7 @@ index 5bd5cde911520eb0da695b961867a52845ad416f..57e3301e5b18d90d6f499fa6a544866a
import org.bukkit.event.inventory.InventoryCreativeEvent;
import org.bukkit.event.inventory.InventoryType.SlotType;
import org.bukkit.event.inventory.SmithItemEvent;
@@ -2743,10 +2744,15 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
@@ -2749,10 +2750,15 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
@Override
public void handleContainerClose(ServerboundContainerClosePacket packet) {
@ -104,7 +104,7 @@ index 5bd5cde911520eb0da695b961867a52845ad416f..57e3301e5b18d90d6f499fa6a544866a
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
index 29f761432be28b5089caab9338b3bff41f4f8f07..2ad88d72a9d14c7e73a824544a1ebcb6bb74a127 100644
index 861f736c32d85abbce8dfade503ec0976aa7a275..a7d7882652c9361f37dfcbaec3872a50e048b4b9 100644
--- a/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 {
@ -173,7 +173,7 @@ index 4ff81744b7c9113f57cf1fa89bb943902711b2dc..404ed5e8f54d70a50de4232c6ea0f616
@Override
public boolean isBlocking() {
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
index c63831b9ec29ea1589cc87fbe4615f6dfddce473..f5259ada3e21b036fd3e3b96d727f1c8c4a042b8 100644
index 3ff83fcee396b220cc1977f85ce3af399a4c2802..0c6226292f1928f657ea77529992123ad6f7bc9b 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
@@ -1079,7 +1079,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player {

View file

@ -16,10 +16,10 @@ Refresh the player inventory when PlayerInteractEntityEvent is
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
index 57e3301e5b18d90d6f499fa6a544866a5eca01a9..15e69839cb1da5f0402e9abd155fb67d323b8f5d 100644
index 231e3dfecbc2fee1889f29821201a574f22d73e5..b3570e63957efea26e1538f1cb44304c22b84040 100644
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
@@ -2628,6 +2628,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
@@ -2634,6 +2634,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
}
if (event.isCancelled()) {

View file

@ -19,10 +19,10 @@ spectate the target entity.
Co-authored-by: Spottedleaf <Spottedleaf@users.noreply.github.com>
diff --git a/src/main/java/net/minecraft/server/level/ServerPlayer.java b/src/main/java/net/minecraft/server/level/ServerPlayer.java
index 1b3188837069622baaba90c80fe387abfbfad10a..f9cd8040f0782c0c0543c8a9f52727ba838f987f 100644
index 56b1c585d1c330bf9b904ebf8ef0b8be47102aa3..e4f991578d4ee581e65f2edb7d32640ff36a01bd 100644
--- a/src/main/java/net/minecraft/server/level/ServerPlayer.java
+++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java
@@ -1870,14 +1870,58 @@ public class ServerPlayer extends Player {
@@ -1875,14 +1875,58 @@ public class ServerPlayer extends Player {
}
public void setCamera(@Nullable Entity entity) {

View file

@ -5,10 +5,10 @@ Subject: [PATCH] Reset players airTicks on respawn
diff --git a/src/main/java/net/minecraft/server/level/ServerPlayer.java b/src/main/java/net/minecraft/server/level/ServerPlayer.java
index f9cd8040f0782c0c0543c8a9f52727ba838f987f..ca3206ad7c6e4acf31eda406c439fc7c70e47c01 100644
index e4f991578d4ee581e65f2edb7d32640ff36a01bd..c5120e5e7414a6b870eab877605e9bb52db3e8cb 100644
--- a/src/main/java/net/minecraft/server/level/ServerPlayer.java
+++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java
@@ -2283,6 +2283,7 @@ public class ServerPlayer extends Player {
@@ -2288,6 +2288,7 @@ public class ServerPlayer extends Player {
this.setHealth(this.getMaxHealth());
this.stopUsingItem(); // CraftBukkit - SPIGOT-6682: Clear active item on reset

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
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
index ed272499b40a96efd83f1a09a063e4d65dbe48e8..32c89f89fc9dbcdc9528acf46415b4d7c6475ff3 100644
index 9c0d8f6cb9e447d33f04535d96f2fc8d11d66cf7..fff1873ee166d9fae98474ee81f6509c561b3b64 100644
--- a/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
@ -33,7 +33,7 @@ index ed272499b40a96efd83f1a09a063e4d65dbe48e8..32c89f89fc9dbcdc9528acf46415b4d7
public ServerGamePacketListenerImpl(MinecraftServer server, Connection connection, ServerPlayer player) {
this.lastChatTimeStamp = new AtomicReference(Instant.EPOCH);
@@ -3262,7 +3263,19 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
@@ -3268,7 +3269,19 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
@Override
public void handleSignUpdate(ServerboundSignUpdatePacket packet) {

View file

@ -22,10 +22,10 @@ index d6f34adbdf45bbef4a39e629dd7cb6d7fcb5db0f..7881176a900daa3306c691454f688c1f
this.broadcast.accept(packet);
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
index 32c89f89fc9dbcdc9528acf46415b4d7c6475ff3..30b65246eacf2955a52bbf46856ca82ae9e1d5cb 100644
index fff1873ee166d9fae98474ee81f6509c561b3b64..29e6f4726016a62b22588f0efd0284e49fe5a33b 100644
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
@@ -2703,7 +2703,14 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
@@ -2709,7 +2709,14 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
if (event.isCancelled() || ServerGamePacketListenerImpl.this.player.getInventory().getSelected() == null || ServerGamePacketListenerImpl.this.player.getInventory().getSelected().getItem() != origItem) {
// Refresh the current entity metadata

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
index 83d9eac28a08bc075904d274effed54de77be6bf..00f9b6213a7289ea8d48fcf41d701bde5497006d 100644
index 4e4af6e79c126a8b21dea16cb0311e80e23f1d66..ae42daea9aaca1f0c19c26232e51e185353fe717 100644
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
@@ -3307,6 +3307,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
@@ -3313,6 +3313,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
if (!tileentitysign.isEditable() || !this.player.getUUID().equals(tileentitysign.getPlayerWhoMayEdit())) {
ServerGamePacketListenerImpl.LOGGER.warn("Player {} just tried to change non-editable sign", this.player.getName().getString());

View file

@ -125,7 +125,7 @@ index 6a00f3d38da8107825ab1d405f337fd077b09f72..d31b5ed47cffc61c90c926a0cd2005b7
public static void registerCommands(final MinecraftServer server) {
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
index 19f38a8d66846d859dd46fb53f3224fe0d7f2eb8..f5fc952e119723d7761408d8ffb95e869d01cb81 100644
index e8b826e431229b80fbba2bcdaed2105e6a9bcbdd..7b646a46d561c3cdb03a488d691e811d40684417 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
@@ -237,6 +237,11 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
@ -153,7 +153,7 @@ index 19f38a8d66846d859dd46fb53f3224fe0d7f2eb8..f5fc952e119723d7761408d8ffb95e86
this.frameTimer.logFrameDuration(i1 - i);
this.profiler.pop();
org.spigotmc.WatchdogThread.tick(); // Spigot
@@ -2534,4 +2545,30 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
@@ -2522,4 +2533,30 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
public static record ServerResourcePackInfo(String url, String hash, boolean isRequired, @Nullable Component prompt) {
}

View file

@ -85,10 +85,10 @@ index 0000000000000000000000000000000000000000..b6f4400df3d8ec7e06a996de54f8cabb
+ }
+}
diff --git a/src/main/java/net/minecraft/server/level/ServerPlayer.java b/src/main/java/net/minecraft/server/level/ServerPlayer.java
index 0b173c66aaab86ca33eb32ac912543ebcb7c380d..db8400c7ca9aad9aeee192427661c76778bf9e47 100644
index 134579ef5c3b5995f59db8dc2720a62a8016ae95..0b3c81dedd618c613e6ddaf07df2b652b2051ce1 100644
--- a/src/main/java/net/minecraft/server/level/ServerPlayer.java
+++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java
@@ -1850,6 +1850,7 @@ public class ServerPlayer extends Player {
@@ -1855,6 +1855,7 @@ public class ServerPlayer extends Player {
public String locale = null; // CraftBukkit - add, lowercase // Paper - default to null
public java.util.Locale adventure$locale = java.util.Locale.US; // Paper
public void updateOptions(ServerboundClientInformationPacket packet) {
@ -97,7 +97,7 @@ index 0b173c66aaab86ca33eb32ac912543ebcb7c380d..db8400c7ca9aad9aeee192427661c767
if (getMainArm() != packet.mainHand()) {
PlayerChangedMainHandEvent event = new PlayerChangedMainHandEvent(this.getBukkitEntity(), getMainArm() == HumanoidArm.LEFT ? MainHand.LEFT : MainHand.RIGHT);
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
index c8b9c55c2d927ed5f9a0597822ceef95842abe5e..14dc5a18bffc4d8a7d3e786142a3fd853aaeeac4 100644
index bd6dae9bacf4159531cafa1cf3efa1cca821c003..c0386e0ebbf5db991c3e4af9ca9eaedd5fec0fc7 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
@@ -574,6 +574,24 @@ public class CraftPlayer extends CraftHumanEntity implements Player {

View file

@ -522,19 +522,6 @@ index 2d1db70456b746c8fab77893cb34240e573b92ca..7e11d760f84d2cda85e686c5eca764e6
});
private final PacketFlow receiving;
private final Queue<Connection.PacketHolder> queue = Queues.newConcurrentLinkedQueue();
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
index af2d703fe3cb74ced502ca89c5bf6ca1f47474bb..7ca8941ade15c073939c198334bfba78dfcc3c08 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
@@ -2527,7 +2527,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
// CraftBukkit start
public final java.util.concurrent.ExecutorService chatExecutor = java.util.concurrent.Executors.newCachedThreadPool(
- new com.google.common.util.concurrent.ThreadFactoryBuilder().setDaemon(true).setNameFormat("Async Chat Thread - #%d").build());
+ new com.google.common.util.concurrent.ThreadFactoryBuilder().setDaemon(true).setNameFormat("Async Chat Thread - #%d").setUncaughtExceptionHandler(new net.minecraft.DefaultUncaughtExceptionHandlerWithName(net.minecraft.server.MinecraftServer.LOGGER)).build()); // Paper
public ChatDecorator getChatDecorator() {
return (entityplayer, ichatbasecomponent) -> {
diff --git a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
index 648bc209938364a387c3f81dcd073db398e9f864..e42df2956e2d852a5a4c8fdeda395a3efd32c44c 100644
--- a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java

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
index a42d153d861134a1255e302b44b291f6f36132ce..38f514320de5a2b3c09e288f7fb1b88c1662e9f8 100644
index 6d4923a8a563918cf9db73f1f6e1ef5699d10a79..651bf74a4d09e2d0611f86a8e865c065cb0e9327 100644
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
@@ -3204,9 +3204,15 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
@@ -3210,9 +3210,15 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
if (!this.player.containerMenu.stillValid(this.player)) {
ServerGamePacketListenerImpl.LOGGER.debug("Player {} interacted with invalid menu {}", this.player, this.player.containerMenu);
} else {

View file

@ -8,7 +8,7 @@ makes it so that the server keeps the last difficulty used instead
of restoring the server.properties every single load.
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
index e2ba646cf628c3791e8a5b1195f985cb1b3e6916..546ee711f3a11789647b021383841a332cc9c72f 100644
index aeaa34a17e7d0240a87a62a8a7cc5ca620b16d2b..db490f74834715c8382a9c5ff076d7e89fd4dec3 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
@@ -791,7 +791,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
@ -76,7 +76,7 @@ index e42df2956e2d852a5a4c8fdeda395a3efd32c44c..da83f111199a6b4c712a9bb8ab6f1d1b
@Override
diff --git a/src/main/java/net/minecraft/server/level/ServerPlayer.java b/src/main/java/net/minecraft/server/level/ServerPlayer.java
index be00b0f9c15e1e7c22c2d2ebf3063639520f2030..b0dffb7c7c8fece2528ac218acef428731145b92 100644
index c114902d333b134fadbedbfaffab263e2ee48f54..c8a1192ff7d6594721ee85409de711d79a5923f5 100644
--- a/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 {
@ -89,10 +89,10 @@ index be00b0f9c15e1e7c22c2d2ebf3063639520f2030..b0dffb7c7c8fece2528ac218acef4287
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
index 3bf70e93d47b2738f6f840b1f4fb71915519077c..a29b1bdac36b3fc10bc7a8c1be6602e3c31b1d7c 100644
index be784f489ea32dc482cd976559ecd0d51bbda236..80bc911e50714c04b48181c668b9bf0c859f7ae3 100644
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
@@ -3474,7 +3474,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
@@ -3480,7 +3480,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
public void handleChangeDifficulty(ServerboundChangeDifficultyPacket packet) {
PacketUtils.ensureRunningOnSameThread(packet, this, this.player.getLevel());
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
index a29b1bdac36b3fc10bc7a8c1be6602e3c31b1d7c..5a33dd6575a4453694736e39652c1da2486c98d7 100644
index 80bc911e50714c04b48181c668b9bf0c859f7ae3..811e7daf0efe2c0905f3a62c5eda7ab2aa5733c1 100644
--- a/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
@ -17,7 +17,7 @@ index a29b1bdac36b3fc10bc7a8c1be6602e3c31b1d7c..5a33dd6575a4453694736e39652c1da2
public ServerGamePacketListenerImpl(MinecraftServer server, Connection connection, ServerPlayer player) {
this.lastChatTimeStamp = new AtomicReference(Instant.EPOCH);
this.lastSeenMessagesValidator = new LastSeenMessagesValidator();
@@ -3429,6 +3431,8 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
@@ -3435,6 +3437,8 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
private static final ResourceLocation CUSTOM_REGISTER = new ResourceLocation("register");
private static final ResourceLocation CUSTOM_UNREGISTER = new ResourceLocation("unregister");
@ -26,7 +26,7 @@ index a29b1bdac36b3fc10bc7a8c1be6602e3c31b1d7c..5a33dd6575a4453694736e39652c1da2
@Override
public void handleCustomPayload(ServerboundCustomPayloadPacket packet) {
PacketUtils.ensureRunningOnSameThread(packet, this, this.player.getLevel());
@@ -3456,6 +3460,15 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
@@ -3462,6 +3466,15 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
try {
byte[] data = new byte[packet.data.readableBytes()];
packet.data.readBytes(data);
@ -42,7 +42,7 @@ index a29b1bdac36b3fc10bc7a8c1be6602e3c31b1d7c..5a33dd6575a4453694736e39652c1da2
this.cserver.getMessenger().dispatchIncomingMessage(this.player.getBukkitEntity(), packet.identifier.toString(), data);
} catch (Exception ex) {
ServerGamePacketListenerImpl.LOGGER.error("Couldn\'t dispatch custom payload", ex);
@@ -3465,6 +3478,12 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
@@ -3471,6 +3484,12 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
}
@ -56,7 +56,7 @@ index a29b1bdac36b3fc10bc7a8c1be6602e3c31b1d7c..5a33dd6575a4453694736e39652c1da2
return (!this.player.joining && !this.connection.isConnected()) || this.processedDisconnect; // Paper
}
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
index 593925b1f20f94d7cd25492e0a70b9558c8b63c6..7783ba0edd8fb3f102769eeb4d755f915c8f7820 100644
index 485d75f21825b2c6c768db8cc59562355c29fedc..d9aaade15a58e90f71ad29f78bab65372d5f59f1 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
@@ -2691,6 +2691,13 @@ public class CraftPlayer extends CraftHumanEntity implements Player {

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
index 0ddc1d16255d0c4a4bbfaccc9e167a83fc221485..7f91a1129a7702a4cff001de791514a37f9def09 100644
index a57368d04ed6d13405d78548f20f3e107287d197..a514912127a6a353b98d29c336e9b8d2c0c0ec8b 100644
--- a/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
@ -24,7 +24,7 @@ index 0ddc1d16255d0c4a4bbfaccc9e167a83fc221485..7f91a1129a7702a4cff001de791514a3
/* Use thread-safe field access instead
if (this.chatSpamTickCount > 0) {
--this.chatSpamTickCount;
@@ -3223,6 +3225,14 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
@@ -3229,6 +3231,14 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
@Override
public void handlePlaceRecipe(ServerboundPlaceRecipePacket packet) {

View file

@ -5,10 +5,10 @@ Subject: [PATCH] Player Chunk Load/Unload Events
diff --git a/src/main/java/net/minecraft/server/level/ServerPlayer.java b/src/main/java/net/minecraft/server/level/ServerPlayer.java
index 8c6f55efb555c9ca7253ccc1cd9ba615cfb1171c..345091d6ba617c26ac7acfd88eb023f2ec8fae11 100644
index 6cb4cda5235ca6c54158d6980526e3d5fceae829..5f1ec63ae45cf3f53cb6c5b55ccdb3962b1ebd72 100644
--- a/src/main/java/net/minecraft/server/level/ServerPlayer.java
+++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java
@@ -2129,11 +2129,21 @@ public class ServerPlayer extends Player {
@@ -2134,11 +2134,21 @@ public class ServerPlayer extends Player {
public void trackChunk(ChunkPos chunkPos, Packet<?> chunkDataPacket) {
this.connection.send(chunkDataPacket);

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
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
index 7f91a1129a7702a4cff001de791514a37f9def09..6525d8cee86928158dfd121ff11d18b088898a67 100644
index a514912127a6a353b98d29c336e9b8d2c0c0ec8b..52e928b0ca0e3b0c31a80cc2b3d3deba07d41da8 100644
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
@@ -1845,7 +1845,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
@ -18,7 +18,7 @@ index 7f91a1129a7702a4cff001de791514a37f9def09..6525d8cee86928158dfd121ff11d18b0
this.player.swing(enumhand, true);
}
}
@@ -2591,7 +2591,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
@@ -2597,7 +2597,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
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));

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
index 125cc1951c785fd1a75569f57f779626a1fbe586..035b8a49c3647be3c2e6478767078d6dd14e6208 100644
index e23c6bad7e0b83c4eae581ac638f2e7b2a32458e..5e8f6f36d259526e97d926ed83ef0e6d7b618021 100644
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
@@ -2876,7 +2876,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
@@ -2882,7 +2882,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
case PERFORM_RESPAWN:
if (this.player.wonGame) {
this.player.wonGame = false;
@ -18,7 +18,7 @@ index 125cc1951c785fd1a75569f57f779626a1fbe586..035b8a49c3647be3c2e6478767078d6d
} else {
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
index f58f35cdab48066688cf4cf16fc4819229d2191d..bdb37391b9df7ec4983728de8324aa3f1ed20f4b 100644
index 9f50af39555a90fd4e3b9131286107b9ef971270..3adc2fcded1d7bb7cb892eccc96f43facd404045 100644
--- a/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 {

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
index d8bbab6af9625cdb411df0099261f97f59daacb4..607a44d2db927e579d8be7c52021d7bb205a379c 100644
index ec46dda11b527e2e31d8025416c83d11153edc8c..705201ced84717180b9b6cfc2111f0557cca56ab 100644
--- a/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 {
@ -75,7 +75,7 @@ index d8bbab6af9625cdb411df0099261f97f59daacb4..607a44d2db927e579d8be7c52021d7bb
}
}
@@ -2220,6 +2227,16 @@ public class ServerPlayer extends Player {
@@ -2225,6 +2232,16 @@ public class ServerPlayer extends Player {
}
public void loadGameTypes(@Nullable CompoundTag nbt) {
@ -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
index 035b8a49c3647be3c2e6478767078d6dd14e6208..9ad786bb2fd516e167c3ec55e854155d64dd73a5 100644
index 5e8f6f36d259526e97d926ed83ef0e6d7b618021..2ee76d9c5fb22e792618d8c865e7fb9a335202a6 100644
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
@@ -2885,7 +2885,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
@@ -2891,7 +2891,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
this.player = this.server.getPlayerList().respawn(this.player, false);
if (this.server.isHardcore()) {
@ -139,7 +139,7 @@ index 035b8a49c3647be3c2e6478767078d6dd14e6208..9ad786bb2fd516e167c3ec55e854155d
}
}
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
index c6019b688eed5426e21f2950065363268f8285a5..60024a387429a13593f7f709004282d27678cbbe 100644
index f2af098691d3e6951e17645c3eee019000fb4882..c65621c97f05ee5c7be0fd485b6fb9c703d00406 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
@@ -1396,7 +1396,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player {

View file

@ -5,7 +5,7 @@ Subject: [PATCH] Add PlayerKickEvent causes
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
index db60b41f7da9caebfb798ed39ccac51d15bd1324..1376f0aa4ec2c37a64d208168c0160255aa4899b 100644
index 2ea4e4ecae33ba42d559133453fea064b8359d46..2fb7bdb18f1528fd496971b5f9445339b4239720 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
@@ -2101,7 +2101,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
@ -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
index 2217d9b3bb589278da5b421ffce9e00261d08469..26b0bc810b4b09df9c910e3b8b49c18ddd65f832 100644
index 45719d7613629862613539f38614b571776e7719..d481d044916d76ed3dba031df256668cf2950d52 100644
--- a/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
@ -267,7 +267,7 @@ index 2217d9b3bb589278da5b421ffce9e00261d08469..26b0bc810b4b09df9c910e3b8b49c18d
return false;
} 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));
@@ -2450,7 +2460,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
@@ -2453,7 +2463,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
ChatSender chatsender = this.player.asChatSender();
if (chatsender.profilePublicKey() != null && !message.verify(chatsender)) {
@ -276,7 +276,7 @@ index 2217d9b3bb589278da5b421ffce9e00261d08469..26b0bc810b4b09df9c910e3b8b49c18d
return false;
} else {
if (message.hasExpiredServer(Instant.now())) {
@@ -2477,7 +2487,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
@@ -2480,7 +2490,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
// this.chatSpamTickCount += 20;
if (this.chatSpamTickCount.addAndGet(20) > 200 && !this.server.getPlayerList().isOp(this.player.getGameProfile())) {
// CraftBukkit end
@ -285,7 +285,7 @@ index 2217d9b3bb589278da5b421ffce9e00261d08469..26b0bc810b4b09df9c910e3b8b49c18d
}
}
@@ -2577,7 +2587,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
@@ -2583,7 +2593,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
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(",")));
@ -294,7 +294,7 @@ index 2217d9b3bb589278da5b421ffce9e00261d08469..26b0bc810b4b09df9c910e3b8b49c18d
}
@Override
@@ -2724,7 +2734,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
@@ -2730,7 +2740,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
}
if (i > 4096) {
@ -303,7 +303,7 @@ index 2217d9b3bb589278da5b421ffce9e00261d08469..26b0bc810b4b09df9c910e3b8b49c18d
}
}
@@ -2739,7 +2749,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
@@ -2745,7 +2755,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
// Spigot Start
if ( entity == this.player && !this.player.isSpectator() )
{
@ -312,7 +312,7 @@ index 2217d9b3bb589278da5b421ffce9e00261d08469..26b0bc810b4b09df9c910e3b8b49c18d
return;
}
// Spigot End
@@ -2832,7 +2842,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
@@ -2838,7 +2848,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
}
// CraftBukkit end
} else {
@ -321,7 +321,7 @@ index 2217d9b3bb589278da5b421ffce9e00261d08469..26b0bc810b4b09df9c910e3b8b49c18d
ServerGamePacketListenerImpl.LOGGER.warn("Player {} tried to attack an invalid entity", ServerGamePacketListenerImpl.this.player.getName().getString());
}
}
@@ -3240,7 +3250,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
@@ -3246,7 +3256,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
// Paper start
if (!org.bukkit.Bukkit.isPrimaryThread()) {
if (recipeSpamPackets.addAndGet(io.papermc.paper.configuration.GlobalConfiguration.get().spamLimiter.recipeSpamIncrement) > io.papermc.paper.configuration.GlobalConfiguration.get().spamLimiter.recipeSpamLimit) {
@ -330,7 +330,7 @@ index 2217d9b3bb589278da5b421ffce9e00261d08469..26b0bc810b4b09df9c910e3b8b49c18d
return;
}
}
@@ -3443,7 +3453,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
@@ -3449,7 +3459,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
} else if (!this.isSingleplayerOwner()) {
// Paper start - This needs to be handled on the main thread for plugins
server.submit(() -> {
@ -339,7 +339,7 @@ index 2217d9b3bb589278da5b421ffce9e00261d08469..26b0bc810b4b09df9c910e3b8b49c18d
});
// Paper end
}
@@ -3489,7 +3499,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
@@ -3495,7 +3505,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
}
} catch (Exception ex) {
ServerGamePacketListenerImpl.LOGGER.error("Couldn\'t register custom payload", ex);
@ -348,7 +348,7 @@ index 2217d9b3bb589278da5b421ffce9e00261d08469..26b0bc810b4b09df9c910e3b8b49c18d
}
} else if (packet.identifier.equals(CUSTOM_UNREGISTER)) {
try {
@@ -3499,7 +3509,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
@@ -3505,7 +3515,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
}
} catch (Exception ex) {
ServerGamePacketListenerImpl.LOGGER.error("Couldn\'t unregister custom payload", ex);
@ -357,7 +357,7 @@ index 2217d9b3bb589278da5b421ffce9e00261d08469..26b0bc810b4b09df9c910e3b8b49c18d
}
} else {
try {
@@ -3517,7 +3527,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
@@ -3523,7 +3533,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
this.cserver.getMessenger().dispatchIncomingMessage(this.player.getBukkitEntity(), packet.identifier.toString(), data);
} catch (Exception ex) {
ServerGamePacketListenerImpl.LOGGER.error("Couldn\'t dispatch custom payload", ex);
@ -367,7 +367,7 @@ index 2217d9b3bb589278da5b421ffce9e00261d08469..26b0bc810b4b09df9c910e3b8b49c18d
}
diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java
index bdb37391b9df7ec4983728de8324aa3f1ed20f4b..ca0ad4fd5f4aafacd197494970f2aec3b2a6c4d0 100644
index 3adc2fcded1d7bb7cb892eccc96f43facd404045..e6a5c5da58403ca5498d8741bc520b8e68c56310 100644
--- a/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 {

View file

@ -5,10 +5,10 @@ Subject: [PATCH] Fix PlayerDropItemEvent using wrong item
diff --git a/src/main/java/net/minecraft/server/level/ServerPlayer.java b/src/main/java/net/minecraft/server/level/ServerPlayer.java
index 607a44d2db927e579d8be7c52021d7bb205a379c..6e53214042ab515d9c66fb24f6aa1c07d6c3539d 100644
index 705201ced84717180b9b6cfc2111f0557cca56ab..af1aedd970778e69845f093581ad401da5e99adb 100644
--- a/src/main/java/net/minecraft/server/level/ServerPlayer.java
+++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java
@@ -2196,7 +2196,7 @@ public class ServerPlayer extends Player {
@@ -2201,7 +2201,7 @@ public class ServerPlayer extends Player {
if (retainOwnership) {
if (!itemstack1.isEmpty()) {

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
index 685745b853f86fa2eda031ad20317ad321b1379a..c65c72a2dd3c87621c1369c52770b912057eafd2 100644
index 87cdc22491da7deb4d61809bed6aea8bf44a6fbb..302f7ee99460efba88eabfa661ad6f6a46e92d17 100644
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
@@ -2618,7 +2618,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
@@ -2624,7 +2624,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
}
// Arm swing animation

View file

@ -32,7 +32,7 @@ index ce1c7512cc368e196ae94ee22c6a228c975b4980..1e41de9523c5fa3b9cfced798a5c35a2
String string = resourceKey.location().toString();
if (targets.size() == 1) {
diff --git a/src/main/java/net/minecraft/server/level/ServerPlayer.java b/src/main/java/net/minecraft/server/level/ServerPlayer.java
index f523311e822af9cbef571338fd8fef177b9fc73d..ec713ffb7c4cba53dc983ebde5596e4749107493 100644
index 5ef42e8e69169995f2c36ec332500f0307e84337..17f7ecafb2b0877b140353323b5972fb90e558e0 100644
--- a/src/main/java/net/minecraft/server/level/ServerPlayer.java
+++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java
@@ -1287,7 +1287,7 @@ public class ServerPlayer extends Player {
@ -44,7 +44,7 @@ index f523311e822af9cbef571338fd8fef177b9fc73d..ec713ffb7c4cba53dc983ebde5596e47
if (this.level.isDay()) {
return Either.left(Player.BedSleepingProblem.NOT_POSSIBLE_NOW);
} else {
@@ -2123,12 +2123,33 @@ public class ServerPlayer extends Player {
@@ -2128,12 +2128,33 @@ public class ServerPlayer extends Player {
return this.respawnForced;
}
@ -80,7 +80,7 @@ index f523311e822af9cbef571338fd8fef177b9fc73d..ec713ffb7c4cba53dc983ebde5596e47
}
this.respawnPosition = pos;
@@ -2142,6 +2163,7 @@ public class ServerPlayer extends Player {
@@ -2147,6 +2168,7 @@ public class ServerPlayer extends Player {
this.respawnForced = false;
}
@ -89,7 +89,7 @@ index f523311e822af9cbef571338fd8fef177b9fc73d..ec713ffb7c4cba53dc983ebde5596e47
public void trackChunk(ChunkPos chunkPos, Packet<?> chunkDataPacket) {
diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java
index 0354b7e20bbc9f888cf85d6db42ce2b64a25b4c2..76fa5e31701bc0e504d8e7b6ebfa737f3a10dc3b 100644
index 10231f5a811a8b4510ef063a9de2f8b386570cbe..84b3a86b5fd77dbdedbe4b45f5a67f113e2c8e48 100644
--- a/src/main/java/net/minecraft/server/players/PlayerList.java
+++ b/src/main/java/net/minecraft/server/players/PlayerList.java
@@ -896,13 +896,13 @@ public abstract class PlayerList {
@ -129,7 +129,7 @@ index c3e49a781f838e6a46cb89744f3f1846de182275..c2f3d3a09327e7cb7d3167609eb3ce68
}
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
index d72e5c06ab4f34742ec74448d1cad892048f159b..fa85a7be4a131b7ae8a5d2aae78a82fcd53e5967 100644
index aaa50b04ae3dc49fa93ca408442abd540a4e4b7a..05529f795672636ce43c6fbab73f9ada459cdcb9 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
@@ -1216,9 +1216,9 @@ public class CraftPlayer extends CraftHumanEntity implements Player {

View file

@ -19,7 +19,7 @@ index 23e564b05ba438924180c91f9b19a60731eedd1b..5ec241d49ff5e3a161a39006f05823a5
private MinecraftTimings() {}
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
index a7610894e05c763ce405c0a2d91665b83d02980a..097eb29a9fd94d49ff5df71110d250a03d6e4c45 100644
index 660e1b6955115d67cb37161ef556f90acc53bdfa..621956c024d64bcaa868e0bb01c485fe4ac11df3 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
@@ -1303,6 +1303,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
@ -30,7 +30,7 @@ index a7610894e05c763ce405c0a2d91665b83d02980a..097eb29a9fd94d49ff5df71110d250a0
return true;
} else {
if (this.haveTime()) {
@@ -2670,4 +2671,74 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
@@ -2658,4 +2659,74 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
}
}
// Paper end

View file

@ -1889,10 +1889,10 @@ index 856ef0c487af8e8c5689d58decc9acf8d52971c9..836841987ff5dd4901f75f47028a60d8
}
diff --git a/src/main/java/net/minecraft/server/level/ServerPlayer.java b/src/main/java/net/minecraft/server/level/ServerPlayer.java
index c3484d612d0273bc066b3ac274b33c21ae9e0936..2dae3fe22bad90ba10a21999816b80e28a19ac39 100644
index 94931d058118cb2a928ca53e154114690413dace..c7915e930316e30382fbf0986e185f18f67b4503 100644
--- a/src/main/java/net/minecraft/server/level/ServerPlayer.java
+++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java
@@ -2470,5 +2470,5 @@ public class ServerPlayer extends Player {
@@ -2475,5 +2475,5 @@ public class ServerPlayer extends Player {
}
// CraftBukkit end
@ -1900,7 +1900,7 @@ index c3484d612d0273bc066b3ac274b33c21ae9e0936..2dae3fe22bad90ba10a21999816b80e2
+ public final int getViewDistance() { throw new UnsupportedOperationException("Use PlayerChunkLoader"); } // Paper - placeholder
}
diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java
index dd514cc59b28fdc49dbb4c9641f11e8835b8fb1a..04d77a1b001e80b2e2e3c6f33ee32f3abd1848fb 100644
index 54f6a064116043b9c40c55895678a779b9f2627e..eb7056c71dfe5a8a58efb7aa5856fb371edb13cd 100644
--- a/src/main/java/net/minecraft/server/players/PlayerList.java
+++ b/src/main/java/net/minecraft/server/players/PlayerList.java
@@ -274,7 +274,7 @@ public abstract class PlayerList {
@ -1923,7 +1923,7 @@ index dd514cc59b28fdc49dbb4c9641f11e8835b8fb1a..04d77a1b001e80b2e2e3c6f33ee32f3a
entityplayer1.spawnIn(worldserver1);
entityplayer1.unsetRemoved();
entityplayer1.connection.teleport(new Location(worldserver1.getWorld(), entityplayer1.getX(), entityplayer1.getY(), entityplayer1.getZ(), entityplayer1.getYRot(), entityplayer1.getXRot()));
@@ -1502,7 +1502,7 @@ public abstract class PlayerList {
@@ -1513,7 +1513,7 @@ public abstract class PlayerList {
public void setViewDistance(int viewDistance) {
this.viewDistance = viewDistance;
@ -1932,7 +1932,7 @@ index dd514cc59b28fdc49dbb4c9641f11e8835b8fb1a..04d77a1b001e80b2e2e3c6f33ee32f3a
Iterator iterator = this.server.getAllLevels().iterator();
while (iterator.hasNext()) {
@@ -1517,7 +1517,7 @@ public abstract class PlayerList {
@@ -1528,7 +1528,7 @@ public abstract class PlayerList {
public void setSimulationDistance(int simulationDistance) {
this.simulationDistance = simulationDistance;
@ -2148,7 +2148,7 @@ index 1bbc73dcdf890a9383795ffeb0d368293f7146a5..c4f7aa9ffb72d2bc555ace64bb8cedc5
// Paper end - view distance api
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
index 690bbb42ebe86c9ebca21ac53ad1d10d011d9e6e..37f43ef07881b0898caef3ec28779a8b61fada47 100644
index 2acb9f0d675650e73ff58011250dab04f01ecfee..f74802748438f4d40fb5ab772a209dfb2ee406e6 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
@@ -541,45 +541,80 @@ public class CraftPlayer extends CraftHumanEntity implements Player {

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
index 55bf584ace138e6df855c011f1fb44dbdc0e7d98..9507988d7650204b6ae0137bc0b8bcd486a83028 100644
index e2daea84b834b5cb8013b10b5df88c772b14a79b..551cf9b37d2bf543febfbefb3ef88521031a7bb6 100644
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
@@ -3393,7 +3393,12 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
@@ -3399,7 +3399,12 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
BlockPos blockposition = BlockEntity.getPosFromTag(nbttagcompound);
if (this.player.level.isLoaded(blockposition)) {

View file

@ -6,10 +6,10 @@ Subject: [PATCH] Use username instead of display name in
diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java
index 812c62d798d21584e12a3e83354c081c073bf8bf..71955f5c5d8e9973da97863d09fbfc8f52830a82 100644
index 101b67e89d275ab4afe922889aad7ac326d35d3c..d9c914bd10f37d4d64ecd919ab7deaa6c40fa6cf 100644
--- a/src/main/java/net/minecraft/server/players/PlayerList.java
+++ b/src/main/java/net/minecraft/server/players/PlayerList.java
@@ -1466,7 +1466,7 @@ public abstract class PlayerList {
@@ -1477,7 +1477,7 @@ public abstract class PlayerList {
// CraftBukkit start
public ServerStatsCounter getPlayerStats(ServerPlayer entityhuman) {
ServerStatsCounter serverstatisticmanager = entityhuman.getStats();

View file

@ -18,10 +18,10 @@ index 20670bc075c387ee0422eb1014207e26105efccd..bdd6560fe85950b0a857a949cb38c044
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
index 9507988d7650204b6ae0137bc0b8bcd486a83028..de6bbe320c32b512bd995a86c782a25cd1b770d8 100644
index 551cf9b37d2bf543febfbefb3ef88521031a7bb6..f57c237e8fa289e10443967e29a87432600127c6 100644
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
@@ -2989,7 +2989,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
@@ -2995,7 +2995,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
this.player = this.server.getPlayerList().respawn(this.player, false);
if (this.server.isHardcore()) {
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
index de6bbe320c32b512bd995a86c782a25cd1b770d8..a54ea66d2c85fc82075bb8c27b34e2d1407e8375 100644
index f57c237e8fa289e10443967e29a87432600127c6..95a96d990cba80557b774cc8ec9e22cc7834a9e7 100644
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
@@ -3572,6 +3572,13 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
@@ -3578,6 +3578,13 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
@Override
public void handleClientInformation(ServerboundClientInformationPacket packet) {
PacketUtils.ensureRunningOnSameThread(packet, this, this.player.getLevel());

View file

@ -6,7 +6,7 @@ Subject: [PATCH] Add some minimal debug information to chat packet errors
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
index c00443e73cd31f79679f8e4ba45a6f551349bb85..cdf7ed204cf6216337ab9667158b33143c82a819 100644
index e7411ecfec60903fc8db1b87bacc53295123ac8c..c384e715a54248e3bf2e1dc02acc118ec9fcfa1d 100644
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
@@ -2296,7 +2296,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
@ -18,7 +18,7 @@ index c00443e73cd31f79679f8e4ba45a6f551349bb85..cdf7ed204cf6216337ab9667158b3314
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
}); // Paper - push to main
@@ -2552,7 +2552,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
@@ -2555,7 +2555,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
return false;
} else {
if (message.hasExpiredServer(Instant.now())) {

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
index cdf7ed204cf6216337ab9667158b33143c82a819..72864ca3f0fa94512d7f57b4e05929be7d2912cd 100644
index c384e715a54248e3bf2e1dc02acc118ec9fcfa1d..736ef6024285866fd372e5449b5eb55633e7ddf9 100644
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
@@ -2573,7 +2573,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
@@ -2576,7 +2576,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
}
// Spigot end
// this.chatSpamTickCount += 20;

View file

@ -57,7 +57,7 @@ index 9378e83a67a70dbb1fb4f05b33f1e553d008e62b..5a60f5dc202c44b06ca34e9a19d45cb7
}
}
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
index adb9cde74295830e74241e522ae5766d436aadb1..ff7df8026f85b7ad51458a0b720a8baf71cd9bd1 100644
index 8e32bf0deacd966a1bfeef7c57455be4ccfdadda..01a498536497db7ab0f3ebac80fb022b356385c8 100644
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
@@ -1873,8 +1873,28 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic