diff --git a/.github/stale.yml b/.github/stale.yml deleted file mode 100644 index b67a072020..0000000000 --- a/.github/stale.yml +++ /dev/null @@ -1,18 +0,0 @@ -daysUntilStale: 60 -daysUntilClose: 7 -exemptLabels: - - "for: future" - - "type: bug" - - "status: accepted" - - "status: blocked" - - "status: in progress" - - "status: rebase required" -staleLabel: "resolution: stale" -markComment: > - This issue has been automatically marked as stale because it has not had - recent activity. It will be closed if no further activity occurs. Thank you - for your contributions. -closeComment: > - This issue has been automatically closed because it has not had activity in - a long time. If the issue still applies to the most recent supported - version, please open a new issue referencing this original issue. diff --git a/LICENSE.md b/LICENSE.md index 6d4495236d..9e740e1570 100644 --- a/LICENSE.md +++ b/LICENSE.md @@ -40,7 +40,6 @@ rickyboy320 DoNotSpamPls <7570108+DoNotSpamPls@users.noreply.github.com> JRoy ysl3000 -kennytv Machine_Maker Ivan Pekov Camotoy <20743703+Camotoy@users.noreply.github.com> diff --git a/Paper-MojangAPI/src/main/java/com/destroystokyo/paper/brigadier/BukkitBrigadierCommand.java b/Paper-MojangAPI/src/main/java/com/destroystokyo/paper/brigadier/BukkitBrigadierCommand.java index 3848933b67..0b1af3a8d4 100644 --- a/Paper-MojangAPI/src/main/java/com/destroystokyo/paper/brigadier/BukkitBrigadierCommand.java +++ b/Paper-MojangAPI/src/main/java/com/destroystokyo/paper/brigadier/BukkitBrigadierCommand.java @@ -5,5 +5,10 @@ import com.mojang.brigadier.suggestion.SuggestionProvider; import java.util.function.Predicate; +/** + * Brigadier {@link Command}, {@link SuggestionProvider}, and permission checker for Bukkit {@link Command}s. + * + * @param command source type + */ public interface BukkitBrigadierCommand extends Command, Predicate, SuggestionProvider { } diff --git a/Paper-MojangAPI/src/main/java/com/destroystokyo/paper/event/brigadier/AsyncPlayerSendCommandsEvent.java b/Paper-MojangAPI/src/main/java/com/destroystokyo/paper/event/brigadier/AsyncPlayerSendCommandsEvent.java index d767aa23fe..495b0f0d2f 100644 --- a/Paper-MojangAPI/src/main/java/com/destroystokyo/paper/event/brigadier/AsyncPlayerSendCommandsEvent.java +++ b/Paper-MojangAPI/src/main/java/com/destroystokyo/paper/event/brigadier/AsyncPlayerSendCommandsEvent.java @@ -3,33 +3,33 @@ package com.destroystokyo.paper.event.brigadier; import com.destroystokyo.paper.brigadier.BukkitBrigadierCommandSource; import com.mojang.brigadier.tree.RootCommandNode; import org.bukkit.Bukkit; -import org.bukkit.Warning; import org.bukkit.entity.Player; import org.bukkit.event.HandlerList; import org.bukkit.event.player.PlayerEvent; +import org.jetbrains.annotations.ApiStatus; import org.jetbrains.annotations.NotNull; /** * Fired any time a Brigadier RootCommandNode is generated for a player to inform the client of commands. * You may manipulate this CommandNode to change what the client sees. * - * This event may fire on login, world change, and permission rebuilds, by plugin request, and potentially future means. + *

This event may fire on login, world change, and permission rebuilds, by plugin request, and potentially future means.

* - * This event will fire before {@link org.bukkit.event.player.PlayerCommandSendEvent}, so no filtering has been done by - * other plugins yet. + *

This event will fire before {@link org.bukkit.event.player.PlayerCommandSendEvent}, so no filtering has been done by + * other plugins yet.

* - * WARNING: This event will potentially (and most likely) fire twice! Once for Async, and once again for Sync. + *

WARNING: This event will potentially (and most likely) fire twice! Once for Async, and once again for Sync. * It is important that you check event.isAsynchronous() and event.hasFiredAsync() to ensure you only act once. - * If for some reason we are unable to send this asynchronously in the future, only the sync method will fire. + * If for some reason we are unable to send this asynchronously in the future, only the sync method will fire.

* - * Your logic should look like this: - * if (event.isAsynchronous() || !event.hasFiredAsync()) { do stuff } + *

Your logic should look like this: + * {@code if (event.isAsynchronous() || !event.hasFiredAsync()) { // do stuff }}

* - * If your logic is not safe to run asynchronously, only react to the synchronous version. - * @deprecated Draft API - Subject to change until confirmed solves desired use cases + *

If your logic is not safe to run asynchronously, only react to the synchronous version.

+ * + *

This is a draft/experimental API and is subject to change.

*/ -@Deprecated -@Warning(false) +@ApiStatus.Experimental public class AsyncPlayerSendCommandsEvent extends PlayerEvent { private static final HandlerList handlers = new HandlerList(); @@ -43,14 +43,18 @@ public class AsyncPlayerSendCommandsEvent getCommandNode() { return node; } /** - * @return If this event has already fired asynchronously. + * Gets if this event has already fired asynchronously. + * + * @return whether this event has already fired asynchronously */ public boolean hasFiredAsync() { return hasFiredAsync; diff --git a/Paper-MojangAPI/src/main/java/com/destroystokyo/paper/event/brigadier/AsyncPlayerSendSuggestionsEvent.java b/Paper-MojangAPI/src/main/java/com/destroystokyo/paper/event/brigadier/AsyncPlayerSendSuggestionsEvent.java index 13819b6185..4755ab24a6 100644 --- a/Paper-MojangAPI/src/main/java/com/destroystokyo/paper/event/brigadier/AsyncPlayerSendSuggestionsEvent.java +++ b/Paper-MojangAPI/src/main/java/com/destroystokyo/paper/event/brigadier/AsyncPlayerSendSuggestionsEvent.java @@ -10,8 +10,9 @@ import org.bukkit.event.player.PlayerEvent; import org.jetbrains.annotations.NotNull; /** - * Called when sending Suggestions to the client. Will be called asynchronously if a plugin - * marks the AsyncTabComplete event handled asynchronously, otherwise called synchronously. + * Called when sending {@link Suggestions} to the client. Will be called asynchronously if a plugin + * marks the {@link com.destroystokyo.paper.event.server.AsyncTabCompleteEvent} event handled asynchronously, + * otherwise called synchronously. */ public class AsyncPlayerSendSuggestionsEvent extends PlayerEvent implements Cancellable { @@ -28,21 +29,27 @@ public class AsyncPlayerSendSuggestionsEvent extends PlayerEvent implements Canc } /** - * @return The input buffer sent to request these suggestions + * Gets the input buffer sent to request these suggestions. + * + * @return the input buffer */ public String getBuffer() { return buffer; } /** - * @return The suggestions being sent to client + * Gets the suggestions to be sent to client. + * + * @return the suggestions */ public Suggestions getSuggestions() { return suggestions; } /** - * @param suggestions The suggestions to be sent to client if need to change them + * Sets the suggestions to be sent to client. + * + * @param suggestions suggestions */ public void setSuggestions(Suggestions suggestions) { this.suggestions = suggestions; @@ -57,7 +64,7 @@ public class AsyncPlayerSendSuggestionsEvent extends PlayerEvent implements Canc } /** - * Cancels sending suggestions to the client + * Cancels sending suggestions to the client. * {@inheritDoc} */ @Override diff --git a/Paper-MojangAPI/src/main/java/com/destroystokyo/paper/event/brigadier/CommandRegisteredEvent.java b/Paper-MojangAPI/src/main/java/com/destroystokyo/paper/event/brigadier/CommandRegisteredEvent.java index 7bfa71f150..eb0409d816 100644 --- a/Paper-MojangAPI/src/main/java/com/destroystokyo/paper/event/brigadier/CommandRegisteredEvent.java +++ b/Paper-MojangAPI/src/main/java/com/destroystokyo/paper/event/brigadier/CommandRegisteredEvent.java @@ -5,26 +5,24 @@ import com.destroystokyo.paper.brigadier.BukkitBrigadierCommandSource; import com.mojang.brigadier.tree.ArgumentCommandNode; import com.mojang.brigadier.tree.LiteralCommandNode; import com.mojang.brigadier.tree.RootCommandNode; -import org.bukkit.Warning; import org.bukkit.command.Command; 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; /** - * Fired anytime the server synchronizes Bukkit CommandMap to Brigadier. + * Fired anytime the server synchronizes Bukkit commands to Brigadier. * - * Allows a plugin to control the Literal and Argument nodes for this command to be - * sent to the client. - * This is done at Plugin Enable time after commands have been registered, but some - * plugins may use reflection to retrigger this rebuild during runtime. + *

Allows a plugin to control the command node structure for its commands. + * This is done at Plugin Enable time after commands have been registered, but may also + * run at a later point in the server lifetime due to plugins, a server reload, etc.

* - * @deprecated Draft API - Subject to change until confirmed solves desired use cases + *

This is a draft/experimental API and is subject to change.

*/ -@Deprecated -@Warning(false) -public class CommandRegisteredEvent extends ServerEvent implements Cancellable { +@ApiStatus.Experimental +public class CommandRegisteredEvent extends ServerEvent implements Cancellable { private static final HandlerList handlers = new HandlerList(); private final String commandLabel; @@ -33,6 +31,7 @@ public class CommandRegisteredEvent ext private final RootCommandNode root; private final ArgumentCommandNode defaultArgs; private LiteralCommandNode literal; + private boolean rawCommand = false; private boolean cancelled = false; public CommandRegisteredEvent(String commandLabel, BukkitBrigadierCommand brigadierCommand, Command command, RootCommandNode root, LiteralCommandNode literal, ArgumentCommandNode defaultArgs) { @@ -45,55 +44,99 @@ public class CommandRegisteredEvent ext } /** - * @return The command name being registered + * Gets the command label of the {@link Command} being registered. + * + * @return the command label */ public String getCommandLabel() { - return commandLabel; + return this.commandLabel; } /** - * @return The Bukkit API Brigadier Wrapped Command Object to handle executions and suggestions + * Gets the {@link BukkitBrigadierCommand} for the {@link Command} being registered. This can be used + * as the {@link com.mojang.brigadier.Command command executor} or + * {@link com.mojang.brigadier.suggestion.SuggestionProvider} of a {@link com.mojang.brigadier.tree.CommandNode} + * to delegate to the {@link Command} being registered. + * + * @return the {@link BukkitBrigadierCommand} */ public BukkitBrigadierCommand getBrigadierCommand() { - return brigadierCommand; - } - - public Command getCommand() { - return command; + return this.brigadierCommand; } /** - * @return Gets the root command node being used to register a command to. + * Gets the {@link Command} being registered. + * + * @return the {@link Command} + */ + public Command getCommand() { + return this.command; + } + + /** + * Gets the {@link RootCommandNode} which is being registered to. + * + * @return the {@link RootCommandNode} */ public RootCommandNode getRoot() { - return root; + return this.root; } /** - * Returns the Bukkit API's default handling of Arguments, if you wish to reuse it. - * @return + * Gets the Bukkit APIs default arguments node (greedy string), for if + * you wish to reuse it. + * + * @return default arguments node */ public ArgumentCommandNode getDefaultArgs() { - return defaultArgs; + return this.defaultArgs; } /** - * Returns the Bukkit API's default literal for this command, including the {@link #getDefaultArgs()} as a child already. - * @return + * Gets the {@link LiteralCommandNode} to be registered for the {@link Command}. + * + * @return the {@link LiteralCommandNode} */ public LiteralCommandNode getLiteral() { - return literal; + return this.literal; } /** - * Changes the literal used to register this command. The previous literable is mutable, so this is primarily if - * you want to completely replace the object. - * @param literal + * Sets the {@link LiteralCommandNode} used to register this command. The default literal is mutable, so + * this is primarily if you want to completely replace the object. + * + * @param literal new node */ public void setLiteral(LiteralCommandNode literal) { this.literal = literal; } + /** + * Gets whether this command should is treated as "raw". + * + * @see #setRawCommand(boolean) + * @return whether this command is treated as "raw" + */ + public boolean isRawCommand() { + return this.rawCommand; + } + + /** + * Sets whether this command should be treated as "raw". + * + *

A "raw" command will only use the node provided by this event for + * sending the command tree to the client. For execution purposes, the default + * greedy string execution of a standard Bukkit {@link Command} is used.

+ * + *

On older versions of Paper, this was the default and only behavior of this + * event.

+ * + * @param rawCommand whether this command should be treated as "raw" + */ + public void setRawCommand(final boolean rawCommand) { + this.rawCommand = rawCommand; + } + /** * {@inheritDoc} */ diff --git a/README.md b/README.md index 149e3f3a8b..81900c34ce 100644 --- a/README.md +++ b/README.md @@ -19,7 +19,7 @@ Download Paper from our [downloads page](https://papermc.io/downloads). Run the Paperclip jar directly from your server. Just like old times * Documentation on using Paper: [docs.papermc.io](https://docs.papermc.io) - * For a sneak peek on upcoming features, [see here](https://github.com/PaperMC/Paper/projects) + * For a sneak peek at upcoming features, [see here](https://github.com/PaperMC/Paper/projects) How To (Plugin Developers) ------ @@ -38,7 +38,7 @@ How To (Plugin Developers) io.papermc.paper paper-api - 1.19.1-R0.1-SNAPSHOT + 1.19.2-R0.1-SNAPSHOT provided ``` @@ -54,7 +54,7 @@ repositories { } 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 { diff --git a/build.gradle.kts b/build.gradle.kts index 9493c04570..5341c25fbe 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -61,7 +61,7 @@ repositories { } 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") decompiler("net.minecraftforge:forgeflower:1.5.605.7") spigotDecompiler("io.papermc:patched-spigot-fernflower:0.1+build.6") diff --git a/gradle.properties b/gradle.properties index 8f428ef076..d2cf8c41f7 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,6 +1,6 @@ group=io.papermc.paper -version=1.19.1-R0.1-SNAPSHOT -mcVersion=1.19.1 +version=1.19.2-R0.1-SNAPSHOT +mcVersion=1.19.2 org.gradle.caching=true org.gradle.parallel=true diff --git a/patches/api/0001-Convert-project-to-Gradle.patch b/patches/api/0001-Convert-project-to-Gradle.patch index cb02926a5a..c4127eac2a 100644 --- a/patches/api/0001-Convert-project-to-Gradle.patch +++ b/patches/api/0001-Convert-project-to-Gradle.patch @@ -114,7 +114,7 @@ index 0000000000000000000000000000000000000000..2c096b3ec6d77d824de974f9a6615916 +} diff --git a/pom.xml b/pom.xml deleted file mode 100644 -index 847d05f335e393240d2bafea9949545b2dd53069..0000000000000000000000000000000000000000 +index 3dc372008395cace32b28e2f08544d70f67e4511..0000000000000000000000000000000000000000 --- a/pom.xml +++ /dev/null @@ -1,252 +0,0 @@ @@ -125,7 +125,7 @@ index 847d05f335e393240d2bafea9949545b2dd53069..00000000000000000000000000000000 - - org.spigotmc - spigot-api -- 1.19.1-R0.1-SNAPSHOT +- 1.19.2-R0.1-SNAPSHOT - jar - - Spigot-API diff --git a/patches/api/0005-Adventure.patch b/patches/api/0005-Adventure.patch index 560a56fd86..800a471c61 100644 --- a/patches/api/0005-Adventure.patch +++ b/patches/api/0005-Adventure.patch @@ -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: ++ *
    ++ *
  • Previewing: 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.
  • ++ *
  • Chat: 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.
  • ++ *
++ * @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. ++ *

++ * 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 ++ * OR 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 @@ -475,10 +670,10 @@ index 0000000000000000000000000000000000000000..bff9a6295db367c6b89d69fb55459a40 + } +} diff --git a/src/main/java/org/bukkit/Bukkit.java b/src/main/java/org/bukkit/Bukkit.java -index 5029d98816c137fcc7068bd5596d6a38d96ee877..ba57a093a2df3c65036377e3093eedabeda7c6f5 100644 +index 72143df182e55b70726b066b6b276021c1f4f4d7..c800da7aba43de995682eb724ccf8b7066d6cad3 100644 --- a/src/main/java/org/bukkit/Bukkit.java +++ b/src/main/java/org/bukkit/Bukkit.java -@@ -357,7 +357,9 @@ public final class Bukkit { +@@ -358,7 +358,9 @@ public final class Bukkit { * * @param message the message * @return the number of players @@ -488,7 +683,7 @@ index 5029d98816c137fcc7068bd5596d6a38d96ee877..ba57a093a2df3c65036377e3093eedab public static int broadcastMessage(@NotNull String message) { return server.broadcastMessage(message); } -@@ -1071,6 +1073,19 @@ public final class Bukkit { +@@ -1072,6 +1074,19 @@ public final class Bukkit { server.shutdown(); } @@ -508,7 +703,7 @@ index 5029d98816c137fcc7068bd5596d6a38d96ee877..ba57a093a2df3c65036377e3093eedab /** * Broadcasts the specified message to every user with the given * permission name. -@@ -1080,6 +1095,21 @@ public final class Bukkit { +@@ -1081,6 +1096,21 @@ public final class Bukkit { * permissibles} must have to receive the broadcast * @return number of message recipients */ @@ -530,7 +725,7 @@ index 5029d98816c137fcc7068bd5596d6a38d96ee877..ba57a093a2df3c65036377e3093eedab public static int broadcast(@NotNull String message, @NotNull String permission) { return server.broadcast(message, permission); } -@@ -1318,6 +1348,7 @@ public final class Bukkit { +@@ -1319,6 +1349,7 @@ public final class Bukkit { return server.createInventory(owner, type); } @@ -538,7 +733,7 @@ index 5029d98816c137fcc7068bd5596d6a38d96ee877..ba57a093a2df3c65036377e3093eedab /** * Creates an empty inventory with the specified type and title. If the type * is {@link InventoryType#CHEST}, the new inventory has a size of 27; -@@ -1343,6 +1374,38 @@ public final class Bukkit { +@@ -1344,6 +1375,38 @@ public final class Bukkit { * @see InventoryType#isCreatable() */ @NotNull @@ -577,7 +772,7 @@ index 5029d98816c137fcc7068bd5596d6a38d96ee877..ba57a093a2df3c65036377e3093eedab public static Inventory createInventory(@Nullable InventoryHolder owner, @NotNull InventoryType type, @NotNull String title) { return server.createInventory(owner, type, title); } -@@ -1361,6 +1424,7 @@ public final class Bukkit { +@@ -1362,6 +1425,7 @@ public final class Bukkit { return server.createInventory(owner, size); } @@ -585,7 +780,7 @@ index 5029d98816c137fcc7068bd5596d6a38d96ee877..ba57a093a2df3c65036377e3093eedab /** * Creates an empty inventory of type {@link InventoryType#CHEST} with the * specified size and title. -@@ -1373,10 +1437,30 @@ public final class Bukkit { +@@ -1374,10 +1438,30 @@ public final class Bukkit { * @throws IllegalArgumentException if the size is not a multiple of 9 */ @NotNull @@ -616,7 +811,7 @@ index 5029d98816c137fcc7068bd5596d6a38d96ee877..ba57a093a2df3c65036377e3093eedab /** * Creates an empty merchant. * -@@ -1384,7 +1468,20 @@ public final class Bukkit { +@@ -1385,7 +1469,20 @@ public final class Bukkit { * when the merchant inventory is viewed * @return a new merchant */ @@ -637,7 +832,7 @@ index 5029d98816c137fcc7068bd5596d6a38d96ee877..ba57a093a2df3c65036377e3093eedab public static Merchant createMerchant(@Nullable String title) { return server.createMerchant(title); } -@@ -1501,22 +1598,47 @@ public final class Bukkit { +@@ -1502,22 +1599,47 @@ public final class Bukkit { return server.isPrimaryThread(); } @@ -810,10 +1005,10 @@ index 803fa0019869127ee8c7e4fb1777a59c43e66f8a..c65f0d6569c130b4920a9e71ad24af64 + // Paper end } diff --git a/src/main/java/org/bukkit/Server.java b/src/main/java/org/bukkit/Server.java -index 6d6810cc51732830ef139f7099fbc5a45b124e8e..5af7da1d3d62cada69240e2d22db2a32278b0074 100644 +index c0a3b44c728ec98ecce4d1e71746747d87582aa9..4d5c3af2e1f0030aa7415fbe9d11fe3580854fd5 100644 --- a/src/main/java/org/bukkit/Server.java +++ b/src/main/java/org/bukkit/Server.java -@@ -58,13 +58,13 @@ import org.jetbrains.annotations.Nullable; +@@ -59,13 +59,13 @@ import org.jetbrains.annotations.Nullable; /** * Represents a server implementation. */ @@ -829,7 +1024,7 @@ index 6d6810cc51732830ef139f7099fbc5a45b124e8e..5af7da1d3d62cada69240e2d22db2a32 */ public static final String BROADCAST_CHANNEL_ADMINISTRATIVE = "bukkit.broadcast.admin"; -@@ -72,7 +72,7 @@ public interface Server extends PluginMessageRecipient { +@@ -73,7 +73,7 @@ public interface Server extends PluginMessageRecipient { * Used for all announcement messages, such as informing users that a * player has joined. *

@@ -838,7 +1033,7 @@ index 6d6810cc51732830ef139f7099fbc5a45b124e8e..5af7da1d3d62cada69240e2d22db2a32 */ public static final String BROADCAST_CHANNEL_USERS = "bukkit.broadcast.user"; -@@ -294,7 +294,9 @@ public interface Server extends PluginMessageRecipient { +@@ -295,7 +295,9 @@ public interface Server extends PluginMessageRecipient { * * @param message the message * @return the number of players @@ -848,7 +1043,7 @@ index 6d6810cc51732830ef139f7099fbc5a45b124e8e..5af7da1d3d62cada69240e2d22db2a32 public int broadcastMessage(@NotNull String message); /** -@@ -910,8 +912,33 @@ public interface Server extends PluginMessageRecipient { +@@ -911,8 +913,33 @@ public interface Server extends PluginMessageRecipient { * @param permission the required permission {@link Permissible * permissibles} must have to receive the broadcast * @return number of message recipients @@ -882,7 +1077,7 @@ index 6d6810cc51732830ef139f7099fbc5a45b124e8e..5af7da1d3d62cada69240e2d22db2a32 /** * Gets the player by the given name, regardless if they are offline or -@@ -1109,6 +1136,7 @@ public interface Server extends PluginMessageRecipient { +@@ -1110,6 +1137,7 @@ public interface Server extends PluginMessageRecipient { @NotNull Inventory createInventory(@Nullable InventoryHolder owner, @NotNull InventoryType type); @@ -890,7 +1085,7 @@ index 6d6810cc51732830ef139f7099fbc5a45b124e8e..5af7da1d3d62cada69240e2d22db2a32 /** * Creates an empty inventory with the specified type and title. If the type * is {@link InventoryType#CHEST}, the new inventory has a size of 27; -@@ -1134,6 +1162,36 @@ public interface Server extends PluginMessageRecipient { +@@ -1135,6 +1163,36 @@ public interface Server extends PluginMessageRecipient { * @see InventoryType#isCreatable() */ @NotNull @@ -927,7 +1122,7 @@ index 6d6810cc51732830ef139f7099fbc5a45b124e8e..5af7da1d3d62cada69240e2d22db2a32 Inventory createInventory(@Nullable InventoryHolder owner, @NotNull InventoryType type, @NotNull String title); /** -@@ -1148,6 +1206,22 @@ public interface Server extends PluginMessageRecipient { +@@ -1149,6 +1207,22 @@ public interface Server extends PluginMessageRecipient { @NotNull Inventory createInventory(@Nullable InventoryHolder owner, int size) throws IllegalArgumentException; @@ -950,7 +1145,7 @@ index 6d6810cc51732830ef139f7099fbc5a45b124e8e..5af7da1d3d62cada69240e2d22db2a32 /** * Creates an empty inventory of type {@link InventoryType#CHEST} with the * specified size and title. -@@ -1158,10 +1232,13 @@ public interface Server extends PluginMessageRecipient { +@@ -1159,10 +1233,13 @@ public interface Server extends PluginMessageRecipient { * viewed * @return a new inventory * @throws IllegalArgumentException if the size is not a multiple of 9 @@ -964,7 +1159,7 @@ index 6d6810cc51732830ef139f7099fbc5a45b124e8e..5af7da1d3d62cada69240e2d22db2a32 /** * Creates an empty merchant. * -@@ -1169,7 +1246,18 @@ public interface Server extends PluginMessageRecipient { +@@ -1170,7 +1247,18 @@ public interface Server extends PluginMessageRecipient { * when the merchant inventory is viewed * @return a new merchant */ @@ -983,7 +1178,7 @@ index 6d6810cc51732830ef139f7099fbc5a45b124e8e..5af7da1d3d62cada69240e2d22db2a32 Merchant createMerchant(@Nullable String title); /** -@@ -1265,20 +1353,41 @@ public interface Server extends PluginMessageRecipient { +@@ -1266,20 +1354,41 @@ public interface Server extends PluginMessageRecipient { */ boolean isPrimaryThread(); @@ -1025,7 +1220,7 @@ index 6d6810cc51732830ef139f7099fbc5a45b124e8e..5af7da1d3d62cada69240e2d22db2a32 String getShutdownMessage(); /** -@@ -1650,7 +1759,9 @@ public interface Server extends PluginMessageRecipient { +@@ -1661,7 +1770,9 @@ public interface Server extends PluginMessageRecipient { * Sends the component to the player * * @param component the components to send @@ -1035,7 +1230,7 @@ index 6d6810cc51732830ef139f7099fbc5a45b124e8e..5af7da1d3d62cada69240e2d22db2a32 public void broadcast(@NotNull net.md_5.bungee.api.chat.BaseComponent component) { throw new UnsupportedOperationException("Not supported yet."); } -@@ -1659,7 +1770,9 @@ public interface Server extends PluginMessageRecipient { +@@ -1670,7 +1781,9 @@ public interface Server extends PluginMessageRecipient { * Sends an array of components as a single message to the player * * @param components the components to send @@ -4019,7 +4214,7 @@ index 03ca87a1cbace2459174bb7bb8847bda766e80c5..b37938745f916b5f0111b07b1a1c9752 * Returns the name of the plugin. *

diff --git a/src/main/java/org/bukkit/scoreboard/Objective.java b/src/main/java/org/bukkit/scoreboard/Objective.java -index ff3fcb2697eb00736238d0efdcaefe43043334d3..75acd6f8f3d774bb79e8e513125e801c5569a244 100644 +index 2ff3a11f1f9c115722ea224873e7eb6dc6dc63e6..474274fdffe4041bf4bfb146fcc66424eb5be78a 100644 --- a/src/main/java/org/bukkit/scoreboard/Objective.java +++ b/src/main/java/org/bukkit/scoreboard/Objective.java @@ -19,14 +19,35 @@ public interface Objective { @@ -4069,10 +4264,10 @@ index ff3fcb2697eb00736238d0efdcaefe43043334d3..75acd6f8f3d774bb79e8e513125e801c /** diff --git a/src/main/java/org/bukkit/scoreboard/Scoreboard.java b/src/main/java/org/bukkit/scoreboard/Scoreboard.java -index 5c855dbd0da895392f7a6e92cdc90782baf614ad..1ada91d790abedbc9b3aeb6e96467a0d78560f15 100644 +index a15183f302de42956d8965efe5f0585fc2cd030e..ef3e729caf430b08cdf2d680d5a137a1ba56c1c5 100644 --- a/src/main/java/org/bukkit/scoreboard/Scoreboard.java +++ b/src/main/java/org/bukkit/scoreboard/Scoreboard.java -@@ -27,6 +27,48 @@ public interface Scoreboard { +@@ -27,6 +27,92 @@ public interface Scoreboard { @Deprecated @NotNull Objective registerNewObjective(@NotNull String name, @NotNull String criteria) throws IllegalArgumentException; @@ -4093,8 +4288,10 @@ index 5c855dbd0da895392f7a6e92cdc90782baf614ad..1ada91d790abedbc9b3aeb6e96467a0d + * characters. + * @throws IllegalArgumentException if an objective by that name already + * exists ++ * @deprecated use {@link #registerNewObjective(String, Criteria, net.kyori.adventure.text.Component)} + */ + @NotNull ++ @Deprecated + Objective registerNewObjective(@NotNull String name, @NotNull String criteria, @Nullable net.kyori.adventure.text.Component displayName) throws IllegalArgumentException; + /** + * Registers an Objective on this Scoreboard @@ -4114,34 +4311,92 @@ index 5c855dbd0da895392f7a6e92cdc90782baf614ad..1ada91d790abedbc9b3aeb6e96467a0d + * @throws IllegalArgumentException if renderType is null + * @throws IllegalArgumentException if an objective by that name already + * exists ++ * @deprecated use {@link #registerNewObjective(String, Criteria, net.kyori.adventure.text.Component, RenderType)} ++ */ ++ @NotNull ++ @Deprecated ++ Objective registerNewObjective(@NotNull String name, @NotNull String criteria, @Nullable net.kyori.adventure.text.Component displayName, @NotNull RenderType renderType) throws IllegalArgumentException; ++ /** ++ * Registers an Objective on this Scoreboard ++ * ++ * @param name Name of the Objective ++ * @param criteria Criteria for the Objective ++ * @param displayName Name displayed to players for the Objective. ++ * @return The registered Objective ++ * @throws IllegalArgumentException if name is null ++ * @throws IllegalArgumentException if name is longer than 32767 ++ * characters. ++ * @throws IllegalArgumentException if criteria is null ++ * @throws IllegalArgumentException if displayName is null ++ * @throws IllegalArgumentException if displayName is longer than 128 ++ * characters. ++ * @throws IllegalArgumentException if an objective by that name already ++ * exists ++ */ ++ @NotNull ++ Objective registerNewObjective(@NotNull String name, @NotNull Criteria criteria, @Nullable net.kyori.adventure.text.Component displayName) throws IllegalArgumentException; ++ /** ++ * Registers an Objective on this Scoreboard ++ * ++ * @param name Name of the Objective ++ * @param criteria Criteria for the Objective ++ * @param displayName Name displayed to players for the Objective. ++ * @param renderType Manner of rendering the Objective ++ * @return The registered Objective ++ * @throws IllegalArgumentException if name is null ++ * @throws IllegalArgumentException if name is longer than 32767 ++ * characters. ++ * @throws IllegalArgumentException if criteria is null ++ * @throws IllegalArgumentException if displayName is null ++ * @throws IllegalArgumentException if displayName is longer than 128 ++ * characters. ++ * @throws IllegalArgumentException if renderType is null ++ * @throws IllegalArgumentException if an objective by that name already ++ * exists + */ + @NotNull -+ Objective registerNewObjective(@NotNull String name, @NotNull String criteria, @Nullable net.kyori.adventure.text.Component displayName, @NotNull RenderType renderType) throws IllegalArgumentException; ++ Objective registerNewObjective(@NotNull String name, @NotNull Criteria criteria, @Nullable net.kyori.adventure.text.Component displayName, @NotNull RenderType renderType) throws IllegalArgumentException; + // Paper end /** * Registers an Objective on this Scoreboard -@@ -44,8 +86,10 @@ public interface Scoreboard { - * characters. - * @throws IllegalArgumentException if an objective by that name already - * exists -+ * @deprecated in favour of {@link #registerNewObjective(String, String, net.kyori.adventure.text.Component)} +@@ -47,6 +133,7 @@ public interface Scoreboard { + * @deprecated use {@link #registerNewObjective(String, Criteria, String)} */ @NotNull + @Deprecated // Paper Objective registerNewObjective(@NotNull String name, @NotNull String criteria, @NotNull String displayName) throws IllegalArgumentException; /** -@@ -66,8 +110,10 @@ public interface Scoreboard { - * @throws IllegalArgumentException if renderType is null - * @throws IllegalArgumentException if an objective by that name already - * exists -+ * @deprecated in favour of {@link #registerNewObjective(String, String, net.kyori.adventure.text.Component, RenderType)} +@@ -70,6 +157,7 @@ public interface Scoreboard { + * @deprecated use {@link #registerNewObjective(String, Criteria, String, RenderType)} */ @NotNull + @Deprecated // Paper Objective registerNewObjective(@NotNull String name, @NotNull String criteria, @NotNull String displayName, @NotNull RenderType renderType) throws IllegalArgumentException; + /** +@@ -88,8 +176,10 @@ public interface Scoreboard { + * characters. + * @throws IllegalArgumentException if an objective by that name already + * exists ++ * @deprecated in favour of {@link #registerNewObjective(String, Criteria, net.kyori.adventure.text.Component)} + */ + @NotNull ++ @Deprecated // Paper + Objective registerNewObjective(@NotNull String name, @NotNull Criteria criteria, @NotNull String displayName) throws IllegalArgumentException; + + /** +@@ -110,8 +200,10 @@ public interface Scoreboard { + * @throws IllegalArgumentException if renderType is null + * @throws IllegalArgumentException if an objective by that name already + * exists ++ * @deprecated in favour of {@link #registerNewObjective(String, Criteria, net.kyori.adventure.text.Component, RenderType)} + */ + @NotNull ++ @Deprecated // Paper + Objective registerNewObjective(@NotNull String name, @NotNull Criteria criteria, @NotNull String displayName, @NotNull RenderType renderType) throws IllegalArgumentException; + /** diff --git a/src/main/java/org/bukkit/scoreboard/Team.java b/src/main/java/org/bukkit/scoreboard/Team.java index 0db7fe1b9fe5621ceed3f4f046691e359f5949dd..47b10df619ad2520b9bb673e2220f36391680f1b 100644 diff --git a/patches/api/0007-Timings-v2.patch b/patches/api/0007-Timings-v2.patch index 7b72817a75..a41f390b5c 100644 --- a/patches/api/0007-Timings-v2.patch +++ b/patches/api/0007-Timings-v2.patch @@ -2791,10 +2791,10 @@ index 0000000000000000000000000000000000000000..5989ee21297935651b0edd44b8239e65 + } +} diff --git a/src/main/java/org/bukkit/Bukkit.java b/src/main/java/org/bukkit/Bukkit.java -index ba57a093a2df3c65036377e3093eedabeda7c6f5..9b118067de5eb54b266b8349fce7efdec2cb36eb 100644 +index c800da7aba43de995682eb724ccf8b7066d6cad3..557cf1ff29e16fa942545ceca14696c2a50b2d4d 100644 --- a/src/main/java/org/bukkit/Bukkit.java +++ b/src/main/java/org/bukkit/Bukkit.java -@@ -801,7 +801,6 @@ public final class Bukkit { +@@ -802,7 +802,6 @@ public final class Bukkit { */ public static void reload() { server.reload(); @@ -2803,10 +2803,10 @@ index ba57a093a2df3c65036377e3093eedabeda7c6f5..9b118067de5eb54b266b8349fce7efde /** diff --git a/src/main/java/org/bukkit/Server.java b/src/main/java/org/bukkit/Server.java -index 5af7da1d3d62cada69240e2d22db2a32278b0074..0a433146ebec4416339c4ab33f3523a22d23d332 100644 +index 4d5c3af2e1f0030aa7415fbe9d11fe3580854fd5..a2ae6b84fe20e43292f1442401a472dcce1600ec 100644 --- a/src/main/java/org/bukkit/Server.java +++ b/src/main/java/org/bukkit/Server.java -@@ -1755,6 +1755,26 @@ public interface Server extends PluginMessageRecipient, net.kyori.adventure.audi +@@ -1766,6 +1766,26 @@ public interface Server extends PluginMessageRecipient, net.kyori.adventure.audi throw new UnsupportedOperationException("Not supported yet."); } diff --git a/patches/api/0008-Add-command-line-option-to-load-extra-plugin-jars-no.patch b/patches/api/0008-Add-command-line-option-to-load-extra-plugin-jars-no.patch index b59affa3c9..882f4d93ce 100644 --- a/patches/api/0008-Add-command-line-option-to-load-extra-plugin-jars-no.patch +++ b/patches/api/0008-Add-command-line-option-to-load-extra-plugin-jars-no.patch @@ -7,10 +7,10 @@ Subject: [PATCH] Add command line option to load extra plugin jars not in the ex: java -jar paperclip.jar nogui -add-plugin=/path/to/plugin.jar -add-plugin=/path/to/another/plugin_jar.jar diff --git a/src/main/java/org/bukkit/Bukkit.java b/src/main/java/org/bukkit/Bukkit.java -index 9b118067de5eb54b266b8349fce7efdec2cb36eb..aecc0bcaeceb0a2db08a528244c08037e58f399b 100644 +index 557cf1ff29e16fa942545ceca14696c2a50b2d4d..a5c02f744664248f46aa35452318b6a728cd4afd 100644 --- a/src/main/java/org/bukkit/Bukkit.java +++ b/src/main/java/org/bukkit/Bukkit.java -@@ -75,6 +75,20 @@ public final class Bukkit { +@@ -76,6 +76,20 @@ public final class Bukkit { return server; } @@ -32,10 +32,10 @@ index 9b118067de5eb54b266b8349fce7efdec2cb36eb..aecc0bcaeceb0a2db08a528244c08037 * Attempts to set the {@link Server} singleton. *

diff --git a/src/main/java/org/bukkit/Server.java b/src/main/java/org/bukkit/Server.java -index 0a433146ebec4416339c4ab33f3523a22d23d332..b8c47ed7eb7bf52efd1928956584fd993e59f03a 100644 +index a2ae6b84fe20e43292f1442401a472dcce1600ec..da13ae75ca1892c21a35aff02f92b91783a868bf 100644 --- a/src/main/java/org/bukkit/Server.java +++ b/src/main/java/org/bukkit/Server.java -@@ -60,6 +60,18 @@ import org.jetbrains.annotations.Nullable; +@@ -61,6 +61,18 @@ import org.jetbrains.annotations.Nullable; */ public interface Server extends PluginMessageRecipient, net.kyori.adventure.audience.ForwardingAudience { // Paper diff --git a/patches/api/0010-Add-getTPS-method.patch b/patches/api/0010-Add-getTPS-method.patch index c07bdb5113..71a488925f 100644 --- a/patches/api/0010-Add-getTPS-method.patch +++ b/patches/api/0010-Add-getTPS-method.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Add getTPS method diff --git a/src/main/java/org/bukkit/Bukkit.java b/src/main/java/org/bukkit/Bukkit.java -index aecc0bcaeceb0a2db08a528244c08037e58f399b..fcdce3b516821d42327452790cc66663e4677613 100644 +index a5c02f744664248f46aa35452318b6a728cd4afd..3603bcdadeea10f2babe8d6c609d7eaee3f0f89c 100644 --- a/src/main/java/org/bukkit/Bukkit.java +++ b/src/main/java/org/bukkit/Bukkit.java -@@ -1876,6 +1876,17 @@ public final class Bukkit { +@@ -1889,6 +1889,17 @@ public final class Bukkit { return server.getEntity(uuid); } @@ -27,10 +27,10 @@ index aecc0bcaeceb0a2db08a528244c08037e58f399b..fcdce3b516821d42327452790cc66663 * Get the advancement specified by this key. * diff --git a/src/main/java/org/bukkit/Server.java b/src/main/java/org/bukkit/Server.java -index b8c47ed7eb7bf52efd1928956584fd993e59f03a..f52dd4c4602638bf02f676f6415d7051c0439cce 100644 +index da13ae75ca1892c21a35aff02f92b91783a868bf..36f5e47ffcdce23b0b5594881fdd49a3a3337578 100644 --- a/src/main/java/org/bukkit/Server.java +++ b/src/main/java/org/bukkit/Server.java -@@ -1592,6 +1592,16 @@ public interface Server extends PluginMessageRecipient, net.kyori.adventure.audi +@@ -1603,6 +1603,16 @@ public interface Server extends PluginMessageRecipient, net.kyori.adventure.audi @Nullable Entity getEntity(@NotNull UUID uuid); diff --git a/patches/api/0018-Expose-server-CommandMap.patch b/patches/api/0018-Expose-server-CommandMap.patch index 49cd011dd3..b491f0f613 100644 --- a/patches/api/0018-Expose-server-CommandMap.patch +++ b/patches/api/0018-Expose-server-CommandMap.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Expose server CommandMap diff --git a/src/main/java/org/bukkit/Bukkit.java b/src/main/java/org/bukkit/Bukkit.java -index fcdce3b516821d42327452790cc66663e4677613..d225e4a5587aa76a85a4b56e11d4563bdc97fe3f 100644 +index 3603bcdadeea10f2babe8d6c609d7eaee3f0f89c..5475f7df443a31e839d353e251b0d9d55e53a84f 100644 --- a/src/main/java/org/bukkit/Bukkit.java +++ b/src/main/java/org/bukkit/Bukkit.java -@@ -2077,6 +2077,19 @@ public final class Bukkit { +@@ -2090,6 +2090,19 @@ public final class Bukkit { return server.getUnsafe(); } @@ -29,10 +29,10 @@ index fcdce3b516821d42327452790cc66663e4677613..d225e4a5587aa76a85a4b56e11d4563b public static Server.Spigot spigot() { return server.spigot(); diff --git a/src/main/java/org/bukkit/Server.java b/src/main/java/org/bukkit/Server.java -index f52dd4c4602638bf02f676f6415d7051c0439cce..f6f3297231d3a9e9f142faf992437cc99e241109 100644 +index 36f5e47ffcdce23b0b5594881fdd49a3a3337578..2dac2c6e01b4f230750605ab1f49317927705c6b 100644 --- a/src/main/java/org/bukkit/Server.java +++ b/src/main/java/org/bukkit/Server.java -@@ -1602,6 +1602,15 @@ public interface Server extends PluginMessageRecipient, net.kyori.adventure.audi +@@ -1613,6 +1613,15 @@ public interface Server extends PluginMessageRecipient, net.kyori.adventure.audi public double[] getTPS(); // Paper end diff --git a/patches/api/0019-Graduate-bungeecord-chat-API-from-spigot-subclasses.patch b/patches/api/0019-Graduate-bungeecord-chat-API-from-spigot-subclasses.patch index 63ee1a6041..5229788672 100644 --- a/patches/api/0019-Graduate-bungeecord-chat-API-from-spigot-subclasses.patch +++ b/patches/api/0019-Graduate-bungeecord-chat-API-from-spigot-subclasses.patch @@ -6,10 +6,10 @@ Subject: [PATCH] Graduate bungeecord chat API from spigot subclasses Change Javadoc to be accurate diff --git a/src/main/java/org/bukkit/Bukkit.java b/src/main/java/org/bukkit/Bukkit.java -index d225e4a5587aa76a85a4b56e11d4563bdc97fe3f..e13ffa85390f2feda49309ba02ccf75856e4c8f2 100644 +index 5475f7df443a31e839d353e251b0d9d55e53a84f..7a8eaf46ecd37163dbe34beb2cf8754bddae302f 100644 --- a/src/main/java/org/bukkit/Bukkit.java +++ b/src/main/java/org/bukkit/Bukkit.java -@@ -378,6 +378,30 @@ public final class Bukkit { +@@ -379,6 +379,30 @@ public final class Bukkit { return server.broadcastMessage(message); } @@ -41,10 +41,10 @@ index d225e4a5587aa76a85a4b56e11d4563bdc97fe3f..e13ffa85390f2feda49309ba02ccf758 * Gets the name of the update folder. The update folder is used to safely * update plugins at the right moment on a plugin load. diff --git a/src/main/java/org/bukkit/Server.java b/src/main/java/org/bukkit/Server.java -index f6f3297231d3a9e9f142faf992437cc99e241109..1dcf90071bae51e6b767ac26eb6624d372acac68 100644 +index 2dac2c6e01b4f230750605ab1f49317927705c6b..1aed052ea337f2875b581064bd8e79d8a5a1a9ec 100644 --- a/src/main/java/org/bukkit/Server.java +++ b/src/main/java/org/bukkit/Server.java -@@ -311,6 +311,30 @@ public interface Server extends PluginMessageRecipient, net.kyori.adventure.audi +@@ -312,6 +312,30 @@ public interface Server extends PluginMessageRecipient, net.kyori.adventure.audi @Deprecated // Paper public int broadcastMessage(@NotNull String message); diff --git a/patches/api/0029-Add-command-to-reload-permissions.yml-and-require-co.patch b/patches/api/0029-Add-command-to-reload-permissions.yml-and-require-co.patch index 9550d060b1..52b78c56c4 100644 --- a/patches/api/0029-Add-command-to-reload-permissions.yml-and-require-co.patch +++ b/patches/api/0029-Add-command-to-reload-permissions.yml-and-require-co.patch @@ -6,10 +6,10 @@ Subject: [PATCH] Add command to reload permissions.yml and require confirm to diff --git a/src/main/java/org/bukkit/Bukkit.java b/src/main/java/org/bukkit/Bukkit.java -index e13ffa85390f2feda49309ba02ccf75856e4c8f2..c015c0b7678a141c84f0c0e339fe7c2a93988685 100644 +index 7a8eaf46ecd37163dbe34beb2cf8754bddae302f..9463169bdb45a53ad774a0e3a5ec07704508685f 100644 --- a/src/main/java/org/bukkit/Bukkit.java +++ b/src/main/java/org/bukkit/Bukkit.java -@@ -2112,6 +2112,13 @@ public final class Bukkit { +@@ -2125,6 +2125,13 @@ public final class Bukkit { public static org.bukkit.command.CommandMap getCommandMap() { return server.getCommandMap(); } @@ -24,10 +24,10 @@ index e13ffa85390f2feda49309ba02ccf75856e4c8f2..c015c0b7678a141c84f0c0e339fe7c2a @NotNull diff --git a/src/main/java/org/bukkit/Server.java b/src/main/java/org/bukkit/Server.java -index 1dcf90071bae51e6b767ac26eb6624d372acac68..7204f8ea6271dbb94406f07bc98ec322f928fcea 100644 +index 1aed052ea337f2875b581064bd8e79d8a5a1a9ec..cd51a1a9a59cfa868237ab750d98d9df8464152f 100644 --- a/src/main/java/org/bukkit/Server.java +++ b/src/main/java/org/bukkit/Server.java -@@ -1863,4 +1863,6 @@ public interface Server extends PluginMessageRecipient, net.kyori.adventure.audi +@@ -1874,4 +1874,6 @@ public interface Server extends PluginMessageRecipient, net.kyori.adventure.audi @NotNull Spigot spigot(); // Spigot end diff --git a/patches/api/0042-Allow-Reloading-of-Command-Aliases.patch b/patches/api/0042-Allow-Reloading-of-Command-Aliases.patch index c705f46a23..6e73474e0f 100644 --- a/patches/api/0042-Allow-Reloading-of-Command-Aliases.patch +++ b/patches/api/0042-Allow-Reloading-of-Command-Aliases.patch @@ -6,10 +6,10 @@ Subject: [PATCH] Allow Reloading of Command Aliases Reload the aliases stored in commands.yml diff --git a/src/main/java/org/bukkit/Bukkit.java b/src/main/java/org/bukkit/Bukkit.java -index c015c0b7678a141c84f0c0e339fe7c2a93988685..48eb69015cc70b0734f220f95fc0d8ffcd84954a 100644 +index 9463169bdb45a53ad774a0e3a5ec07704508685f..fe5f6494fb0610dd11e59793701b2182fa862419 100644 --- a/src/main/java/org/bukkit/Bukkit.java +++ b/src/main/java/org/bukkit/Bukkit.java -@@ -2119,6 +2119,15 @@ public final class Bukkit { +@@ -2132,6 +2132,15 @@ public final class Bukkit { public static void reloadPermissions() { server.reloadPermissions(); } @@ -26,10 +26,10 @@ index c015c0b7678a141c84f0c0e339fe7c2a93988685..48eb69015cc70b0734f220f95fc0d8ff @NotNull diff --git a/src/main/java/org/bukkit/Server.java b/src/main/java/org/bukkit/Server.java -index 7204f8ea6271dbb94406f07bc98ec322f928fcea..f7c54fbffe6b39d4f73b45cbc7c23f3508217f74 100644 +index cd51a1a9a59cfa868237ab750d98d9df8464152f..29e71b746adcec45657787bf38427027508b0043 100644 --- a/src/main/java/org/bukkit/Server.java +++ b/src/main/java/org/bukkit/Server.java -@@ -1865,4 +1865,6 @@ public interface Server extends PluginMessageRecipient, net.kyori.adventure.audi +@@ -1876,4 +1876,6 @@ public interface Server extends PluginMessageRecipient, net.kyori.adventure.audi // Spigot end void reloadPermissions(); // Paper diff --git a/patches/api/0052-Expose-WorldBorder-isInBounds-Location-check.patch b/patches/api/0052-Expose-WorldBorder-isInBounds-Location-check.patch index 16c0232c1b..1af9128e4d 100644 --- a/patches/api/0052-Expose-WorldBorder-isInBounds-Location-check.patch +++ b/patches/api/0052-Expose-WorldBorder-isInBounds-Location-check.patch @@ -5,13 +5,13 @@ Subject: [PATCH] Expose WorldBorder#isInBounds(Location) check diff --git a/src/main/java/org/bukkit/WorldBorder.java b/src/main/java/org/bukkit/WorldBorder.java -index 95bb16185514e0b894f407028997ce7d4504f8fb..238b9e2309d633623d35a1dbded6edadf20831f3 100644 +index b1c08a7fc5856bcc29ee64d0a87b95a8ac940ddc..0f2f17f0a443ec5087b3373293b23f663be9dbe1 100644 --- a/src/main/java/org/bukkit/WorldBorder.java +++ b/src/main/java/org/bukkit/WorldBorder.java -@@ -127,4 +127,18 @@ public interface WorldBorder { - * @return if this location is inside the border or not +@@ -162,4 +162,18 @@ public interface WorldBorder { + * @return The absolute maximum center coordinate of the WorldBorder */ - public boolean isInside(@NotNull Location location); + public double getMaxCenterCoordinate(); + + // Paper start + /** diff --git a/patches/api/0053-Add-configuration-option-to-prevent-player-names-fro.patch b/patches/api/0053-Add-configuration-option-to-prevent-player-names-fro.patch index 5cbb798fb2..96389ab056 100644 --- a/patches/api/0053-Add-configuration-option-to-prevent-player-names-fro.patch +++ b/patches/api/0053-Add-configuration-option-to-prevent-player-names-fro.patch @@ -6,10 +6,10 @@ Subject: [PATCH] Add configuration option to prevent player names from being diff --git a/src/main/java/org/bukkit/Bukkit.java b/src/main/java/org/bukkit/Bukkit.java -index 48eb69015cc70b0734f220f95fc0d8ffcd84954a..aea30cacbf43c4c6d30b0c9e0d59fcd2db444ad8 100644 +index fe5f6494fb0610dd11e59793701b2182fa862419..05908e512b0f2c01124737cf68df79c6c04518ee 100644 --- a/src/main/java/org/bukkit/Bukkit.java +++ b/src/main/java/org/bukkit/Bukkit.java -@@ -2128,6 +2128,16 @@ public final class Bukkit { +@@ -2141,6 +2141,16 @@ public final class Bukkit { public static boolean reloadCommandAliases() { return server.reloadCommandAliases(); } @@ -27,10 +27,10 @@ index 48eb69015cc70b0734f220f95fc0d8ffcd84954a..aea30cacbf43c4c6d30b0c9e0d59fcd2 @NotNull diff --git a/src/main/java/org/bukkit/Server.java b/src/main/java/org/bukkit/Server.java -index f7c54fbffe6b39d4f73b45cbc7c23f3508217f74..5e4e6e83ac6b52493cb285561425bed53ffff2b6 100644 +index 29e71b746adcec45657787bf38427027508b0043..f84c37ad591f4d0e4062889941791a3aeb7c5be5 100644 --- a/src/main/java/org/bukkit/Server.java +++ b/src/main/java/org/bukkit/Server.java -@@ -1867,4 +1867,14 @@ public interface Server extends PluginMessageRecipient, net.kyori.adventure.audi +@@ -1878,4 +1878,14 @@ public interface Server extends PluginMessageRecipient, net.kyori.adventure.audi void reloadPermissions(); // Paper boolean reloadCommandAliases(); // Paper diff --git a/patches/api/0054-Fix-upstream-javadocs.patch b/patches/api/0054-Fix-upstream-javadocs.patch index 9d4d17a649..fcc322238c 100644 --- a/patches/api/0054-Fix-upstream-javadocs.patch +++ b/patches/api/0054-Fix-upstream-javadocs.patch @@ -6,10 +6,10 @@ Subject: [PATCH] Fix upstream javadocs Upstream still refuses to use Java 8 with the API so they are likely unaware these are even issues. diff --git a/src/main/java/org/bukkit/Bukkit.java b/src/main/java/org/bukkit/Bukkit.java -index aea30cacbf43c4c6d30b0c9e0d59fcd2db444ad8..e25a6532deca1df59eff2ab59697b851535ee952 100644 +index 05908e512b0f2c01124737cf68df79c6c04518ee..2ff65157d511108e2902838f37732742b186af6e 100644 --- a/src/main/java/org/bukkit/Bukkit.java +++ b/src/main/java/org/bukkit/Bukkit.java -@@ -1331,6 +1331,8 @@ public final class Bukkit { +@@ -1332,6 +1332,8 @@ public final class Bukkit { /** * Gets every player that has ever played on this server. @@ -19,10 +19,10 @@ index aea30cacbf43c4c6d30b0c9e0d59fcd2db444ad8..e25a6532deca1df59eff2ab59697b851 * @return an array containing all previous players */ diff --git a/src/main/java/org/bukkit/Server.java b/src/main/java/org/bukkit/Server.java -index 5e4e6e83ac6b52493cb285561425bed53ffff2b6..2bfbb0ce71c8c5f8bd9bbd908488831b94ce583f 100644 +index f84c37ad591f4d0e4062889941791a3aeb7c5be5..d9566b18e6109db824cbc1732666771bf124adbf 100644 --- a/src/main/java/org/bukkit/Server.java +++ b/src/main/java/org/bukkit/Server.java -@@ -509,13 +509,10 @@ public interface Server extends PluginMessageRecipient, net.kyori.adventure.audi +@@ -510,13 +510,10 @@ public interface Server extends PluginMessageRecipient, net.kyori.adventure.audi * *

* Note: If set to 0, {@link SpawnCategory} mobs spawning will be disabled. @@ -37,7 +37,7 @@ index 5e4e6e83ac6b52493cb285561425bed53ffff2b6..2bfbb0ce71c8c5f8bd9bbd908488831b */ public int getTicksPerSpawns(@NotNull SpawnCategory spawnCategory); -@@ -1126,6 +1123,8 @@ public interface Server extends PluginMessageRecipient, net.kyori.adventure.audi +@@ -1127,6 +1124,8 @@ public interface Server extends PluginMessageRecipient, net.kyori.adventure.audi /** * Gets every player that has ever played on this server. @@ -46,6 +46,36 @@ index 5e4e6e83ac6b52493cb285561425bed53ffff2b6..2bfbb0ce71c8c5f8bd9bbd908488831b * * @return an array containing all previous players */ +diff --git a/src/main/java/org/bukkit/block/Bed.java b/src/main/java/org/bukkit/block/Bed.java +index f9bd74f9ce6bd6650726e5a993f9b6e292cdc74d..f4c37ce1fe7aac3dde8485ee51fc8888ed56e79e 100644 +--- a/src/main/java/org/bukkit/block/Bed.java ++++ b/src/main/java/org/bukkit/block/Bed.java +@@ -4,7 +4,22 @@ import org.bukkit.material.Colorable; + + /** + * Represents a captured state of a bed. +- * @deprecated does not provide useful information beyond the material itself + */ +-@Deprecated +-public interface Bed extends TileState, Colorable { } ++// Paper start ++// @Deprecated ++public interface Bed extends TileState, Colorable { ++ ++ @Override ++ @org.jetbrains.annotations.NotNull org.bukkit.DyeColor getColor(); ++ ++ /** ++ * Unsupported ++ * ++ * @throws UnsupportedOperationException not supported, set the block type ++ */ ++ @Override ++ @org.jetbrains.annotations.Contract("_ -> fail") ++ @Deprecated(forRemoval = true) ++ void setColor(@org.bukkit.UndefinedNullability("not supported") org.bukkit.DyeColor color); ++// Paper end ++} diff --git a/src/main/java/org/bukkit/entity/ArmorStand.java b/src/main/java/org/bukkit/entity/ArmorStand.java index 91fc11dda99de506be83d40df8929bf7cd8e8d85..7dc631ebd009f5f5c3ac1699c3f3515c47609c05 100644 --- a/src/main/java/org/bukkit/entity/ArmorStand.java diff --git a/patches/api/0058-Basic-PlayerProfile-API.patch b/patches/api/0058-Basic-PlayerProfile-API.patch index 577a6d381e..f5c412834d 100644 --- a/patches/api/0058-Basic-PlayerProfile-API.patch +++ b/patches/api/0058-Basic-PlayerProfile-API.patch @@ -321,10 +321,10 @@ index 0000000000000000000000000000000000000000..7b3b6ef533d32169fbeca389bd61cfc6 + } +} diff --git a/src/main/java/org/bukkit/Bukkit.java b/src/main/java/org/bukkit/Bukkit.java -index e25a6532deca1df59eff2ab59697b851535ee952..be46b7aa492226d2c943b9a15f0e009878be422c 100644 +index 2ff65157d511108e2902838f37732742b186af6e..d5fd584c109c0a84a4259b10e7b43fae3a1da1ae 100644 --- a/src/main/java/org/bukkit/Bukkit.java +++ b/src/main/java/org/bukkit/Bukkit.java -@@ -2140,6 +2140,83 @@ public final class Bukkit { +@@ -2153,6 +2153,83 @@ public final class Bukkit { public static boolean suggestPlayerNamesWhenNullTabCompletions() { return server.suggestPlayerNamesWhenNullTabCompletions(); } @@ -409,10 +409,10 @@ index e25a6532deca1df59eff2ab59697b851535ee952..be46b7aa492226d2c943b9a15f0e0098 @NotNull diff --git a/src/main/java/org/bukkit/Server.java b/src/main/java/org/bukkit/Server.java -index 2bfbb0ce71c8c5f8bd9bbd908488831b94ce583f..04752eebe9df1138207a969fb1492a1f55b0b753 100644 +index d9566b18e6109db824cbc1732666771bf124adbf..fab39e4fc595c022da27e87e27bd168939e54381 100644 --- a/src/main/java/org/bukkit/Server.java +++ b/src/main/java/org/bukkit/Server.java -@@ -1875,5 +1875,74 @@ public interface Server extends PluginMessageRecipient, net.kyori.adventure.audi +@@ -1886,5 +1886,74 @@ public interface Server extends PluginMessageRecipient, net.kyori.adventure.audi * @return true if player names should be suggested */ boolean suggestPlayerNamesWhenNullTabCompletions(); diff --git a/patches/api/0075-AsyncTabCompleteEvent.patch b/patches/api/0075-AsyncTabCompleteEvent.patch index c6d6dc4ba4..92a32f4d5f 100644 --- a/patches/api/0075-AsyncTabCompleteEvent.patch +++ b/patches/api/0075-AsyncTabCompleteEvent.patch @@ -1,5 +1,5 @@ From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: Aikar +From: Jason Penilla <11360596+jpenilla@users.noreply.github.com> Date: Sun, 26 Nov 2017 13:17:09 -0500 Subject: [PATCH] AsyncTabCompleteEvent @@ -11,12 +11,14 @@ and avoid going to main for tab completions. Especially useful if you need to query a database in order to obtain the results for tab completion, such as offline players. +Co-authored-by: Aikar + diff --git a/src/main/java/com/destroystokyo/paper/event/server/AsyncTabCompleteEvent.java b/src/main/java/com/destroystokyo/paper/event/server/AsyncTabCompleteEvent.java new file mode 100644 -index 0000000000000000000000000000000000000000..a135a9bfb2ccc8842baa9d5760fa05b7b1a529b1 +index 0000000000000000000000000000000000000000..9be64a95c2345433b6142d611077dedadcef9f5d --- /dev/null +++ b/src/main/java/com/destroystokyo/paper/event/server/AsyncTabCompleteEvent.java -@@ -0,0 +1,176 @@ +@@ -0,0 +1,328 @@ +/* + * Copyright (c) 2017 Daniel Ennis (Aikar) MIT License + * @@ -43,6 +45,11 @@ index 0000000000000000000000000000000000000000..a135a9bfb2ccc8842baa9d5760fa05b7 +package com.destroystokyo.paper.event.server; + +import com.google.common.base.Preconditions; ++import io.papermc.paper.util.TransformingRandomAccessList; ++import net.kyori.adventure.text.Component; ++import net.kyori.examination.Examinable; ++import net.kyori.examination.ExaminableProperty; ++import net.kyori.examination.string.StringExaminer; +import org.bukkit.Location; +import org.bukkit.command.Command; +import org.bukkit.command.CommandSender; @@ -52,6 +59,7 @@ index 0000000000000000000000000000000000000000..a135a9bfb2ccc8842baa9d5760fa05b7 + +import java.util.ArrayList; +import java.util.List; ++import java.util.stream.Stream; +import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.Nullable; + @@ -66,15 +74,29 @@ index 0000000000000000000000000000000000000000..a135a9bfb2ccc8842baa9d5760fa05b7 + private final boolean isCommand; + @Nullable + private final Location loc; -+ @NotNull private List completions; ++ private final List completions = new ArrayList<>(); ++ private final List stringCompletions = new TransformingRandomAccessList<>( ++ this.completions, ++ Completion::suggestion, ++ Completion::completion ++ ); + private boolean cancelled; + private boolean handled = false; + private boolean fireSyncHandler = true; + ++ public AsyncTabCompleteEvent(@NotNull CommandSender sender, @NotNull String buffer, boolean isCommand, @Nullable Location loc) { ++ super(true); ++ this.sender = sender; ++ this.buffer = buffer; ++ this.isCommand = isCommand; ++ this.loc = loc; ++ } ++ ++ @Deprecated + public AsyncTabCompleteEvent(@NotNull CommandSender sender, @NotNull List completions, @NotNull String buffer, boolean isCommand, @Nullable Location loc) { + super(true); + this.sender = sender; -+ this.completions = completions; ++ this.completions.addAll(fromStrings(completions)); + this.buffer = buffer; + this.isCommand = isCommand; + this.loc = loc; @@ -102,7 +124,7 @@ index 0000000000000000000000000000000000000000..a135a9bfb2ccc8842baa9d5760fa05b7 + */ + @NotNull + public List getCompletions() { -+ return completions; ++ return this.stringCompletions; + } + + /** @@ -116,8 +138,42 @@ index 0000000000000000000000000000000000000000..a135a9bfb2ccc8842baa9d5760fa05b7 + * @param completions the new completions + */ + public void setCompletions(@NotNull List completions) { ++ if (completions == this.stringCompletions) { ++ return; ++ } + Preconditions.checkNotNull(completions); -+ this.completions = new ArrayList<>(completions); ++ this.completions.clear(); ++ this.completions.addAll(fromStrings(completions)); ++ } ++ ++ /** ++ * The list of {@link Completion completions} which will be offered to the sender, in order. ++ * This list is mutable and reflects what will be offered. ++ *

++ * If this collection is not empty after the event is fired, then ++ * the standard process of calling {@link Command#tabComplete(CommandSender, String, String[])} ++ * or current player names will not be called. ++ * ++ * @return a list of offered completions ++ */ ++ public @NotNull List completions() { ++ return this.completions; ++ } ++ ++ /** ++ * Set the {@link Completion completions} offered, overriding any already set. ++ * If this collection is not empty after the event is fired, then ++ * the standard process of calling {@link Command#tabComplete(CommandSender, String, String[])} ++ * or current player names will not be called. ++ *

++ * The passed collection will be cloned to a new List. You must call {{@link #completions()}} to mutate from here ++ * ++ * @param newCompletions the new completions ++ */ ++ public void completions(final @NotNull List newCompletions) { ++ Preconditions.checkNotNull(newCompletions, "new completions"); ++ this.completions.clear(); ++ this.completions.addAll(newCompletions); + } + + /** @@ -192,6 +248,279 @@ index 0000000000000000000000000000000000000000..a135a9bfb2ccc8842baa9d5760fa05b7 + public static HandlerList getHandlerList() { + return handlers; + } ++ ++ private static @NotNull List fromStrings(final @NotNull List strings) { ++ final List list = new ArrayList<>(); ++ for (final String it : strings) { ++ list.add(new CompletionImpl(it, null)); ++ } ++ return list; ++ } ++ ++ /** ++ * A rich tab completion, consisting of a string suggestion, and a nullable {@link Component} tooltip. ++ */ ++ public interface Completion extends Examinable { ++ /** ++ * Get the suggestion string for this {@link Completion}. ++ * ++ * @return suggestion string ++ */ ++ @NotNull String suggestion(); ++ ++ /** ++ * Get the suggestion tooltip for this {@link Completion}. ++ * ++ * @return tooltip component ++ */ ++ @Nullable Component tooltip(); ++ ++ @Override ++ default @NotNull Stream examinableProperties() { ++ return Stream.of(ExaminableProperty.of("suggestion", this.suggestion()), ExaminableProperty.of("tooltip", this.tooltip())); ++ } ++ ++ /** ++ * Create a new {@link Completion} from a suggestion string. ++ * ++ * @param suggestion suggestion string ++ * @return new completion instance ++ */ ++ static @NotNull Completion completion(final @NotNull String suggestion) { ++ return new CompletionImpl(suggestion, null); ++ } ++ ++ /** ++ * Create a new {@link Completion} from a suggestion string and a tooltip {@link Component}. ++ * ++ *

If the provided component is null, the suggestion will not have a tooltip.

++ * ++ * @param suggestion suggestion string ++ * @param tooltip tooltip component, or null ++ * @return new completion instance ++ */ ++ static @NotNull Completion completion(final @NotNull String suggestion, final @Nullable Component tooltip) { ++ return new CompletionImpl(suggestion, tooltip); ++ } ++ } ++ ++ static final class CompletionImpl implements Completion { ++ private final String suggestion; ++ private final Component tooltip; ++ ++ CompletionImpl(final @NotNull String suggestion, final @Nullable Component tooltip) { ++ this.suggestion = suggestion; ++ this.tooltip = tooltip; ++ } ++ ++ @Override ++ public @NotNull String suggestion() { ++ return this.suggestion; ++ } ++ ++ @Override ++ public @Nullable Component tooltip() { ++ return this.tooltip; ++ } ++ ++ @Override ++ public boolean equals(final @Nullable Object o) { ++ if (this == o) { ++ return true; ++ } ++ if (o == null || this.getClass() != o.getClass()) { ++ return false; ++ } ++ final CompletionImpl that = (CompletionImpl) o; ++ return this.suggestion.equals(that.suggestion) ++ && java.util.Objects.equals(this.tooltip, that.tooltip); ++ } ++ ++ @Override ++ public int hashCode() { ++ return java.util.Objects.hash(this.suggestion, this.tooltip); ++ } ++ ++ @Override ++ public @NotNull String toString() { ++ return StringExaminer.simpleEscaping().examine(this); ++ } ++ } ++} +diff --git a/src/main/java/io/papermc/paper/util/TransformingRandomAccessList.java b/src/main/java/io/papermc/paper/util/TransformingRandomAccessList.java +new file mode 100644 +index 0000000000000000000000000000000000000000..6f560a51277ccbd46a9142cfa057d276118c1c7b +--- /dev/null ++++ b/src/main/java/io/papermc/paper/util/TransformingRandomAccessList.java +@@ -0,0 +1,169 @@ ++package io.papermc.paper.util; ++ ++import org.checkerframework.checker.nullness.qual.NonNull; ++import org.jetbrains.annotations.NotNull; ++ ++import java.util.AbstractList; ++import java.util.Iterator; ++import java.util.List; ++import java.util.ListIterator; ++import java.util.RandomAccess; ++import java.util.function.Function; ++import java.util.function.Predicate; ++ ++import static com.google.common.base.Preconditions.checkNotNull; ++ ++/** ++ * Modified version of the Guava class with the same name to support add operations. ++ * ++ * @param backing list element type ++ * @param transformed list element type ++ */ ++public final class TransformingRandomAccessList extends AbstractList implements RandomAccess { ++ final List fromList; ++ final Function toFunction; ++ final Function fromFunction; ++ ++ /** ++ * Create a new {@link TransformingRandomAccessList}. ++ * ++ * @param fromList backing list ++ * @param toFunction function mapping backing list element type to transformed list element type ++ * @param fromFunction function mapping transformed list element type to backing list element type ++ */ ++ public TransformingRandomAccessList( ++ final @NonNull List fromList, ++ final @NonNull Function toFunction, ++ final @NonNull Function fromFunction ++ ) { ++ this.fromList = checkNotNull(fromList); ++ this.toFunction = checkNotNull(toFunction); ++ this.fromFunction = checkNotNull(fromFunction); ++ } ++ ++ @Override ++ public void clear() { ++ this.fromList.clear(); ++ } ++ ++ @Override ++ public T get(int index) { ++ return this.toFunction.apply(this.fromList.get(index)); ++ } ++ ++ @Override ++ public @NotNull Iterator iterator() { ++ return this.listIterator(); ++ } ++ ++ @Override ++ public @NotNull ListIterator listIterator(int index) { ++ return new TransformedListIterator(this.fromList.listIterator(index)) { ++ @Override ++ T transform(F from) { ++ return TransformingRandomAccessList.this.toFunction.apply(from); ++ } ++ ++ @Override ++ F transformBack(T from) { ++ return TransformingRandomAccessList.this.fromFunction.apply(from); ++ } ++ }; ++ } ++ ++ @Override ++ public boolean isEmpty() { ++ return this.fromList.isEmpty(); ++ } ++ ++ @Override ++ public boolean removeIf(Predicate filter) { ++ checkNotNull(filter); ++ return this.fromList.removeIf(element -> filter.test(this.toFunction.apply(element))); ++ } ++ ++ @Override ++ public T remove(int index) { ++ return this.toFunction.apply(this.fromList.remove(index)); ++ } ++ ++ @Override ++ public int size() { ++ return this.fromList.size(); ++ } ++ ++ @Override ++ public T set(int i, T t) { ++ return this.toFunction.apply(this.fromList.set(i, this.fromFunction.apply(t))); ++ } ++ ++ @Override ++ public void add(int i, T t) { ++ this.fromList.add(i, this.fromFunction.apply(t)); ++ } ++ ++ static abstract class TransformedListIterator implements ListIterator, Iterator { ++ final Iterator backingIterator; ++ ++ TransformedListIterator(ListIterator backingIterator) { ++ this.backingIterator = checkNotNull((Iterator) backingIterator); ++ } ++ ++ private ListIterator backingIterator() { ++ return cast(this.backingIterator); ++ } ++ ++ static ListIterator cast(Iterator iterator) { ++ return (ListIterator) iterator; ++ } ++ ++ @Override ++ public final boolean hasPrevious() { ++ return this.backingIterator().hasPrevious(); ++ } ++ ++ @Override ++ public final T previous() { ++ return this.transform(this.backingIterator().previous()); ++ } ++ ++ @Override ++ public final int nextIndex() { ++ return this.backingIterator().nextIndex(); ++ } ++ ++ @Override ++ public final int previousIndex() { ++ return this.backingIterator().previousIndex(); ++ } ++ ++ @Override ++ public void set(T element) { ++ this.backingIterator().set(this.transformBack(element)); ++ } ++ ++ @Override ++ public void add(T element) { ++ this.backingIterator().add(this.transformBack(element)); ++ } ++ ++ abstract T transform(F from); ++ ++ abstract F transformBack(T to); ++ ++ @Override ++ public final boolean hasNext() { ++ return this.backingIterator.hasNext(); ++ } ++ ++ @Override ++ public final T next() { ++ return this.transform(this.backingIterator.next()); ++ } ++ ++ @Override ++ public final void remove() { ++ this.backingIterator.remove(); ++ } ++ } +} diff --git a/src/main/java/org/bukkit/event/server/TabCompleteEvent.java b/src/main/java/org/bukkit/event/server/TabCompleteEvent.java index 270e6d8ad4358baa256cee5f16cff281f063ce3b..4a3451af454295ac3e1b688e6665cad9fc594c82 100644 @@ -248,3 +577,16 @@ index 270e6d8ad4358baa256cee5f16cff281f063ce3b..4a3451af454295ac3e1b688e6665cad9 } @Override +diff --git a/src/test/java/org/bukkit/AnnotationTest.java b/src/test/java/org/bukkit/AnnotationTest.java +index 93498307004b68b934fbfa1aeb3aaf0e97cbdac7..bbe81f7a420f913ffdcad913a3c43ff41ead41f5 100644 +--- a/src/test/java/org/bukkit/AnnotationTest.java ++++ b/src/test/java/org/bukkit/AnnotationTest.java +@@ -48,6 +48,8 @@ public class AnnotationTest { + // Generic functional interface + "org/bukkit/util/Consumer", + // Paper start ++ "io/papermc/paper/util/TransformingRandomAccessList", ++ "io/papermc/paper/util/TransformingRandomAccessList$TransformedListIterator", + // Timings history is broken in terms of nullability due to guavas Function defining that the param is NonNull + "co/aikar/timings/TimingHistory$2", + "co/aikar/timings/TimingHistory$2$1", diff --git a/patches/api/0091-Player.setPlayerProfile-API.patch b/patches/api/0091-Player.setPlayerProfile-API.patch index 1c57f18834..0bb7394d49 100644 --- a/patches/api/0091-Player.setPlayerProfile-API.patch +++ b/patches/api/0091-Player.setPlayerProfile-API.patch @@ -6,10 +6,10 @@ Subject: [PATCH] Player.setPlayerProfile API This can be useful for changing name or skins after a player has logged in. diff --git a/src/main/java/org/bukkit/Bukkit.java b/src/main/java/org/bukkit/Bukkit.java -index be46b7aa492226d2c943b9a15f0e009878be422c..edbe7363b2da4f89cc31cbf9521c9a6271060ccd 100644 +index d5fd584c109c0a84a4259b10e7b43fae3a1da1ae..a452adcbf8657c501ad92f4cb361b551992f128f 100644 --- a/src/main/java/org/bukkit/Bukkit.java +++ b/src/main/java/org/bukkit/Bukkit.java -@@ -1196,8 +1196,10 @@ public final class Bukkit { +@@ -1197,8 +1197,10 @@ public final class Bukkit { * @return the new PlayerProfile * @throws IllegalArgumentException if both the unique id is * null and the name is null or blank @@ -20,7 +20,7 @@ index be46b7aa492226d2c943b9a15f0e009878be422c..edbe7363b2da4f89cc31cbf9521c9a62 public static PlayerProfile createPlayerProfile(@Nullable UUID uniqueId, @Nullable String name) { return server.createPlayerProfile(uniqueId, name); } -@@ -1208,8 +1210,10 @@ public final class Bukkit { +@@ -1209,8 +1211,10 @@ public final class Bukkit { * @param uniqueId the unique id * @return the new PlayerProfile * @throws IllegalArgumentException if the unique id is null @@ -31,7 +31,7 @@ index be46b7aa492226d2c943b9a15f0e009878be422c..edbe7363b2da4f89cc31cbf9521c9a62 public static PlayerProfile createPlayerProfile(@NotNull UUID uniqueId) { return server.createPlayerProfile(uniqueId); } -@@ -1221,8 +1225,10 @@ public final class Bukkit { +@@ -1222,8 +1226,10 @@ public final class Bukkit { * @return the new PlayerProfile * @throws IllegalArgumentException if the name is null or * blank @@ -43,10 +43,10 @@ index be46b7aa492226d2c943b9a15f0e009878be422c..edbe7363b2da4f89cc31cbf9521c9a62 return server.createPlayerProfile(name); } diff --git a/src/main/java/org/bukkit/Server.java b/src/main/java/org/bukkit/Server.java -index 04752eebe9df1138207a969fb1492a1f55b0b753..ca784abeb7f31c65e87df7750ae19aa9a8b65d72 100644 +index fab39e4fc595c022da27e87e27bd168939e54381..e90056341407f58ff6ce2d9b80c8f3f64464e650 100644 --- a/src/main/java/org/bukkit/Server.java +++ b/src/main/java/org/bukkit/Server.java -@@ -1014,8 +1014,10 @@ public interface Server extends PluginMessageRecipient, net.kyori.adventure.audi +@@ -1015,8 +1015,10 @@ public interface Server extends PluginMessageRecipient, net.kyori.adventure.audi * @return the new PlayerProfile * @throws IllegalArgumentException if both the unique id is * null and the name is null or blank @@ -57,7 +57,7 @@ index 04752eebe9df1138207a969fb1492a1f55b0b753..ca784abeb7f31c65e87df7750ae19aa9 PlayerProfile createPlayerProfile(@Nullable UUID uniqueId, @Nullable String name); /** -@@ -1024,8 +1026,10 @@ public interface Server extends PluginMessageRecipient, net.kyori.adventure.audi +@@ -1025,8 +1027,10 @@ public interface Server extends PluginMessageRecipient, net.kyori.adventure.audi * @param uniqueId the unique id * @return the new PlayerProfile * @throws IllegalArgumentException if the unique id is null @@ -68,7 +68,7 @@ index 04752eebe9df1138207a969fb1492a1f55b0b753..ca784abeb7f31c65e87df7750ae19aa9 PlayerProfile createPlayerProfile(@NotNull UUID uniqueId); /** -@@ -1035,8 +1039,10 @@ public interface Server extends PluginMessageRecipient, net.kyori.adventure.audi +@@ -1036,8 +1040,10 @@ public interface Server extends PluginMessageRecipient, net.kyori.adventure.audi * @return the new PlayerProfile * @throws IllegalArgumentException if the name is null or * blank diff --git a/patches/api/0092-getPlayerUniqueId-API.patch b/patches/api/0092-getPlayerUniqueId-API.patch index 76ef97a67b..41de8c76ab 100644 --- a/patches/api/0092-getPlayerUniqueId-API.patch +++ b/patches/api/0092-getPlayerUniqueId-API.patch @@ -9,10 +9,10 @@ In Offline Mode, will return an Offline UUID This is a more performant way to obtain a UUID for a name than loading an OfflinePlayer diff --git a/src/main/java/org/bukkit/Bukkit.java b/src/main/java/org/bukkit/Bukkit.java -index edbe7363b2da4f89cc31cbf9521c9a6271060ccd..5e5e8147b477b876a579327d5ea3d8d2393c0374 100644 +index a452adcbf8657c501ad92f4cb361b551992f128f..908e1aba5257688bb70fbf1ed83d2212305263a1 100644 --- a/src/main/java/org/bukkit/Bukkit.java +++ b/src/main/java/org/bukkit/Bukkit.java -@@ -656,6 +656,20 @@ public final class Bukkit { +@@ -657,6 +657,20 @@ public final class Bukkit { return server.getPlayer(id); } @@ -34,10 +34,10 @@ index edbe7363b2da4f89cc31cbf9521c9a6271060ccd..5e5e8147b477b876a579327d5ea3d8d2 * Gets the plugin manager for interfacing with plugins. * diff --git a/src/main/java/org/bukkit/Server.java b/src/main/java/org/bukkit/Server.java -index ca784abeb7f31c65e87df7750ae19aa9a8b65d72..1a4559c88ece08e4a0c27e808f69693fb89fc474 100644 +index e90056341407f58ff6ce2d9b80c8f3f64464e650..b0e6446c0dc49088878d7ae453dc3eee8b346f4e 100644 --- a/src/main/java/org/bukkit/Server.java +++ b/src/main/java/org/bukkit/Server.java -@@ -558,6 +558,18 @@ public interface Server extends PluginMessageRecipient, net.kyori.adventure.audi +@@ -559,6 +559,18 @@ public interface Server extends PluginMessageRecipient, net.kyori.adventure.audi @Nullable public Player getPlayer(@NotNull UUID id); diff --git a/patches/api/0142-Add-More-Creeper-API.patch b/patches/api/0142-Add-More-Creeper-API.patch index b45e2fbeba..9054588ca5 100644 --- a/patches/api/0142-Add-More-Creeper-API.patch +++ b/patches/api/0142-Add-More-Creeper-API.patch @@ -6,10 +6,10 @@ Subject: [PATCH] Add More Creeper API diff --git a/src/main/java/com/destroystokyo/paper/event/entity/CreeperIgniteEvent.java b/src/main/java/com/destroystokyo/paper/event/entity/CreeperIgniteEvent.java new file mode 100644 -index 0000000000000000000000000000000000000000..ff10251b6ded533b08048ec533525176eff03707 +index 0000000000000000000000000000000000000000..e9768c919a1860881802ab68eff559874590ac1c --- /dev/null +++ b/src/main/java/com/destroystokyo/paper/event/entity/CreeperIgniteEvent.java -@@ -0,0 +1,54 @@ +@@ -0,0 +1,56 @@ +package com.destroystokyo.paper.event.entity; + +import org.bukkit.entity.Creeper; @@ -19,7 +19,9 @@ index 0000000000000000000000000000000000000000..ff10251b6ded533b08048ec533525176 +import org.jetbrains.annotations.NotNull; + +/** -+ * Called when a Creeper is ignite flag is changed (armed/disarmed to explode). ++ * Called when a Creeper is ignited either by a ++ * flint and steel, {@link Creeper#ignite()} or ++ * {@link Creeper#setIgnited(boolean)}. + */ +public class CreeperIgniteEvent extends EntityEvent implements Cancellable { + private static final HandlerList handlers = new HandlerList(); diff --git a/patches/api/0143-Inventory-removeItemAnySlot.patch b/patches/api/0143-Inventory-removeItemAnySlot.patch index 4d6f2e9e57..25b79cf6bd 100644 --- a/patches/api/0143-Inventory-removeItemAnySlot.patch +++ b/patches/api/0143-Inventory-removeItemAnySlot.patch @@ -5,10 +5,26 @@ Subject: [PATCH] Inventory#removeItemAnySlot diff --git a/src/main/java/org/bukkit/inventory/Inventory.java b/src/main/java/org/bukkit/inventory/Inventory.java -index 5576a6a8df8c95164bf2dde45d756ce8b7ec957a..9c6a5bdac8c3ab682bbfae04ff24b76a62bc2883 100644 +index 5576a6a8df8c95164bf2dde45d756ce8b7ec957a..f1a48eab1a357ae64545e1f1dc941c383cff8707 100644 --- a/src/main/java/org/bukkit/inventory/Inventory.java +++ b/src/main/java/org/bukkit/inventory/Inventory.java -@@ -125,6 +125,34 @@ public interface Inventory extends Iterable { +@@ -104,7 +104,9 @@ public interface Inventory extends Iterable { + public HashMap addItem(@NotNull ItemStack... items) throws IllegalArgumentException; + + /** +- * Removes the given ItemStacks from the inventory. ++ * Removes the given ItemStacks from the storage contents of the inventory. ++ * For removing ItemStacks from the inventories that have other content groups, ++ * like Player inventories, see {@link #removeItemAnySlot(ItemStack...)}. + *

+ * It will try to remove 'as much as possible' from the types and amounts + * you give as arguments. +@@ -121,10 +123,39 @@ public interface Inventory extends Iterable { + * @param items The ItemStacks to remove + * @return A HashMap containing items that couldn't be removed. + * @throws IllegalArgumentException if items is null ++ * @see #removeItemAnySlot(ItemStack...) + */ @NotNull public HashMap removeItem(@NotNull ItemStack... items) throws IllegalArgumentException; diff --git a/patches/api/0150-Add-Git-information-to-version-command-on-startup.patch b/patches/api/0150-Add-Git-information-to-version-command-on-startup.patch index 35409e6f53..533ac1f870 100644 --- a/patches/api/0150-Add-Git-information-to-version-command-on-startup.patch +++ b/patches/api/0150-Add-Git-information-to-version-command-on-startup.patch @@ -48,10 +48,10 @@ index 0000000000000000000000000000000000000000..909617079db61b675cc7b60b44ef96b3 + } +} diff --git a/src/main/java/org/bukkit/Bukkit.java b/src/main/java/org/bukkit/Bukkit.java -index 5e5e8147b477b876a579327d5ea3d8d2393c0374..1c416a48d2a069a0167bc0be6fa1d65d14f35816 100644 +index 908e1aba5257688bb70fbf1ed83d2212305263a1..303e539338383d0d7825b873611ca5843ee1c0a3 100644 --- a/src/main/java/org/bukkit/Bukkit.java +++ b/src/main/java/org/bukkit/Bukkit.java -@@ -53,6 +53,7 @@ import org.bukkit.util.CachedServerIcon; +@@ -54,6 +54,7 @@ import org.bukkit.util.CachedServerIcon; import org.jetbrains.annotations.Contract; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; @@ -59,7 +59,7 @@ index 5e5e8147b477b876a579327d5ea3d8d2393c0374..1c416a48d2a069a0167bc0be6fa1d65d /** * Represents the Bukkit core, for version and Server singleton handling -@@ -102,7 +103,25 @@ public final class Bukkit { +@@ -103,7 +104,25 @@ public final class Bukkit { } Bukkit.server = server; diff --git a/patches/api/0157-Add-Material-Tags.patch b/patches/api/0157-Add-Material-Tags.patch index 8cee9a5025..8bfbe70e68 100644 --- a/patches/api/0157-Add-Material-Tags.patch +++ b/patches/api/0157-Add-Material-Tags.patch @@ -113,7 +113,7 @@ index 0000000000000000000000000000000000000000..a02a02aa0c87e0f0ed9e509e4dcab015 +} diff --git a/src/main/java/com/destroystokyo/paper/MaterialTags.java b/src/main/java/com/destroystokyo/paper/MaterialTags.java new file mode 100644 -index 0000000000000000000000000000000000000000..41384ef616c5d3099482ea7d09dea12a240e758a +index 0000000000000000000000000000000000000000..1a78872e26f8fadbddd9af15fff063d03690077f --- /dev/null +++ b/src/main/java/com/destroystokyo/paper/MaterialTags.java @@ -0,0 +1,661 @@ @@ -741,7 +741,7 @@ index 0000000000000000000000000000000000000000..41384ef616c5d3099482ea7d09dea12a + * Combine with other copper-related tags to filter is-un-waxed or not. + */ + public static final MaterialSetTag UNWAXED_COPPER_BLOCKS = new MaterialSetTag(keyFor("unwaxed_copper_blocks")) -+ .contains("CUT_COPPER").endsWith("_COPPER").notContains("WAXED").ensureSize("UNWAXED_COPPER_BLOCKS", 16).lock(); ++ .contains("CUT_COPPER").endsWith("_COPPER").notContains("WAXED").add(Material.COPPER_BLOCK).not(Material.RAW_COPPER).ensureSize("UNWAXED_COPPER_BLOCKS", 16).lock(); + + /** + * Covers all copper block variants. diff --git a/patches/api/0164-Make-the-default-permission-message-configurable.patch b/patches/api/0164-Make-the-default-permission-message-configurable.patch index f89e579635..780b707eab 100644 --- a/patches/api/0164-Make-the-default-permission-message-configurable.patch +++ b/patches/api/0164-Make-the-default-permission-message-configurable.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Make the default permission message configurable diff --git a/src/main/java/org/bukkit/Bukkit.java b/src/main/java/org/bukkit/Bukkit.java -index 1c416a48d2a069a0167bc0be6fa1d65d14f35816..62ecce029f38bd6a3e07981887916bb54e0c62f9 100644 +index 303e539338383d0d7825b873611ca5843ee1c0a3..00295e256c0def25dd3e552ef67eea06ab01ad15 100644 --- a/src/main/java/org/bukkit/Bukkit.java +++ b/src/main/java/org/bukkit/Bukkit.java -@@ -2180,6 +2180,28 @@ public final class Bukkit { +@@ -2193,6 +2193,28 @@ public final class Bukkit { return server.suggestPlayerNamesWhenNullTabCompletions(); } @@ -38,10 +38,10 @@ index 1c416a48d2a069a0167bc0be6fa1d65d14f35816..62ecce029f38bd6a3e07981887916bb5 * Creates a PlayerProfile for the specified uuid, with name as null. * diff --git a/src/main/java/org/bukkit/Server.java b/src/main/java/org/bukkit/Server.java -index 1a4559c88ece08e4a0c27e808f69693fb89fc474..85a0de6277aff8a81c8e58b3b29b98d99b6b1fb9 100644 +index b0e6446c0dc49088878d7ae453dc3eee8b346f4e..dc26cf95f1769da76dd4d768a0912c1f5346d83e 100644 --- a/src/main/java/org/bukkit/Server.java +++ b/src/main/java/org/bukkit/Server.java -@@ -1894,6 +1894,23 @@ public interface Server extends PluginMessageRecipient, net.kyori.adventure.audi +@@ -1905,6 +1905,23 @@ public interface Server extends PluginMessageRecipient, net.kyori.adventure.audi */ boolean suggestPlayerNamesWhenNullTabCompletions(); diff --git a/patches/api/0176-Fix-Spigot-annotation-mistakes.patch b/patches/api/0176-Fix-Spigot-annotation-mistakes.patch index 87640ed1fa..1a08d96f55 100644 --- a/patches/api/0176-Fix-Spigot-annotation-mistakes.patch +++ b/patches/api/0176-Fix-Spigot-annotation-mistakes.patch @@ -9,10 +9,10 @@ a ton of noise to plugin developers. These do not help plugin developers if they bring moise noise than value. diff --git a/src/main/java/org/bukkit/Bukkit.java b/src/main/java/org/bukkit/Bukkit.java -index 62ecce029f38bd6a3e07981887916bb54e0c62f9..5f684c9ac218f105efe77ef08cae4b759868b0ea 100644 +index 00295e256c0def25dd3e552ef67eea06ab01ad15..940e93021aba7dade1558054deead5896d74d3c6 100644 --- a/src/main/java/org/bukkit/Bukkit.java +++ b/src/main/java/org/bukkit/Bukkit.java -@@ -1197,10 +1197,8 @@ public final class Bukkit { +@@ -1198,10 +1198,8 @@ public final class Bukkit { * @param name the name the player to retrieve * @return an offline player * @see #getOfflinePlayer(java.util.UUID) @@ -24,7 +24,7 @@ index 62ecce029f38bd6a3e07981887916bb54e0c62f9..5f684c9ac218f105efe77ef08cae4b75 @NotNull public static OfflinePlayer getOfflinePlayer(@NotNull String name) { return server.getOfflinePlayer(name); -@@ -1749,7 +1747,7 @@ public final class Bukkit { +@@ -1750,7 +1748,7 @@ public final class Bukkit { * * @return the scoreboard manager or null if no worlds are loaded. */ @@ -159,10 +159,10 @@ index 6277451c3c6c551078c237cd767b6d70c4f585ea..10f5cfb1885833a1d2c1027c03974da4 CRACKED(0x0), GLYPHED(0x1), diff --git a/src/main/java/org/bukkit/Server.java b/src/main/java/org/bukkit/Server.java -index 85a0de6277aff8a81c8e58b3b29b98d99b6b1fb9..1fecaed0b5774e3888bd1f5103828cc38f0265d9 100644 +index dc26cf95f1769da76dd4d768a0912c1f5346d83e..8c608f9260acd8257b49f9befae510fa645886a8 100644 --- a/src/main/java/org/bukkit/Server.java +++ b/src/main/java/org/bukkit/Server.java -@@ -998,10 +998,8 @@ public interface Server extends PluginMessageRecipient, net.kyori.adventure.audi +@@ -999,10 +999,8 @@ public interface Server extends PluginMessageRecipient, net.kyori.adventure.audi * @param name the name the player to retrieve * @return an offline player * @see #getOfflinePlayer(java.util.UUID) @@ -174,7 +174,7 @@ index 85a0de6277aff8a81c8e58b3b29b98d99b6b1fb9..1fecaed0b5774e3888bd1f5103828cc3 @NotNull public OfflinePlayer getOfflinePlayer(@NotNull String name); -@@ -1467,7 +1465,7 @@ public interface Server extends PluginMessageRecipient, net.kyori.adventure.audi +@@ -1468,7 +1466,7 @@ public interface Server extends PluginMessageRecipient, net.kyori.adventure.audi * * @return the scoreboard manager or null if no worlds are loaded. */ @@ -183,6 +183,18 @@ index 85a0de6277aff8a81c8e58b3b29b98d99b6b1fb9..1fecaed0b5774e3888bd1f5103828cc3 ScoreboardManager getScoreboardManager(); /** +diff --git a/src/main/java/org/bukkit/UndefinedNullability.java b/src/main/java/org/bukkit/UndefinedNullability.java +index f465ea001c190e10eb99db818559d302e5512e99..567f560d145dea6fc7240699175496156c468a6d 100644 +--- a/src/main/java/org/bukkit/UndefinedNullability.java ++++ b/src/main/java/org/bukkit/UndefinedNullability.java +@@ -13,6 +13,7 @@ import java.lang.annotation.RetentionPolicy; + * suggests a bad API design. + */ + @Retention(RetentionPolicy.CLASS) ++@java.lang.annotation.Documented // Paper + @Deprecated + public @interface UndefinedNullability { + diff --git a/src/main/java/org/bukkit/Vibration.java b/src/main/java/org/bukkit/Vibration.java index 8d568d21fcbf706f55cda087bd7222ac60889c0a..209a302c3a2ed333780ed760314a6ed352fc0767 100644 --- a/src/main/java/org/bukkit/Vibration.java @@ -563,10 +575,10 @@ index 1d442dc16cbb0fed21714d47007f3f11e30c57d4..af8f7b88edf0fa790edcf16356a030c4 return setInput(input.getItemType(), input.getData()); } diff --git a/src/main/java/org/bukkit/inventory/Inventory.java b/src/main/java/org/bukkit/inventory/Inventory.java -index 9c6a5bdac8c3ab682bbfae04ff24b76a62bc2883..875c401153349b0f2468525e54cf10ca86430087 100644 +index f1a48eab1a357ae64545e1f1dc941c383cff8707..466d1bd7089b76f48f953e1a51c611ecd93dcd54 100644 --- a/src/main/java/org/bukkit/inventory/Inventory.java +++ b/src/main/java/org/bukkit/inventory/Inventory.java -@@ -158,8 +158,7 @@ public interface Inventory extends Iterable { +@@ -161,8 +161,7 @@ public interface Inventory extends Iterable { * * @return An array of ItemStacks from the inventory. Individual items may be null. */ @@ -576,7 +588,7 @@ index 9c6a5bdac8c3ab682bbfae04ff24b76a62bc2883..875c401153349b0f2468525e54cf10ca /** * Completely replaces the inventory's contents. Removes all existing -@@ -170,7 +169,7 @@ public interface Inventory extends Iterable { +@@ -173,7 +172,7 @@ public interface Inventory extends Iterable { * @throws IllegalArgumentException If the array has more items than the * inventory. */ @@ -585,7 +597,7 @@ index 9c6a5bdac8c3ab682bbfae04ff24b76a62bc2883..875c401153349b0f2468525e54cf10ca /** * Return the contents from the section of the inventory where items can -@@ -183,8 +182,7 @@ public interface Inventory extends Iterable { +@@ -186,8 +185,7 @@ public interface Inventory extends Iterable { * * @return inventory storage contents. Individual items may be null. */ @@ -595,7 +607,7 @@ index 9c6a5bdac8c3ab682bbfae04ff24b76a62bc2883..875c401153349b0f2468525e54cf10ca /** * Put the given ItemStacks into the storage slots -@@ -193,7 +191,7 @@ public interface Inventory extends Iterable { +@@ -196,7 +194,7 @@ public interface Inventory extends Iterable { * @throws IllegalArgumentException If the array has more items than the * inventory. */ diff --git a/patches/api/0184-Expose-the-internal-current-tick.patch b/patches/api/0184-Expose-the-internal-current-tick.patch index dc8b2199c9..c8ae43d595 100644 --- a/patches/api/0184-Expose-the-internal-current-tick.patch +++ b/patches/api/0184-Expose-the-internal-current-tick.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Expose the internal current tick diff --git a/src/main/java/org/bukkit/Bukkit.java b/src/main/java/org/bukkit/Bukkit.java -index 5f684c9ac218f105efe77ef08cae4b759868b0ea..fb5ba85b324eb78c31367bc59f2d1ca7eec1bf2b 100644 +index 940e93021aba7dade1558054deead5896d74d3c6..d3f784c0c68567ee94befa57e0be1cedc7d586cb 100644 --- a/src/main/java/org/bukkit/Bukkit.java +++ b/src/main/java/org/bukkit/Bukkit.java -@@ -2276,6 +2276,10 @@ public final class Bukkit { +@@ -2289,6 +2289,10 @@ public final class Bukkit { public static com.destroystokyo.paper.profile.PlayerProfile createProfileExact(@Nullable UUID uuid, @Nullable String name) { return server.createProfileExact(uuid, name); } @@ -20,10 +20,10 @@ index 5f684c9ac218f105efe77ef08cae4b759868b0ea..fb5ba85b324eb78c31367bc59f2d1ca7 @NotNull diff --git a/src/main/java/org/bukkit/Server.java b/src/main/java/org/bukkit/Server.java -index 1fecaed0b5774e3888bd1f5103828cc38f0265d9..05587286b253b6f877aa5fae19d556cc8967a326 100644 +index 8c608f9260acd8257b49f9befae510fa645886a8..d092d43178c1795028c33518713a8156648c460b 100644 --- a/src/main/java/org/bukkit/Server.java +++ b/src/main/java/org/bukkit/Server.java -@@ -1977,5 +1977,12 @@ public interface Server extends PluginMessageRecipient, net.kyori.adventure.audi +@@ -1988,5 +1988,12 @@ public interface Server extends PluginMessageRecipient, net.kyori.adventure.audi */ @NotNull com.destroystokyo.paper.profile.PlayerProfile createProfileExact(@Nullable UUID uuid, @Nullable String name); diff --git a/patches/api/0190-Add-tick-times-API.patch b/patches/api/0190-Add-tick-times-API.patch index 6b7590837e..3f4f81a1a3 100644 --- a/patches/api/0190-Add-tick-times-API.patch +++ b/patches/api/0190-Add-tick-times-API.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Add tick times API diff --git a/src/main/java/org/bukkit/Bukkit.java b/src/main/java/org/bukkit/Bukkit.java -index fb5ba85b324eb78c31367bc59f2d1ca7eec1bf2b..4ba11b4a22981472e3fcbfe8ffadaa3f3c140e2f 100644 +index d3f784c0c68567ee94befa57e0be1cedc7d586cb..dab845c22713c0a3ae044afaf16d7b72eeff8ea5 100644 --- a/src/main/java/org/bukkit/Bukkit.java +++ b/src/main/java/org/bukkit/Bukkit.java -@@ -1948,6 +1948,25 @@ public final class Bukkit { +@@ -1961,6 +1961,25 @@ public final class Bukkit { public static double[] getTPS() { return server.getTPS(); } @@ -35,10 +35,10 @@ index fb5ba85b324eb78c31367bc59f2d1ca7eec1bf2b..4ba11b4a22981472e3fcbfe8ffadaa3f /** diff --git a/src/main/java/org/bukkit/Server.java b/src/main/java/org/bukkit/Server.java -index 05587286b253b6f877aa5fae19d556cc8967a326..a4775467581c351f4c89521c2e017b31d48bf3b5 100644 +index d092d43178c1795028c33518713a8156648c460b..13e4893049219ff1e50ede8df405561360ae4760 100644 --- a/src/main/java/org/bukkit/Server.java +++ b/src/main/java/org/bukkit/Server.java -@@ -1639,6 +1639,21 @@ public interface Server extends PluginMessageRecipient, net.kyori.adventure.audi +@@ -1650,6 +1650,21 @@ public interface Server extends PluginMessageRecipient, net.kyori.adventure.audi */ @NotNull public double[] getTPS(); diff --git a/patches/api/0191-Expose-MinecraftServer-isRunning.patch b/patches/api/0191-Expose-MinecraftServer-isRunning.patch index 844c2aff6b..7a9f4ee7d6 100644 --- a/patches/api/0191-Expose-MinecraftServer-isRunning.patch +++ b/patches/api/0191-Expose-MinecraftServer-isRunning.patch @@ -6,10 +6,10 @@ Subject: [PATCH] Expose MinecraftServer#isRunning This allows for plugins to detect if the server is actually turning off in onDisable rather than just plugins reloading. diff --git a/src/main/java/org/bukkit/Bukkit.java b/src/main/java/org/bukkit/Bukkit.java -index 4ba11b4a22981472e3fcbfe8ffadaa3f3c140e2f..88fe6c7dabdcf5c1a81126e7c98a361ec25438a0 100644 +index dab845c22713c0a3ae044afaf16d7b72eeff8ea5..4771149c9fcee5e51c5313fffb105ad6f68a256a 100644 --- a/src/main/java/org/bukkit/Bukkit.java +++ b/src/main/java/org/bukkit/Bukkit.java -@@ -2299,6 +2299,15 @@ public final class Bukkit { +@@ -2312,6 +2312,15 @@ public final class Bukkit { public static int getCurrentTick() { return server.getCurrentTick(); } @@ -26,10 +26,10 @@ index 4ba11b4a22981472e3fcbfe8ffadaa3f3c140e2f..88fe6c7dabdcf5c1a81126e7c98a361e @NotNull diff --git a/src/main/java/org/bukkit/Server.java b/src/main/java/org/bukkit/Server.java -index a4775467581c351f4c89521c2e017b31d48bf3b5..8cf4a6d82278770598dee9191409c676b7fb1b08 100644 +index 13e4893049219ff1e50ede8df405561360ae4760..201cbb0d33fc25e90b7960894eb6a9e6ef0d107b 100644 --- a/src/main/java/org/bukkit/Server.java +++ b/src/main/java/org/bukkit/Server.java -@@ -1999,5 +1999,12 @@ public interface Server extends PluginMessageRecipient, net.kyori.adventure.audi +@@ -2010,5 +2010,12 @@ public interface Server extends PluginMessageRecipient, net.kyori.adventure.audi * @return Current tick */ int getCurrentTick(); diff --git a/patches/api/0198-Add-item-slot-convenience-methods.patch b/patches/api/0198-Add-item-slot-convenience-methods.patch index 9614f432d5..abad4883ed 100644 --- a/patches/api/0198-Add-item-slot-convenience-methods.patch +++ b/patches/api/0198-Add-item-slot-convenience-methods.patch @@ -1,5 +1,5 @@ From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: Nassim Jahnke +From: Nassim Jahnke Date: Sat, 25 Apr 2020 23:31:28 +0200 Subject: [PATCH] Add item slot convenience methods diff --git a/patches/api/0200-Expose-game-version.patch b/patches/api/0200-Expose-game-version.patch index e18f477e9d..be7aec4713 100644 --- a/patches/api/0200-Expose-game-version.patch +++ b/patches/api/0200-Expose-game-version.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Expose game version diff --git a/src/main/java/org/bukkit/Bukkit.java b/src/main/java/org/bukkit/Bukkit.java -index 88fe6c7dabdcf5c1a81126e7c98a361ec25438a0..e9e7fdcb8b57d07d88c9e9694dd119b07fa5b823 100644 +index 4771149c9fcee5e51c5313fffb105ad6f68a256a..022a3de1bc7969a1db7395a910782bde1468758a 100644 --- a/src/main/java/org/bukkit/Bukkit.java +++ b/src/main/java/org/bukkit/Bukkit.java -@@ -154,6 +154,18 @@ public final class Bukkit { +@@ -155,6 +155,18 @@ public final class Bukkit { return server.getBukkitVersion(); } @@ -28,10 +28,10 @@ index 88fe6c7dabdcf5c1a81126e7c98a361ec25438a0..e9e7fdcb8b57d07d88c9e9694dd119b0 * Gets a view of all currently logged in players. This {@linkplain * Collections#unmodifiableCollection(Collection) view} is a reused diff --git a/src/main/java/org/bukkit/Server.java b/src/main/java/org/bukkit/Server.java -index 8cf4a6d82278770598dee9191409c676b7fb1b08..dd1bb341714d27c286b57f9410a690f754bd937b 100644 +index 201cbb0d33fc25e90b7960894eb6a9e6ef0d107b..832b19712612fdbac5d2f472aab203b14f7e4a46 100644 --- a/src/main/java/org/bukkit/Server.java +++ b/src/main/java/org/bukkit/Server.java -@@ -112,6 +112,16 @@ public interface Server extends PluginMessageRecipient, net.kyori.adventure.audi +@@ -113,6 +113,16 @@ public interface Server extends PluginMessageRecipient, net.kyori.adventure.audi @NotNull public String getBukkitVersion(); diff --git a/patches/api/0201-Add-Mob-Goal-API.patch b/patches/api/0201-Add-Mob-Goal-API.patch index b655037f40..d4f8ce75de 100644 --- a/patches/api/0201-Add-Mob-Goal-API.patch +++ b/patches/api/0201-Add-Mob-Goal-API.patch @@ -523,10 +523,10 @@ index 0000000000000000000000000000000000000000..8fd399f791b45eb7fc62693ca954eea0 + @Deprecated GoalKey UNIVERSAL_ANGER_RESET = GoalKey.of(Mob.class, NamespacedKey.minecraft("universal_anger_reset")); +} diff --git a/src/main/java/org/bukkit/Bukkit.java b/src/main/java/org/bukkit/Bukkit.java -index e9e7fdcb8b57d07d88c9e9694dd119b07fa5b823..1f2d25a48bfd67f770560e6284e0be27b6b4df38 100644 +index 022a3de1bc7969a1db7395a910782bde1468758a..f3f8a6db7ee1b4ea1aaf6bc972fa02a8af5f3772 100644 --- a/src/main/java/org/bukkit/Bukkit.java +++ b/src/main/java/org/bukkit/Bukkit.java -@@ -2320,6 +2320,16 @@ public final class Bukkit { +@@ -2333,6 +2333,16 @@ public final class Bukkit { public static boolean isStopping() { return server.isStopping(); } @@ -544,10 +544,10 @@ index e9e7fdcb8b57d07d88c9e9694dd119b07fa5b823..1f2d25a48bfd67f770560e6284e0be27 @NotNull diff --git a/src/main/java/org/bukkit/Server.java b/src/main/java/org/bukkit/Server.java -index dd1bb341714d27c286b57f9410a690f754bd937b..88eab327d5854fd853b1adb5b4f04a2bcfd66849 100644 +index 832b19712612fdbac5d2f472aab203b14f7e4a46..4f17bc607639bb3d20a1694ffb02d22d283348b3 100644 --- a/src/main/java/org/bukkit/Server.java +++ b/src/main/java/org/bukkit/Server.java -@@ -2016,5 +2016,13 @@ public interface Server extends PluginMessageRecipient, net.kyori.adventure.audi +@@ -2027,5 +2027,13 @@ public interface Server extends PluginMessageRecipient, net.kyori.adventure.audi * @return true if server is in the process of being shutdown */ boolean isStopping(); diff --git a/patches/api/0207-Inventory-getHolder-method-without-block-snapshot.patch b/patches/api/0207-Inventory-getHolder-method-without-block-snapshot.patch index 5cb00f4606..d834d6cdb3 100644 --- a/patches/api/0207-Inventory-getHolder-method-without-block-snapshot.patch +++ b/patches/api/0207-Inventory-getHolder-method-without-block-snapshot.patch @@ -28,10 +28,10 @@ index 83a4642119c3f33749e04c774cf2b39839f797e2..a39d2f1acbbd84ae0e2cf29f85594e09 public Location getLocation() { return getInventory().getLocation(); diff --git a/src/main/java/org/bukkit/inventory/Inventory.java b/src/main/java/org/bukkit/inventory/Inventory.java -index 875c401153349b0f2468525e54cf10ca86430087..960626dd64ec9b0c5f4638c1ada463fd20c6b5fc 100644 +index 466d1bd7089b76f48f953e1a51c611ecd93dcd54..129b5ab5062beeb9bb52465a788bc3a3aee9c49e 100644 --- a/src/main/java/org/bukkit/inventory/Inventory.java +++ b/src/main/java/org/bukkit/inventory/Inventory.java -@@ -382,6 +382,17 @@ public interface Inventory extends Iterable { +@@ -385,6 +385,17 @@ public interface Inventory extends Iterable { @Nullable public InventoryHolder getHolder(); diff --git a/patches/api/0216-Add-setMaxPlayers-API.patch b/patches/api/0216-Add-setMaxPlayers-API.patch index 188b12d3b9..e37f12a879 100644 --- a/patches/api/0216-Add-setMaxPlayers-API.patch +++ b/patches/api/0216-Add-setMaxPlayers-API.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Add #setMaxPlayers API diff --git a/src/main/java/org/bukkit/Bukkit.java b/src/main/java/org/bukkit/Bukkit.java -index 1f2d25a48bfd67f770560e6284e0be27b6b4df38..bd7c7d1cc25f1bc246944de2ffc20cadaacd1d29 100644 +index f3f8a6db7ee1b4ea1aaf6bc972fa02a8af5f3772..2d26f1fd3bbbe95e7a73bb5ebc7d85c9e066c1ee 100644 --- a/src/main/java/org/bukkit/Bukkit.java +++ b/src/main/java/org/bukkit/Bukkit.java -@@ -207,6 +207,17 @@ public final class Bukkit { +@@ -208,6 +208,17 @@ public final class Bukkit { return server.getMaxPlayers(); } @@ -27,10 +27,10 @@ index 1f2d25a48bfd67f770560e6284e0be27b6b4df38..bd7c7d1cc25f1bc246944de2ffc20cad * Get the game port that the server runs on. * diff --git a/src/main/java/org/bukkit/Server.java b/src/main/java/org/bukkit/Server.java -index 88eab327d5854fd853b1adb5b4f04a2bcfd66849..f05dc6c186c94b940ea69d7ebc32451cc38f7fcf 100644 +index 4f17bc607639bb3d20a1694ffb02d22d283348b3..634a7e38987bc18232c07e5f767b37b523f13920 100644 --- a/src/main/java/org/bukkit/Server.java +++ b/src/main/java/org/bukkit/Server.java -@@ -159,6 +159,15 @@ public interface Server extends PluginMessageRecipient, net.kyori.adventure.audi +@@ -160,6 +160,15 @@ public interface Server extends PluginMessageRecipient, net.kyori.adventure.audi */ public int getMaxPlayers(); diff --git a/patches/api/0229-Add-getOfflinePlayerIfCached-String.patch b/patches/api/0229-Add-getOfflinePlayerIfCached-String.patch index 11eebf4492..1aebb14af4 100644 --- a/patches/api/0229-Add-getOfflinePlayerIfCached-String.patch +++ b/patches/api/0229-Add-getOfflinePlayerIfCached-String.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Add getOfflinePlayerIfCached(String) diff --git a/src/main/java/org/bukkit/Bukkit.java b/src/main/java/org/bukkit/Bukkit.java -index bd7c7d1cc25f1bc246944de2ffc20cadaacd1d29..104738ea3bc2a678f15011ab1c6c7f38b56bf340 100644 +index 2d26f1fd3bbbe95e7a73bb5ebc7d85c9e066c1ee..f1e1efaebfd9fe4399ff9d23c76f7dde6419ff71 100644 --- a/src/main/java/org/bukkit/Bukkit.java +++ b/src/main/java/org/bukkit/Bukkit.java -@@ -1227,6 +1227,27 @@ public final class Bukkit { +@@ -1228,6 +1228,27 @@ public final class Bukkit { return server.getOfflinePlayer(name); } @@ -37,10 +37,10 @@ index bd7c7d1cc25f1bc246944de2ffc20cadaacd1d29..104738ea3bc2a678f15011ab1c6c7f38 * Gets the player by the given UUID, regardless if they are offline or * online. diff --git a/src/main/java/org/bukkit/Server.java b/src/main/java/org/bukkit/Server.java -index f05dc6c186c94b940ea69d7ebc32451cc38f7fcf..5e8ce65588a4b4be71292f5b92c049ae58d3a9a0 100644 +index 634a7e38987bc18232c07e5f767b37b523f13920..50542df291d90a667af119fb9fcc3db2535ae6b5 100644 --- a/src/main/java/org/bukkit/Server.java +++ b/src/main/java/org/bukkit/Server.java -@@ -1022,6 +1022,25 @@ public interface Server extends PluginMessageRecipient, net.kyori.adventure.audi +@@ -1023,6 +1023,25 @@ public interface Server extends PluginMessageRecipient, net.kyori.adventure.audi @NotNull public OfflinePlayer getOfflinePlayer(@NotNull String name); diff --git a/patches/api/0236-Add-PlayerItemCooldownEvent.patch b/patches/api/0236-Add-PlayerItemCooldownEvent.patch index 82d9c9fc63..378f88f6e6 100644 --- a/patches/api/0236-Add-PlayerItemCooldownEvent.patch +++ b/patches/api/0236-Add-PlayerItemCooldownEvent.patch @@ -1,5 +1,5 @@ From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: Nassim Jahnke +From: Nassim Jahnke Date: Tue, 25 Aug 2020 13:45:15 +0200 Subject: [PATCH] Add PlayerItemCooldownEvent diff --git a/patches/api/0237-More-lightning-API.patch b/patches/api/0237-More-lightning-API.patch index f253560abb..3ff480a14c 100644 --- a/patches/api/0237-More-lightning-API.patch +++ b/patches/api/0237-More-lightning-API.patch @@ -1,5 +1,5 @@ From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: Nassim Jahnke +From: Nassim Jahnke Date: Sun, 26 Jul 2020 14:44:16 +0200 Subject: [PATCH] More lightning API diff --git a/patches/api/0246-Add-API-to-get-Material-from-Boats-and-Minecarts.patch b/patches/api/0246-Add-API-to-get-Material-from-Boats-and-Minecarts.patch index 0a774fcefa..b42db5d4db 100644 --- a/patches/api/0246-Add-API-to-get-Material-from-Boats-and-Minecarts.patch +++ b/patches/api/0246-Add-API-to-get-Material-from-Boats-and-Minecarts.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Add API to get Material from Boats and Minecarts diff --git a/src/main/java/org/bukkit/entity/Boat.java b/src/main/java/org/bukkit/entity/Boat.java -index e5d5d2c944df1e9a81b38d3854fbe70c166588d1..3f848572935a73f637c6a91a97fa70041b0c6361 100644 +index e5d5d2c944df1e9a81b38d3854fbe70c166588d1..3e458b96d5c15a78d3d411d5b88a716213588a94 100644 --- a/src/main/java/org/bukkit/entity/Boat.java +++ b/src/main/java/org/bukkit/entity/Boat.java -@@ -173,4 +173,16 @@ public interface Boat extends Vehicle { +@@ -173,4 +173,14 @@ public interface Boat extends Vehicle { ON_LAND, IN_AIR; } @@ -18,9 +18,7 @@ index e5d5d2c944df1e9a81b38d3854fbe70c166588d1..3f848572935a73f637c6a91a97fa7004 + * Gets the {@link Material} that represents this Boat type. + * + * @return the boat material. -+ * @deprecated use {@link #getBoatType()} and {@link Type#getMaterial()} + */ -+ @Deprecated + @NotNull + public Material getBoatMaterial(); + // Paper end diff --git a/patches/api/0264-Add-dropLeash-variable-to-EntityUnleashEvent.patch b/patches/api/0264-Add-dropLeash-variable-to-EntityUnleashEvent.patch index 75aa758140..9aed50ae84 100644 --- a/patches/api/0264-Add-dropLeash-variable-to-EntityUnleashEvent.patch +++ b/patches/api/0264-Add-dropLeash-variable-to-EntityUnleashEvent.patch @@ -1,5 +1,5 @@ From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: Nassim Jahnke +From: Nassim Jahnke Date: Fri, 29 Jan 2021 15:13:04 +0100 Subject: [PATCH] Add dropLeash variable to EntityUnleashEvent diff --git a/patches/api/0277-Expand-world-key-API.patch b/patches/api/0277-Expand-world-key-API.patch index 2c0357e44d..3f046485fd 100644 --- a/patches/api/0277-Expand-world-key-API.patch +++ b/patches/api/0277-Expand-world-key-API.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Expand world key API diff --git a/src/main/java/org/bukkit/Bukkit.java b/src/main/java/org/bukkit/Bukkit.java -index 104738ea3bc2a678f15011ab1c6c7f38b56bf340..0ddad5d32494495bb797559a10336a401e445fef 100644 +index f1e1efaebfd9fe4399ff9d23c76f7dde6419ff71..db44d88bf169f59a759be165094876497487d756 100644 --- a/src/main/java/org/bukkit/Bukkit.java +++ b/src/main/java/org/bukkit/Bukkit.java -@@ -810,6 +810,18 @@ public final class Bukkit { +@@ -811,6 +811,18 @@ public final class Bukkit { public static World getWorld(@NotNull UUID uid) { return server.getWorld(uid); } @@ -56,10 +56,10 @@ index 2fa3de66107162ccaa158b369e2c4a926ecaff92..aa534b1a9a1fb84a2fbd4b372f313bb4 // Paper end } diff --git a/src/main/java/org/bukkit/Server.java b/src/main/java/org/bukkit/Server.java -index 5e8ce65588a4b4be71292f5b92c049ae58d3a9a0..80d762390a42070f1953a388c896cd93640b506e 100644 +index 50542df291d90a667af119fb9fcc3db2535ae6b5..723057dcc769bd29acdb82561ee0126ed467579d 100644 --- a/src/main/java/org/bukkit/Server.java +++ b/src/main/java/org/bukkit/Server.java -@@ -670,6 +670,17 @@ public interface Server extends PluginMessageRecipient, net.kyori.adventure.audi +@@ -671,6 +671,17 @@ public interface Server extends PluginMessageRecipient, net.kyori.adventure.audi @Nullable public World getWorld(@NotNull UUID uid); diff --git a/patches/api/0279-Expose-protocol-version.patch b/patches/api/0279-Expose-protocol-version.patch index 79071d45af..c7d7976e04 100644 --- a/patches/api/0279-Expose-protocol-version.patch +++ b/patches/api/0279-Expose-protocol-version.patch @@ -1,5 +1,5 @@ From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: Nassim Jahnke +From: Nassim Jahnke Date: Fri, 26 Mar 2021 11:23:27 +0100 Subject: [PATCH] Expose protocol version diff --git a/patches/api/0280-Allow-for-Component-suggestion-tooltips-in-AsyncTabC.patch b/patches/api/0280-Allow-for-Component-suggestion-tooltips-in-AsyncTabC.patch deleted file mode 100644 index 3649c64a09..0000000000 --- a/patches/api/0280-Allow-for-Component-suggestion-tooltips-in-AsyncTabC.patch +++ /dev/null @@ -1,407 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: Jason Penilla <11360596+jpenilla@users.noreply.github.com> -Date: Thu, 1 Apr 2021 00:34:41 -0700 -Subject: [PATCH] Allow for Component suggestion tooltips in - AsyncTabCompleteEvent - - -diff --git a/src/main/java/com/destroystokyo/paper/event/server/AsyncTabCompleteEvent.java b/src/main/java/com/destroystokyo/paper/event/server/AsyncTabCompleteEvent.java -index a135a9bfb2ccc8842baa9d5760fa05b7b1a529b1..9be64a95c2345433b6142d611077dedadcef9f5d 100644 ---- a/src/main/java/com/destroystokyo/paper/event/server/AsyncTabCompleteEvent.java -+++ b/src/main/java/com/destroystokyo/paper/event/server/AsyncTabCompleteEvent.java -@@ -24,6 +24,11 @@ - package com.destroystokyo.paper.event.server; - - import com.google.common.base.Preconditions; -+import io.papermc.paper.util.TransformingRandomAccessList; -+import net.kyori.adventure.text.Component; -+import net.kyori.examination.Examinable; -+import net.kyori.examination.ExaminableProperty; -+import net.kyori.examination.string.StringExaminer; - import org.bukkit.Location; - import org.bukkit.command.Command; - import org.bukkit.command.CommandSender; -@@ -33,6 +38,7 @@ import org.bukkit.event.HandlerList; - - import java.util.ArrayList; - import java.util.List; -+import java.util.stream.Stream; - import org.jetbrains.annotations.NotNull; - import org.jetbrains.annotations.Nullable; - -@@ -47,15 +53,29 @@ public class AsyncTabCompleteEvent extends Event implements Cancellable { - private final boolean isCommand; - @Nullable - private final Location loc; -- @NotNull private List completions; -+ private final List completions = new ArrayList<>(); -+ private final List stringCompletions = new TransformingRandomAccessList<>( -+ this.completions, -+ Completion::suggestion, -+ Completion::completion -+ ); - private boolean cancelled; - private boolean handled = false; - private boolean fireSyncHandler = true; - -+ public AsyncTabCompleteEvent(@NotNull CommandSender sender, @NotNull String buffer, boolean isCommand, @Nullable Location loc) { -+ super(true); -+ this.sender = sender; -+ this.buffer = buffer; -+ this.isCommand = isCommand; -+ this.loc = loc; -+ } -+ -+ @Deprecated - public AsyncTabCompleteEvent(@NotNull CommandSender sender, @NotNull List completions, @NotNull String buffer, boolean isCommand, @Nullable Location loc) { - super(true); - this.sender = sender; -- this.completions = completions; -+ this.completions.addAll(fromStrings(completions)); - this.buffer = buffer; - this.isCommand = isCommand; - this.loc = loc; -@@ -83,7 +103,7 @@ public class AsyncTabCompleteEvent extends Event implements Cancellable { - */ - @NotNull - public List getCompletions() { -- return completions; -+ return this.stringCompletions; - } - - /** -@@ -97,8 +117,42 @@ public class AsyncTabCompleteEvent extends Event implements Cancellable { - * @param completions the new completions - */ - public void setCompletions(@NotNull List completions) { -+ if (completions == this.stringCompletions) { -+ return; -+ } - Preconditions.checkNotNull(completions); -- this.completions = new ArrayList<>(completions); -+ this.completions.clear(); -+ this.completions.addAll(fromStrings(completions)); -+ } -+ -+ /** -+ * The list of {@link Completion completions} which will be offered to the sender, in order. -+ * This list is mutable and reflects what will be offered. -+ *

-+ * If this collection is not empty after the event is fired, then -+ * the standard process of calling {@link Command#tabComplete(CommandSender, String, String[])} -+ * or current player names will not be called. -+ * -+ * @return a list of offered completions -+ */ -+ public @NotNull List completions() { -+ return this.completions; -+ } -+ -+ /** -+ * Set the {@link Completion completions} offered, overriding any already set. -+ * If this collection is not empty after the event is fired, then -+ * the standard process of calling {@link Command#tabComplete(CommandSender, String, String[])} -+ * or current player names will not be called. -+ *

-+ * The passed collection will be cloned to a new List. You must call {{@link #completions()}} to mutate from here -+ * -+ * @param newCompletions the new completions -+ */ -+ public void completions(final @NotNull List newCompletions) { -+ Preconditions.checkNotNull(newCompletions, "new completions"); -+ this.completions.clear(); -+ this.completions.addAll(newCompletions); - } - - /** -@@ -173,4 +227,102 @@ public class AsyncTabCompleteEvent extends Event implements Cancellable { - public static HandlerList getHandlerList() { - return handlers; - } -+ -+ private static @NotNull List fromStrings(final @NotNull List strings) { -+ final List list = new ArrayList<>(); -+ for (final String it : strings) { -+ list.add(new CompletionImpl(it, null)); -+ } -+ return list; -+ } -+ -+ /** -+ * A rich tab completion, consisting of a string suggestion, and a nullable {@link Component} tooltip. -+ */ -+ public interface Completion extends Examinable { -+ /** -+ * Get the suggestion string for this {@link Completion}. -+ * -+ * @return suggestion string -+ */ -+ @NotNull String suggestion(); -+ -+ /** -+ * Get the suggestion tooltip for this {@link Completion}. -+ * -+ * @return tooltip component -+ */ -+ @Nullable Component tooltip(); -+ -+ @Override -+ default @NotNull Stream examinableProperties() { -+ return Stream.of(ExaminableProperty.of("suggestion", this.suggestion()), ExaminableProperty.of("tooltip", this.tooltip())); -+ } -+ -+ /** -+ * Create a new {@link Completion} from a suggestion string. -+ * -+ * @param suggestion suggestion string -+ * @return new completion instance -+ */ -+ static @NotNull Completion completion(final @NotNull String suggestion) { -+ return new CompletionImpl(suggestion, null); -+ } -+ -+ /** -+ * Create a new {@link Completion} from a suggestion string and a tooltip {@link Component}. -+ * -+ *

If the provided component is null, the suggestion will not have a tooltip.

-+ * -+ * @param suggestion suggestion string -+ * @param tooltip tooltip component, or null -+ * @return new completion instance -+ */ -+ static @NotNull Completion completion(final @NotNull String suggestion, final @Nullable Component tooltip) { -+ return new CompletionImpl(suggestion, tooltip); -+ } -+ } -+ -+ static final class CompletionImpl implements Completion { -+ private final String suggestion; -+ private final Component tooltip; -+ -+ CompletionImpl(final @NotNull String suggestion, final @Nullable Component tooltip) { -+ this.suggestion = suggestion; -+ this.tooltip = tooltip; -+ } -+ -+ @Override -+ public @NotNull String suggestion() { -+ return this.suggestion; -+ } -+ -+ @Override -+ public @Nullable Component tooltip() { -+ return this.tooltip; -+ } -+ -+ @Override -+ public boolean equals(final @Nullable Object o) { -+ if (this == o) { -+ return true; -+ } -+ if (o == null || this.getClass() != o.getClass()) { -+ return false; -+ } -+ final CompletionImpl that = (CompletionImpl) o; -+ return this.suggestion.equals(that.suggestion) -+ && java.util.Objects.equals(this.tooltip, that.tooltip); -+ } -+ -+ @Override -+ public int hashCode() { -+ return java.util.Objects.hash(this.suggestion, this.tooltip); -+ } -+ -+ @Override -+ public @NotNull String toString() { -+ return StringExaminer.simpleEscaping().examine(this); -+ } -+ } - } -diff --git a/src/main/java/io/papermc/paper/util/TransformingRandomAccessList.java b/src/main/java/io/papermc/paper/util/TransformingRandomAccessList.java -new file mode 100644 -index 0000000000000000000000000000000000000000..6f560a51277ccbd46a9142cfa057d276118c1c7b ---- /dev/null -+++ b/src/main/java/io/papermc/paper/util/TransformingRandomAccessList.java -@@ -0,0 +1,169 @@ -+package io.papermc.paper.util; -+ -+import org.checkerframework.checker.nullness.qual.NonNull; -+import org.jetbrains.annotations.NotNull; -+ -+import java.util.AbstractList; -+import java.util.Iterator; -+import java.util.List; -+import java.util.ListIterator; -+import java.util.RandomAccess; -+import java.util.function.Function; -+import java.util.function.Predicate; -+ -+import static com.google.common.base.Preconditions.checkNotNull; -+ -+/** -+ * Modified version of the Guava class with the same name to support add operations. -+ * -+ * @param backing list element type -+ * @param transformed list element type -+ */ -+public final class TransformingRandomAccessList extends AbstractList implements RandomAccess { -+ final List fromList; -+ final Function toFunction; -+ final Function fromFunction; -+ -+ /** -+ * Create a new {@link TransformingRandomAccessList}. -+ * -+ * @param fromList backing list -+ * @param toFunction function mapping backing list element type to transformed list element type -+ * @param fromFunction function mapping transformed list element type to backing list element type -+ */ -+ public TransformingRandomAccessList( -+ final @NonNull List fromList, -+ final @NonNull Function toFunction, -+ final @NonNull Function fromFunction -+ ) { -+ this.fromList = checkNotNull(fromList); -+ this.toFunction = checkNotNull(toFunction); -+ this.fromFunction = checkNotNull(fromFunction); -+ } -+ -+ @Override -+ public void clear() { -+ this.fromList.clear(); -+ } -+ -+ @Override -+ public T get(int index) { -+ return this.toFunction.apply(this.fromList.get(index)); -+ } -+ -+ @Override -+ public @NotNull Iterator iterator() { -+ return this.listIterator(); -+ } -+ -+ @Override -+ public @NotNull ListIterator listIterator(int index) { -+ return new TransformedListIterator(this.fromList.listIterator(index)) { -+ @Override -+ T transform(F from) { -+ return TransformingRandomAccessList.this.toFunction.apply(from); -+ } -+ -+ @Override -+ F transformBack(T from) { -+ return TransformingRandomAccessList.this.fromFunction.apply(from); -+ } -+ }; -+ } -+ -+ @Override -+ public boolean isEmpty() { -+ return this.fromList.isEmpty(); -+ } -+ -+ @Override -+ public boolean removeIf(Predicate filter) { -+ checkNotNull(filter); -+ return this.fromList.removeIf(element -> filter.test(this.toFunction.apply(element))); -+ } -+ -+ @Override -+ public T remove(int index) { -+ return this.toFunction.apply(this.fromList.remove(index)); -+ } -+ -+ @Override -+ public int size() { -+ return this.fromList.size(); -+ } -+ -+ @Override -+ public T set(int i, T t) { -+ return this.toFunction.apply(this.fromList.set(i, this.fromFunction.apply(t))); -+ } -+ -+ @Override -+ public void add(int i, T t) { -+ this.fromList.add(i, this.fromFunction.apply(t)); -+ } -+ -+ static abstract class TransformedListIterator implements ListIterator, Iterator { -+ final Iterator backingIterator; -+ -+ TransformedListIterator(ListIterator backingIterator) { -+ this.backingIterator = checkNotNull((Iterator) backingIterator); -+ } -+ -+ private ListIterator backingIterator() { -+ return cast(this.backingIterator); -+ } -+ -+ static
ListIterator cast(Iterator iterator) { -+ return (ListIterator) iterator; -+ } -+ -+ @Override -+ public final boolean hasPrevious() { -+ return this.backingIterator().hasPrevious(); -+ } -+ -+ @Override -+ public final T previous() { -+ return this.transform(this.backingIterator().previous()); -+ } -+ -+ @Override -+ public final int nextIndex() { -+ return this.backingIterator().nextIndex(); -+ } -+ -+ @Override -+ public final int previousIndex() { -+ return this.backingIterator().previousIndex(); -+ } -+ -+ @Override -+ public void set(T element) { -+ this.backingIterator().set(this.transformBack(element)); -+ } -+ -+ @Override -+ public void add(T element) { -+ this.backingIterator().add(this.transformBack(element)); -+ } -+ -+ abstract T transform(F from); -+ -+ abstract F transformBack(T to); -+ -+ @Override -+ public final boolean hasNext() { -+ return this.backingIterator.hasNext(); -+ } -+ -+ @Override -+ public final T next() { -+ return this.transform(this.backingIterator.next()); -+ } -+ -+ @Override -+ public final void remove() { -+ this.backingIterator.remove(); -+ } -+ } -+} -diff --git a/src/test/java/org/bukkit/AnnotationTest.java b/src/test/java/org/bukkit/AnnotationTest.java -index 93498307004b68b934fbfa1aeb3aaf0e97cbdac7..bbe81f7a420f913ffdcad913a3c43ff41ead41f5 100644 ---- a/src/test/java/org/bukkit/AnnotationTest.java -+++ b/src/test/java/org/bukkit/AnnotationTest.java -@@ -48,6 +48,8 @@ public class AnnotationTest { - // Generic functional interface - "org/bukkit/util/Consumer", - // Paper start -+ "io/papermc/paper/util/TransformingRandomAccessList", -+ "io/papermc/paper/util/TransformingRandomAccessList$TransformedListIterator", - // Timings history is broken in terms of nullability due to guavas Function defining that the param is NonNull - "co/aikar/timings/TimingHistory$2", - "co/aikar/timings/TimingHistory$2$1", diff --git a/patches/api/0281-add-isDeeplySleeping-to-HumanEntity.patch b/patches/api/0280-add-isDeeplySleeping-to-HumanEntity.patch similarity index 100% rename from patches/api/0281-add-isDeeplySleeping-to-HumanEntity.patch rename to patches/api/0280-add-isDeeplySleeping-to-HumanEntity.patch diff --git a/patches/api/0282-add-consumeFuel-to-FurnaceBurnEvent.patch b/patches/api/0281-add-consumeFuel-to-FurnaceBurnEvent.patch similarity index 100% rename from patches/api/0282-add-consumeFuel-to-FurnaceBurnEvent.patch rename to patches/api/0281-add-consumeFuel-to-FurnaceBurnEvent.patch diff --git a/patches/api/0283-add-get-set-drop-chance-to-EntityEquipment.patch b/patches/api/0282-add-get-set-drop-chance-to-EntityEquipment.patch similarity index 100% rename from patches/api/0283-add-get-set-drop-chance-to-EntityEquipment.patch rename to patches/api/0282-add-get-set-drop-chance-to-EntityEquipment.patch diff --git a/patches/api/0284-Added-PlayerDeepSleepEvent.patch b/patches/api/0283-Added-PlayerDeepSleepEvent.patch similarity index 100% rename from patches/api/0284-Added-PlayerDeepSleepEvent.patch rename to patches/api/0283-Added-PlayerDeepSleepEvent.patch diff --git a/patches/api/0285-More-World-API.patch b/patches/api/0284-More-World-API.patch similarity index 100% rename from patches/api/0285-More-World-API.patch rename to patches/api/0284-More-World-API.patch diff --git a/patches/api/0286-Added-PlayerBedFailEnterEvent.patch b/patches/api/0285-Added-PlayerBedFailEnterEvent.patch similarity index 100% rename from patches/api/0286-Added-PlayerBedFailEnterEvent.patch rename to patches/api/0285-Added-PlayerBedFailEnterEvent.patch diff --git a/patches/api/0287-Introduce-beacon-activation-deactivation-events.patch b/patches/api/0286-Introduce-beacon-activation-deactivation-events.patch similarity index 100% rename from patches/api/0287-Introduce-beacon-activation-deactivation-events.patch rename to patches/api/0286-Introduce-beacon-activation-deactivation-events.patch diff --git a/patches/api/0288-PlayerMoveEvent-Improvements.patch b/patches/api/0287-PlayerMoveEvent-Improvements.patch similarity index 100% rename from patches/api/0288-PlayerMoveEvent-Improvements.patch rename to patches/api/0287-PlayerMoveEvent-Improvements.patch diff --git a/patches/api/0289-add-RespawnFlags-to-PlayerRespawnEvent.patch b/patches/api/0288-add-RespawnFlags-to-PlayerRespawnEvent.patch similarity index 100% rename from patches/api/0289-add-RespawnFlags-to-PlayerRespawnEvent.patch rename to patches/api/0288-add-RespawnFlags-to-PlayerRespawnEvent.patch diff --git a/patches/api/0290-Add-more-WanderingTrader-API.patch b/patches/api/0289-Add-more-WanderingTrader-API.patch similarity index 100% rename from patches/api/0290-Add-more-WanderingTrader-API.patch rename to patches/api/0289-Add-more-WanderingTrader-API.patch diff --git a/patches/api/0291-Add-EntityBlockStorage-clearEntities.patch b/patches/api/0290-Add-EntityBlockStorage-clearEntities.patch similarity index 100% rename from patches/api/0291-Add-EntityBlockStorage-clearEntities.patch rename to patches/api/0290-Add-EntityBlockStorage-clearEntities.patch diff --git a/patches/api/0292-Add-Adventure-message-to-PlayerAdvancementDoneEvent.patch b/patches/api/0291-Add-Adventure-message-to-PlayerAdvancementDoneEvent.patch similarity index 100% rename from patches/api/0292-Add-Adventure-message-to-PlayerAdvancementDoneEvent.patch rename to patches/api/0291-Add-Adventure-message-to-PlayerAdvancementDoneEvent.patch diff --git a/patches/api/0293-Add-raw-address-to-AsyncPlayerPreLoginEvent.patch b/patches/api/0292-Add-raw-address-to-AsyncPlayerPreLoginEvent.patch similarity index 100% rename from patches/api/0293-Add-raw-address-to-AsyncPlayerPreLoginEvent.patch rename to patches/api/0292-Add-raw-address-to-AsyncPlayerPreLoginEvent.patch diff --git a/patches/api/0294-Inventory-close.patch b/patches/api/0293-Inventory-close.patch similarity index 83% rename from patches/api/0294-Inventory-close.patch rename to patches/api/0293-Inventory-close.patch index 9b5cbb7dfe..74af8b6304 100644 --- a/patches/api/0294-Inventory-close.patch +++ b/patches/api/0293-Inventory-close.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Inventory#close diff --git a/src/main/java/org/bukkit/inventory/Inventory.java b/src/main/java/org/bukkit/inventory/Inventory.java -index 960626dd64ec9b0c5f4638c1ada463fd20c6b5fc..1b577c03c3152d22b70f8bdb321b28ad8fbbc3af 100644 +index 129b5ab5062beeb9bb52465a788bc3a3aee9c49e..c574bb94b21eb27974b40c839fce52c6ac4b54b4 100644 --- a/src/main/java/org/bukkit/inventory/Inventory.java +++ b/src/main/java/org/bukkit/inventory/Inventory.java -@@ -352,6 +352,15 @@ public interface Inventory extends Iterable { +@@ -355,6 +355,15 @@ public interface Inventory extends Iterable { */ public void clear(); diff --git a/patches/api/0295-Add-a-should-burn-in-sunlight-API-for-Phantoms-and-S.patch b/patches/api/0294-Add-a-should-burn-in-sunlight-API-for-Phantoms-and-S.patch similarity index 100% rename from patches/api/0295-Add-a-should-burn-in-sunlight-API-for-Phantoms-and-S.patch rename to patches/api/0294-Add-a-should-burn-in-sunlight-API-for-Phantoms-and-S.patch diff --git a/patches/api/0296-Add-basic-Datapack-API.patch b/patches/api/0295-Add-basic-Datapack-API.patch similarity index 90% rename from patches/api/0296-Add-basic-Datapack-API.patch rename to patches/api/0295-Add-basic-Datapack-API.patch index 4ceba1ef45..a1a8c84460 100644 --- a/patches/api/0296-Add-basic-Datapack-API.patch +++ b/patches/api/0295-Add-basic-Datapack-API.patch @@ -70,10 +70,10 @@ index 0000000000000000000000000000000000000000..58f78d5e91beacaf710f62461cf869f7 + +} diff --git a/src/main/java/org/bukkit/Bukkit.java b/src/main/java/org/bukkit/Bukkit.java -index 0ddad5d32494495bb797559a10336a401e445fef..05186443e25706ed77f7187eea6ac84666613a88 100644 +index db44d88bf169f59a759be165094876497487d756..d8e301befb37b540bc246cf58988923b0ab23375 100644 --- a/src/main/java/org/bukkit/Bukkit.java +++ b/src/main/java/org/bukkit/Bukkit.java -@@ -2374,6 +2374,14 @@ public final class Bukkit { +@@ -2387,6 +2387,14 @@ public final class Bukkit { public static com.destroystokyo.paper.entity.ai.MobGoals getMobGoals() { return server.getMobGoals(); } @@ -89,10 +89,10 @@ index 0ddad5d32494495bb797559a10336a401e445fef..05186443e25706ed77f7187eea6ac846 @NotNull diff --git a/src/main/java/org/bukkit/Server.java b/src/main/java/org/bukkit/Server.java -index 80d762390a42070f1953a388c896cd93640b506e..3d78e555725b48cb7e5750e8b4b3f1f0463bddc2 100644 +index 723057dcc769bd29acdb82561ee0126ed467579d..16f631fdde4b63e0ed3162486dba684697bdffa7 100644 --- a/src/main/java/org/bukkit/Server.java +++ b/src/main/java/org/bukkit/Server.java -@@ -2063,5 +2063,11 @@ public interface Server extends PluginMessageRecipient, net.kyori.adventure.audi +@@ -2074,5 +2074,11 @@ public interface Server extends PluginMessageRecipient, net.kyori.adventure.audi */ @NotNull com.destroystokyo.paper.entity.ai.MobGoals getMobGoals(); diff --git a/patches/api/0297-additions-to-PlayerGameModeChangeEvent.patch b/patches/api/0296-additions-to-PlayerGameModeChangeEvent.patch similarity index 100% rename from patches/api/0297-additions-to-PlayerGameModeChangeEvent.patch rename to patches/api/0296-additions-to-PlayerGameModeChangeEvent.patch diff --git a/patches/api/0298-ItemStack-repair-check-API.patch b/patches/api/0297-ItemStack-repair-check-API.patch similarity index 100% rename from patches/api/0298-ItemStack-repair-check-API.patch rename to patches/api/0297-ItemStack-repair-check-API.patch diff --git a/patches/api/0299-More-Enchantment-API.patch b/patches/api/0298-More-Enchantment-API.patch similarity index 100% rename from patches/api/0299-More-Enchantment-API.patch rename to patches/api/0298-More-Enchantment-API.patch diff --git a/patches/api/0300-List-all-missing-hard-depends-not-just-first.patch b/patches/api/0299-List-all-missing-hard-depends-not-just-first.patch similarity index 100% rename from patches/api/0300-List-all-missing-hard-depends-not-just-first.patch rename to patches/api/0299-List-all-missing-hard-depends-not-just-first.patch diff --git a/patches/api/0301-Add-Mob-lookAt-API.patch b/patches/api/0300-Add-Mob-lookAt-API.patch similarity index 100% rename from patches/api/0301-Add-Mob-lookAt-API.patch rename to patches/api/0300-Add-Mob-lookAt-API.patch diff --git a/patches/api/0302-ItemStack-editMeta.patch b/patches/api/0301-ItemStack-editMeta.patch similarity index 100% rename from patches/api/0302-ItemStack-editMeta.patch rename to patches/api/0301-ItemStack-editMeta.patch diff --git a/patches/api/0303-Add-EntityInsideBlockEvent.patch b/patches/api/0302-Add-EntityInsideBlockEvent.patch similarity index 100% rename from patches/api/0303-Add-EntityInsideBlockEvent.patch rename to patches/api/0302-Add-EntityInsideBlockEvent.patch diff --git a/patches/api/0304-Attributes-API-for-item-defaults.patch b/patches/api/0303-Attributes-API-for-item-defaults.patch similarity index 100% rename from patches/api/0304-Attributes-API-for-item-defaults.patch rename to patches/api/0303-Attributes-API-for-item-defaults.patch diff --git a/patches/api/0305-Add-cause-to-Weather-ThunderChangeEvents.patch b/patches/api/0304-Add-cause-to-Weather-ThunderChangeEvents.patch similarity index 100% rename from patches/api/0305-Add-cause-to-Weather-ThunderChangeEvents.patch rename to patches/api/0304-Add-cause-to-Weather-ThunderChangeEvents.patch diff --git a/patches/api/0306-More-Lidded-Block-API.patch b/patches/api/0305-More-Lidded-Block-API.patch similarity index 100% rename from patches/api/0306-More-Lidded-Block-API.patch rename to patches/api/0305-More-Lidded-Block-API.patch diff --git a/patches/api/0307-Add-PlayerKickEvent-causes.patch b/patches/api/0306-Add-PlayerKickEvent-causes.patch similarity index 100% rename from patches/api/0307-Add-PlayerKickEvent-causes.patch rename to patches/api/0306-Add-PlayerKickEvent-causes.patch diff --git a/patches/api/0308-Add-PufferFishStateChangeEvent.patch b/patches/api/0307-Add-PufferFishStateChangeEvent.patch similarity index 100% rename from patches/api/0308-Add-PufferFishStateChangeEvent.patch rename to patches/api/0307-Add-PufferFishStateChangeEvent.patch diff --git a/patches/api/0309-Add-BellRevealRaiderEvent.patch b/patches/api/0308-Add-BellRevealRaiderEvent.patch similarity index 100% rename from patches/api/0309-Add-BellRevealRaiderEvent.patch rename to patches/api/0308-Add-BellRevealRaiderEvent.patch diff --git a/patches/api/0310-Add-ElderGuardianAppearanceEvent.patch b/patches/api/0309-Add-ElderGuardianAppearanceEvent.patch similarity index 100% rename from patches/api/0310-Add-ElderGuardianAppearanceEvent.patch rename to patches/api/0309-Add-ElderGuardianAppearanceEvent.patch diff --git a/patches/api/0311-Add-more-line-of-sight-methods.patch b/patches/api/0310-Add-more-line-of-sight-methods.patch similarity index 100% rename from patches/api/0311-Add-more-line-of-sight-methods.patch rename to patches/api/0310-Add-more-line-of-sight-methods.patch diff --git a/patches/api/0312-Add-more-LimitedRegion-API.patch b/patches/api/0311-Add-more-LimitedRegion-API.patch similarity index 100% rename from patches/api/0312-Add-more-LimitedRegion-API.patch rename to patches/api/0311-Add-more-LimitedRegion-API.patch diff --git a/patches/api/0313-Missing-Entity-Behavior-API.patch b/patches/api/0312-Missing-Entity-Behavior-API.patch similarity index 96% rename from patches/api/0313-Missing-Entity-Behavior-API.patch rename to patches/api/0312-Missing-Entity-Behavior-API.patch index d36918f526..28ca125b7d 100644 --- a/patches/api/0313-Missing-Entity-Behavior-API.patch +++ b/patches/api/0312-Missing-Entity-Behavior-API.patch @@ -3,7 +3,7 @@ From: Owen1212055 <23108066+Owen1212055@users.noreply.github.com> Date: Fri, 28 May 2021 21:06:59 -0400 Subject: [PATCH] Missing Entity Behavior API -Co-authored-by: Nassim Jahnke +Co-authored-by: Nassim Jahnke Co-authored-by: Jake Potrebic diff --git a/src/main/java/org/bukkit/entity/AbstractHorse.java b/src/main/java/org/bukkit/entity/AbstractHorse.java @@ -563,6 +563,29 @@ index 627e3c1a96ae3331f5aa2dd7803dd2a31c7204be..3c447d2300c866ae605eeca97bd869f4 + void setLimitedLifetimeTicks(int ticks); // Paper end } +diff --git a/src/main/java/org/bukkit/entity/Warden.java b/src/main/java/org/bukkit/entity/Warden.java +index 25bbecc89b01faa4905def014d07a616e39df992..5cd34abcc42aa2582dee6770ff1563b1b7b0ee21 100644 +--- a/src/main/java/org/bukkit/entity/Warden.java ++++ b/src/main/java/org/bukkit/entity/Warden.java +@@ -18,6 +18,18 @@ public interface Warden extends Monster { + */ + int getAnger(@NotNull Entity entity); + ++ // Paper start ++ /** ++ * Gets the highest anger level of this warden. ++ *

++ * Anger is an integer from 0 to 150. Once a Warden reaches 80 anger at a ++ * target it will actively pursue it. ++ * ++ * @return highest anger level ++ */ ++ int getHighestAnger(); ++ // Paper end ++ + /** + * Increases the anger level of this warden. + * diff --git a/src/main/java/org/bukkit/entity/Wither.java b/src/main/java/org/bukkit/entity/Wither.java index b86f0196e6eb8070830f63a94f732522c2a6c2f1..a1b42ae35dda2da90ba00a2d6666514f7c5b11dd 100644 --- a/src/main/java/org/bukkit/entity/Wither.java diff --git a/patches/api/0314-Adds-PlayerArmSwingEvent.patch b/patches/api/0313-Adds-PlayerArmSwingEvent.patch similarity index 100% rename from patches/api/0314-Adds-PlayerArmSwingEvent.patch rename to patches/api/0313-Adds-PlayerArmSwingEvent.patch diff --git a/patches/api/0315-Add-PlayerSignCommandPreprocessEvent.patch b/patches/api/0314-Add-PlayerSignCommandPreprocessEvent.patch similarity index 100% rename from patches/api/0315-Add-PlayerSignCommandPreprocessEvent.patch rename to patches/api/0314-Add-PlayerSignCommandPreprocessEvent.patch diff --git a/patches/api/0316-fix-empty-array-elements-in-command-arguments.patch b/patches/api/0315-fix-empty-array-elements-in-command-arguments.patch similarity index 100% rename from patches/api/0316-fix-empty-array-elements-in-command-arguments.patch rename to patches/api/0315-fix-empty-array-elements-in-command-arguments.patch diff --git a/patches/api/0317-Stinger-API.patch b/patches/api/0316-Stinger-API.patch similarity index 100% rename from patches/api/0317-Stinger-API.patch rename to patches/api/0316-Stinger-API.patch diff --git a/patches/api/0318-Rewrite-LogEvents-to-contain-the-source-jars-in-stac.patch b/patches/api/0317-Rewrite-LogEvents-to-contain-the-source-jars-in-stac.patch similarity index 100% rename from patches/api/0318-Rewrite-LogEvents-to-contain-the-source-jars-in-stac.patch rename to patches/api/0317-Rewrite-LogEvents-to-contain-the-source-jars-in-stac.patch diff --git a/patches/api/0319-Add-PlayerSetSpawnEvent.patch b/patches/api/0318-Add-PlayerSetSpawnEvent.patch similarity index 100% rename from patches/api/0319-Add-PlayerSetSpawnEvent.patch rename to patches/api/0318-Add-PlayerSetSpawnEvent.patch diff --git a/patches/api/0320-Added-EntityDamageItemEvent.patch b/patches/api/0319-Added-EntityDamageItemEvent.patch similarity index 100% rename from patches/api/0320-Added-EntityDamageItemEvent.patch rename to patches/api/0319-Added-EntityDamageItemEvent.patch diff --git a/patches/api/0321-Make-EntityUnleashEvent-cancellable.patch b/patches/api/0320-Make-EntityUnleashEvent-cancellable.patch similarity index 100% rename from patches/api/0321-Make-EntityUnleashEvent-cancellable.patch rename to patches/api/0320-Make-EntityUnleashEvent-cancellable.patch diff --git a/patches/api/0322-Change-EnderEye-target-without-changing-other-things.patch b/patches/api/0321-Change-EnderEye-target-without-changing-other-things.patch similarity index 100% rename from patches/api/0322-Change-EnderEye-target-without-changing-other-things.patch rename to patches/api/0321-Change-EnderEye-target-without-changing-other-things.patch diff --git a/patches/api/0323-Add-BlockBreakBlockEvent.patch b/patches/api/0322-Add-BlockBreakBlockEvent.patch similarity index 100% rename from patches/api/0323-Add-BlockBreakBlockEvent.patch rename to patches/api/0322-Add-BlockBreakBlockEvent.patch diff --git a/patches/api/0324-Add-helpers-for-left-right-click-to-Action.patch b/patches/api/0323-Add-helpers-for-left-right-click-to-Action.patch similarity index 100% rename from patches/api/0324-Add-helpers-for-left-right-click-to-Action.patch rename to patches/api/0323-Add-helpers-for-left-right-click-to-Action.patch diff --git a/patches/api/0325-Option-to-prevent-NBT-copy-in-smithing-recipes.patch b/patches/api/0324-Option-to-prevent-NBT-copy-in-smithing-recipes.patch similarity index 100% rename from patches/api/0325-Option-to-prevent-NBT-copy-in-smithing-recipes.patch rename to patches/api/0324-Option-to-prevent-NBT-copy-in-smithing-recipes.patch diff --git a/patches/api/0326-More-CommandBlock-API.patch b/patches/api/0325-More-CommandBlock-API.patch similarity index 100% rename from patches/api/0326-More-CommandBlock-API.patch rename to patches/api/0325-More-CommandBlock-API.patch diff --git a/patches/api/0327-Fix-plugin-provides-load-order.patch b/patches/api/0326-Fix-plugin-provides-load-order.patch similarity index 97% rename from patches/api/0327-Fix-plugin-provides-load-order.patch rename to patches/api/0326-Fix-plugin-provides-load-order.patch index 1ee605ad14..74b275da11 100644 --- a/patches/api/0327-Fix-plugin-provides-load-order.patch +++ b/patches/api/0326-Fix-plugin-provides-load-order.patch @@ -1,5 +1,5 @@ From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: Nassim Jahnke +From: Nassim Jahnke Date: Fri, 1 Oct 2021 09:47:00 +0200 Subject: [PATCH] Fix plugin provides load order diff --git a/patches/api/0328-Add-missing-team-sidebar-display-slots.patch b/patches/api/0327-Add-missing-team-sidebar-display-slots.patch similarity index 84% rename from patches/api/0328-Add-missing-team-sidebar-display-slots.patch rename to patches/api/0327-Add-missing-team-sidebar-display-slots.patch index 1d400fa49e..1d9b731fb4 100644 --- a/patches/api/0328-Add-missing-team-sidebar-display-slots.patch +++ b/patches/api/0327-Add-missing-team-sidebar-display-slots.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Add missing team sidebar display slots diff --git a/src/main/java/org/bukkit/scoreboard/DisplaySlot.java b/src/main/java/org/bukkit/scoreboard/DisplaySlot.java -index 5d58a18b3625fd01ea34969200edc3bc80cbb587..fe7d0a19f970ac5b4e0c4bef4ff7c4ceae60bb86 100644 +index 4959bec21d152a17fe4ca9d3f448aef482a05b5e..fe7d0a19f970ac5b4e0c4bef4ff7c4ceae60bb86 100644 --- a/src/main/java/org/bukkit/scoreboard/DisplaySlot.java +++ b/src/main/java/org/bukkit/scoreboard/DisplaySlot.java -@@ -1,10 +1,55 @@ +@@ -1,26 +1,55 @@ package org.bukkit.scoreboard; +import net.kyori.adventure.text.format.NamedTextColor; // Paper @@ -18,7 +18,23 @@ index 5d58a18b3625fd01ea34969200edc3bc80cbb587..fe7d0a19f970ac5b4e0c4bef4ff7c4ce public enum DisplaySlot { - BELOW_NAME, - PLAYER_LIST, -- SIDEBAR; +- SIDEBAR, +- SIDEBAR_BLACK, +- SIDEBAR_DARK_BLUE, +- SIDEBAR_DARK_GREEN, +- SIDEBAR_DARK_AQUA, +- SIDEBAR_DARK_RED, +- SIDEBAR_DARK_PURPLE, +- SIDEBAR_GOLD, +- SIDEBAR_GRAY, +- SIDEBAR_DARK_GRAY, +- SIDEBAR_BLUE, +- SIDEBAR_GREEN, +- SIDEBAR_AQUA, +- SIDEBAR_RED, +- SIDEBAR_LIGHT_PURPLE, +- SIDEBAR_YELLOW, +- SIDEBAR_WHITE; + // Paper start + BELOW_NAME("belowName"), + PLAYER_LIST("list"), diff --git a/patches/api/0329-add-back-EntityPortalExitEvent.patch b/patches/api/0328-add-back-EntityPortalExitEvent.patch similarity index 100% rename from patches/api/0329-add-back-EntityPortalExitEvent.patch rename to patches/api/0328-add-back-EntityPortalExitEvent.patch diff --git a/patches/api/0330-Add-methods-to-find-targets-for-lightning-strikes.patch b/patches/api/0329-Add-methods-to-find-targets-for-lightning-strikes.patch similarity index 100% rename from patches/api/0330-Add-methods-to-find-targets-for-lightning-strikes.patch rename to patches/api/0329-Add-methods-to-find-targets-for-lightning-strikes.patch diff --git a/patches/api/0331-Get-entity-default-attributes.patch b/patches/api/0330-Get-entity-default-attributes.patch similarity index 100% rename from patches/api/0331-Get-entity-default-attributes.patch rename to patches/api/0330-Get-entity-default-attributes.patch diff --git a/patches/api/0332-Left-handed-API.patch b/patches/api/0331-Left-handed-API.patch similarity index 100% rename from patches/api/0332-Left-handed-API.patch rename to patches/api/0331-Left-handed-API.patch diff --git a/patches/api/0333-Add-advancement-display-API.patch b/patches/api/0332-Add-advancement-display-API.patch similarity index 100% rename from patches/api/0333-Add-advancement-display-API.patch rename to patches/api/0332-Add-advancement-display-API.patch diff --git a/patches/api/0334-Add-ItemFactory-getMonsterEgg-API.patch b/patches/api/0333-Add-ItemFactory-getMonsterEgg-API.patch similarity index 100% rename from patches/api/0334-Add-ItemFactory-getMonsterEgg-API.patch rename to patches/api/0333-Add-ItemFactory-getMonsterEgg-API.patch diff --git a/patches/api/0335-Add-critical-damage-API.patch b/patches/api/0334-Add-critical-damage-API.patch similarity index 100% rename from patches/api/0335-Add-critical-damage-API.patch rename to patches/api/0334-Add-critical-damage-API.patch diff --git a/patches/api/0336-Fix-issues-with-mob-conversion.patch b/patches/api/0335-Fix-issues-with-mob-conversion.patch similarity index 100% rename from patches/api/0336-Fix-issues-with-mob-conversion.patch rename to patches/api/0335-Fix-issues-with-mob-conversion.patch diff --git a/patches/api/0337-Add-isCollidable-methods-to-various-places.patch b/patches/api/0336-Add-isCollidable-methods-to-various-places.patch similarity index 100% rename from patches/api/0337-Add-isCollidable-methods-to-various-places.patch rename to patches/api/0336-Add-isCollidable-methods-to-various-places.patch diff --git a/patches/api/0338-Goat-ram-API.patch b/patches/api/0337-Goat-ram-API.patch similarity index 100% rename from patches/api/0338-Goat-ram-API.patch rename to patches/api/0337-Goat-ram-API.patch diff --git a/patches/api/0339-Add-API-for-resetting-a-single-score.patch b/patches/api/0338-Add-API-for-resetting-a-single-score.patch similarity index 100% rename from patches/api/0339-Add-API-for-resetting-a-single-score.patch rename to patches/api/0338-Add-API-for-resetting-a-single-score.patch diff --git a/patches/api/0340-Add-Raw-Byte-Entity-Serialization.patch b/patches/api/0339-Add-Raw-Byte-Entity-Serialization.patch similarity index 100% rename from patches/api/0340-Add-Raw-Byte-Entity-Serialization.patch rename to patches/api/0339-Add-Raw-Byte-Entity-Serialization.patch diff --git a/patches/api/0341-Add-PlayerItemFrameChangeEvent.patch b/patches/api/0340-Add-PlayerItemFrameChangeEvent.patch similarity index 100% rename from patches/api/0341-Add-PlayerItemFrameChangeEvent.patch rename to patches/api/0340-Add-PlayerItemFrameChangeEvent.patch diff --git a/patches/api/0342-Add-player-health-update-API.patch b/patches/api/0341-Add-player-health-update-API.patch similarity index 100% rename from patches/api/0342-Add-player-health-update-API.patch rename to patches/api/0341-Add-player-health-update-API.patch diff --git a/patches/api/0343-Allow-delegation-to-vanilla-chunk-gen.patch b/patches/api/0342-Allow-delegation-to-vanilla-chunk-gen.patch similarity index 92% rename from patches/api/0343-Allow-delegation-to-vanilla-chunk-gen.patch rename to patches/api/0342-Allow-delegation-to-vanilla-chunk-gen.patch index 2c18c1b613..c526c16394 100644 --- a/patches/api/0343-Allow-delegation-to-vanilla-chunk-gen.patch +++ b/patches/api/0342-Allow-delegation-to-vanilla-chunk-gen.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Allow delegation to vanilla chunk gen diff --git a/src/main/java/org/bukkit/Bukkit.java b/src/main/java/org/bukkit/Bukkit.java -index 05186443e25706ed77f7187eea6ac84666613a88..23834c3bd3a5e008b1b05c99a7b2f491731d8459 100644 +index d8e301befb37b540bc246cf58988923b0ab23375..77e824f6071782def8865fc178e2f064f109cebb 100644 --- a/src/main/java/org/bukkit/Bukkit.java +++ b/src/main/java/org/bukkit/Bukkit.java -@@ -1892,6 +1892,24 @@ public final class Bukkit { +@@ -1905,6 +1905,24 @@ public final class Bukkit { return server.createChunkData(world); } @@ -34,10 +34,10 @@ index 05186443e25706ed77f7187eea6ac84666613a88..23834c3bd3a5e008b1b05c99a7b2f491 * Creates a boss bar instance to display to players. The progress * defaults to 1.0 diff --git a/src/main/java/org/bukkit/Server.java b/src/main/java/org/bukkit/Server.java -index 3d78e555725b48cb7e5750e8b4b3f1f0463bddc2..515e1bc18e04cd94b5aa7b00434a72381277e678 100644 +index 16f631fdde4b63e0ed3162486dba684697bdffa7..a7e1d81a8a5e14f556d6b462dfba7f2e49f06f5f 100644 --- a/src/main/java/org/bukkit/Server.java +++ b/src/main/java/org/bukkit/Server.java -@@ -1589,6 +1589,22 @@ public interface Server extends PluginMessageRecipient, net.kyori.adventure.audi +@@ -1600,6 +1600,22 @@ public interface Server extends PluginMessageRecipient, net.kyori.adventure.audi @NotNull public ChunkGenerator.ChunkData createChunkData(@NotNull World world); diff --git a/patches/api/0344-Add-more-Campfire-API.patch b/patches/api/0343-Add-more-Campfire-API.patch similarity index 100% rename from patches/api/0344-Add-more-Campfire-API.patch rename to patches/api/0343-Add-more-Campfire-API.patch diff --git a/patches/api/0345-Move-VehicleCollisionEvent-HandlerList-up.patch b/patches/api/0344-Move-VehicleCollisionEvent-HandlerList-up.patch similarity index 100% rename from patches/api/0345-Move-VehicleCollisionEvent-HandlerList-up.patch rename to patches/api/0344-Move-VehicleCollisionEvent-HandlerList-up.patch diff --git a/patches/api/0346-Improve-scoreboard-entries.patch b/patches/api/0345-Improve-scoreboard-entries.patch similarity index 93% rename from patches/api/0346-Improve-scoreboard-entries.patch rename to patches/api/0345-Improve-scoreboard-entries.patch index fb74c25fd3..0e34dd6072 100644 --- a/patches/api/0346-Improve-scoreboard-entries.patch +++ b/patches/api/0345-Improve-scoreboard-entries.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Improve scoreboard entries diff --git a/src/main/java/org/bukkit/scoreboard/Objective.java b/src/main/java/org/bukkit/scoreboard/Objective.java -index 75acd6f8f3d774bb79e8e513125e801c5569a244..b93b1b0428d11589605c8edf5c053369e1031076 100644 +index 474274fdffe4041bf4bfb146fcc66424eb5be78a..b236d19d4e4e4f9def610bae8a0c7d222fe2241b 100644 --- a/src/main/java/org/bukkit/scoreboard/Objective.java +++ b/src/main/java/org/bukkit/scoreboard/Objective.java -@@ -140,9 +140,8 @@ public interface Objective { +@@ -151,9 +151,8 @@ public interface Objective { * @throws IllegalArgumentException if player is null * @throws IllegalStateException if this objective has been unregistered * @see #getScore(String) @@ -19,7 +19,7 @@ index 75acd6f8f3d774bb79e8e513125e801c5569a244..b93b1b0428d11589605c8edf5c053369 @NotNull Score getScore(@NotNull OfflinePlayer player) throws IllegalArgumentException, IllegalStateException; -@@ -157,4 +156,16 @@ public interface Objective { +@@ -168,4 +167,16 @@ public interface Objective { */ @NotNull Score getScore(@NotNull String entry) throws IllegalArgumentException, IllegalStateException; @@ -37,10 +37,10 @@ index 75acd6f8f3d774bb79e8e513125e801c5569a244..b93b1b0428d11589605c8edf5c053369 + // Paper end } diff --git a/src/main/java/org/bukkit/scoreboard/Scoreboard.java b/src/main/java/org/bukkit/scoreboard/Scoreboard.java -index 1ada91d790abedbc9b3aeb6e96467a0d78560f15..fc3456bb79f2fe1504359455b937c162780110c2 100644 +index ef3e729caf430b08cdf2d680d5a137a1ba56c1c5..880b20bf25f74e9cb54ff3fb282a5b74db6a0a85 100644 --- a/src/main/java/org/bukkit/scoreboard/Scoreboard.java +++ b/src/main/java/org/bukkit/scoreboard/Scoreboard.java -@@ -163,9 +163,8 @@ public interface Scoreboard { +@@ -265,9 +265,8 @@ public interface Scoreboard { * @return immutable set of all scores tracked for the player * @throws IllegalArgumentException if player is null * @see #getScores(String) @@ -51,7 +51,7 @@ index 1ada91d790abedbc9b3aeb6e96467a0d78560f15..fc3456bb79f2fe1504359455b937c162 @NotNull Set getScores(@NotNull OfflinePlayer player) throws IllegalArgumentException; -@@ -185,9 +184,8 @@ public interface Scoreboard { +@@ -287,9 +286,8 @@ public interface Scoreboard { * @param player the player to drop all current scores for * @throws IllegalArgumentException if player is null * @see #resetScores(String) @@ -62,7 +62,7 @@ index 1ada91d790abedbc9b3aeb6e96467a0d78560f15..fc3456bb79f2fe1504359455b937c162 void resetScores(@NotNull OfflinePlayer player) throws IllegalArgumentException; /** -@@ -205,9 +203,8 @@ public interface Scoreboard { +@@ -307,9 +305,8 @@ public interface Scoreboard { * @return the player's Team or null if the player is not on a team * @throws IllegalArgumentException if player is null * @see #getEntryTeam(String) @@ -73,7 +73,7 @@ index 1ada91d790abedbc9b3aeb6e96467a0d78560f15..fc3456bb79f2fe1504359455b937c162 @Nullable Team getPlayerTeam(@NotNull OfflinePlayer player) throws IllegalArgumentException; -@@ -276,4 +273,35 @@ public interface Scoreboard { +@@ -378,4 +375,35 @@ public interface Scoreboard { * @throws IllegalArgumentException if slot is null */ void clearSlot(@NotNull DisplaySlot slot) throws IllegalArgumentException; diff --git a/patches/api/0347-Entity-powdered-snow-API.patch b/patches/api/0346-Entity-powdered-snow-API.patch similarity index 100% rename from patches/api/0347-Entity-powdered-snow-API.patch rename to patches/api/0346-Entity-powdered-snow-API.patch diff --git a/patches/api/0348-Add-API-for-item-entity-health.patch b/patches/api/0347-Add-API-for-item-entity-health.patch similarity index 100% rename from patches/api/0348-Add-API-for-item-entity-health.patch rename to patches/api/0347-Add-API-for-item-entity-health.patch diff --git a/patches/api/0349-Expose-isFuel-and-canSmelt-methods-to-FurnaceInvento.patch b/patches/api/0348-Expose-isFuel-and-canSmelt-methods-to-FurnaceInvento.patch similarity index 100% rename from patches/api/0349-Expose-isFuel-and-canSmelt-methods-to-FurnaceInvento.patch rename to patches/api/0348-Expose-isFuel-and-canSmelt-methods-to-FurnaceInvento.patch diff --git a/patches/api/0350-Bucketable-API.patch b/patches/api/0349-Bucketable-API.patch similarity index 100% rename from patches/api/0350-Bucketable-API.patch rename to patches/api/0349-Bucketable-API.patch diff --git a/patches/api/0351-System-prop-for-default-config-comment-parsing.patch b/patches/api/0350-System-prop-for-default-config-comment-parsing.patch similarity index 100% rename from patches/api/0351-System-prop-for-default-config-comment-parsing.patch rename to patches/api/0350-System-prop-for-default-config-comment-parsing.patch diff --git a/patches/api/0352-Expose-vanilla-BiomeProvider-from-WorldInfo.patch b/patches/api/0351-Expose-vanilla-BiomeProvider-from-WorldInfo.patch similarity index 100% rename from patches/api/0352-Expose-vanilla-BiomeProvider-from-WorldInfo.patch rename to patches/api/0351-Expose-vanilla-BiomeProvider-from-WorldInfo.patch diff --git a/patches/api/0353-Remove-upstream-snakeyaml-fix.patch b/patches/api/0352-Remove-upstream-snakeyaml-fix.patch similarity index 100% rename from patches/api/0353-Remove-upstream-snakeyaml-fix.patch rename to patches/api/0352-Remove-upstream-snakeyaml-fix.patch diff --git a/patches/api/0354-Add-new-overload-to-PersistentDataContainer-has.patch b/patches/api/0353-Add-new-overload-to-PersistentDataContainer-has.patch similarity index 100% rename from patches/api/0354-Add-new-overload-to-PersistentDataContainer-has.patch rename to patches/api/0353-Add-new-overload-to-PersistentDataContainer-has.patch diff --git a/patches/api/0355-Multiple-Entries-with-Scoreboards.patch b/patches/api/0354-Multiple-Entries-with-Scoreboards.patch similarity index 100% rename from patches/api/0355-Multiple-Entries-with-Scoreboards.patch rename to patches/api/0354-Multiple-Entries-with-Scoreboards.patch diff --git a/patches/api/0356-Added-getHostname-to-AsyncPlayerPreLoginEvent.patch b/patches/api/0355-Added-getHostname-to-AsyncPlayerPreLoginEvent.patch similarity index 100% rename from patches/api/0356-Added-getHostname-to-AsyncPlayerPreLoginEvent.patch rename to patches/api/0355-Added-getHostname-to-AsyncPlayerPreLoginEvent.patch diff --git a/patches/api/0357-Warn-on-strange-EventHandler-return-types.patch b/patches/api/0356-Warn-on-strange-EventHandler-return-types.patch similarity index 100% rename from patches/api/0357-Warn-on-strange-EventHandler-return-types.patch rename to patches/api/0356-Warn-on-strange-EventHandler-return-types.patch diff --git a/patches/api/0358-Multi-Block-Change-API.patch b/patches/api/0357-Multi-Block-Change-API.patch similarity index 100% rename from patches/api/0358-Multi-Block-Change-API.patch rename to patches/api/0357-Multi-Block-Change-API.patch diff --git a/patches/api/0359-Fix-NotePlayEvent.patch b/patches/api/0358-Fix-NotePlayEvent.patch similarity index 100% rename from patches/api/0359-Fix-NotePlayEvent.patch rename to patches/api/0358-Fix-NotePlayEvent.patch diff --git a/patches/api/0360-Freeze-Tick-Lock-API.patch b/patches/api/0359-Freeze-Tick-Lock-API.patch similarity index 100% rename from patches/api/0360-Freeze-Tick-Lock-API.patch rename to patches/api/0359-Freeze-Tick-Lock-API.patch diff --git a/patches/api/0361-Dolphin-API.patch b/patches/api/0360-Dolphin-API.patch similarity index 100% rename from patches/api/0361-Dolphin-API.patch rename to patches/api/0360-Dolphin-API.patch diff --git a/patches/api/0362-More-PotionEffectType-API.patch b/patches/api/0361-More-PotionEffectType-API.patch similarity index 100% rename from patches/api/0362-More-PotionEffectType-API.patch rename to patches/api/0361-More-PotionEffectType-API.patch diff --git a/patches/api/0363-API-for-creating-command-sender-which-forwards-feedb.patch b/patches/api/0362-API-for-creating-command-sender-which-forwards-feedb.patch similarity index 87% rename from patches/api/0363-API-for-creating-command-sender-which-forwards-feedb.patch rename to patches/api/0362-API-for-creating-command-sender-which-forwards-feedb.patch index 06e522a404..95101a7000 100644 --- a/patches/api/0363-API-for-creating-command-sender-which-forwards-feedb.patch +++ b/patches/api/0362-API-for-creating-command-sender-which-forwards-feedb.patch @@ -5,10 +5,10 @@ Subject: [PATCH] API for creating command sender which forwards feedback diff --git a/src/main/java/org/bukkit/Bukkit.java b/src/main/java/org/bukkit/Bukkit.java -index 23834c3bd3a5e008b1b05c99a7b2f491731d8459..ac7674fb1c9d7bd9572c678f57cab44233328bdc 100644 +index 77e824f6071782def8865fc178e2f064f109cebb..1b52cb7d8b894ee73be5754ed44236de01d7d0c6 100644 --- a/src/main/java/org/bukkit/Bukkit.java +++ b/src/main/java/org/bukkit/Bukkit.java -@@ -1412,6 +1412,20 @@ public final class Bukkit { +@@ -1413,6 +1413,20 @@ public final class Bukkit { return server.getConsoleSender(); } @@ -30,10 +30,10 @@ index 23834c3bd3a5e008b1b05c99a7b2f491731d8459..ac7674fb1c9d7bd9572c678f57cab442 * Gets the folder that contains all of the various {@link World}s. * diff --git a/src/main/java/org/bukkit/Server.java b/src/main/java/org/bukkit/Server.java -index 515e1bc18e04cd94b5aa7b00434a72381277e678..871d80d0e0ce7cd80e34bfeebee8c543ea023d8e 100644 +index a7e1d81a8a5e14f556d6b462dfba7f2e49f06f5f..6d056cee2fb727db9fbcc0ee98a7c800a8981ad6 100644 --- a/src/main/java/org/bukkit/Server.java +++ b/src/main/java/org/bukkit/Server.java -@@ -1178,6 +1178,18 @@ public interface Server extends PluginMessageRecipient, net.kyori.adventure.audi +@@ -1179,6 +1179,18 @@ public interface Server extends PluginMessageRecipient, net.kyori.adventure.audi @NotNull public ConsoleCommandSender getConsoleSender(); diff --git a/patches/api/0364-Implement-regenerateChunk.patch b/patches/api/0363-Implement-regenerateChunk.patch similarity index 95% rename from patches/api/0364-Implement-regenerateChunk.patch rename to patches/api/0363-Implement-regenerateChunk.patch index e779ef9bc1..775ee50076 100644 --- a/patches/api/0364-Implement-regenerateChunk.patch +++ b/patches/api/0363-Implement-regenerateChunk.patch @@ -1,5 +1,5 @@ From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: Nassim Jahnke +From: Nassim Jahnke Date: Sat, 5 Feb 2022 20:25:28 +0100 Subject: [PATCH] Implement regenerateChunk diff --git a/patches/api/0365-Don-t-load-plugins-prefixed-with-a-dot.patch b/patches/api/0364-Don-t-load-plugins-prefixed-with-a-dot.patch similarity index 100% rename from patches/api/0365-Don-t-load-plugins-prefixed-with-a-dot.patch rename to patches/api/0364-Don-t-load-plugins-prefixed-with-a-dot.patch diff --git a/patches/api/0366-Add-GameEvent-tags.patch b/patches/api/0365-Add-GameEvent-tags.patch similarity index 100% rename from patches/api/0366-Add-GameEvent-tags.patch rename to patches/api/0365-Add-GameEvent-tags.patch diff --git a/patches/api/0367-Furnace-RecipesUsed-API.patch b/patches/api/0366-Furnace-RecipesUsed-API.patch similarity index 100% rename from patches/api/0367-Furnace-RecipesUsed-API.patch rename to patches/api/0366-Furnace-RecipesUsed-API.patch diff --git a/patches/api/0368-Configurable-sculk-sensor-listener-range.patch b/patches/api/0367-Configurable-sculk-sensor-listener-range.patch similarity index 100% rename from patches/api/0368-Configurable-sculk-sensor-listener-range.patch rename to patches/api/0367-Configurable-sculk-sensor-listener-range.patch diff --git a/patches/api/0369-Add-missing-block-data-mins-and-maxes.patch b/patches/api/0368-Add-missing-block-data-mins-and-maxes.patch similarity index 100% rename from patches/api/0369-Add-missing-block-data-mins-and-maxes.patch rename to patches/api/0368-Add-missing-block-data-mins-and-maxes.patch diff --git a/patches/api/0370-Custom-Potion-Mixes.patch b/patches/api/0369-Custom-Potion-Mixes.patch similarity index 94% rename from patches/api/0370-Custom-Potion-Mixes.patch rename to patches/api/0369-Custom-Potion-Mixes.patch index 5d6edd5a1d..260c044149 100644 --- a/patches/api/0370-Custom-Potion-Mixes.patch +++ b/patches/api/0369-Custom-Potion-Mixes.patch @@ -102,10 +102,10 @@ index 0000000000000000000000000000000000000000..cb6d93526b637946aec311bef103ad30 + } +} diff --git a/src/main/java/org/bukkit/Bukkit.java b/src/main/java/org/bukkit/Bukkit.java -index ac7674fb1c9d7bd9572c678f57cab44233328bdc..92a1462261029e804da73da2743bbd68e57841e9 100644 +index 1b52cb7d8b894ee73be5754ed44236de01d7d0c6..840aaf9e8fc828b5a7ea02252038c6524680f2e0 100644 --- a/src/main/java/org/bukkit/Bukkit.java +++ b/src/main/java/org/bukkit/Bukkit.java -@@ -2414,6 +2414,15 @@ public final class Bukkit { +@@ -2427,6 +2427,15 @@ public final class Bukkit { public static io.papermc.paper.datapack.DatapackManager getDatapackManager() { return server.getDatapackManager(); } @@ -122,10 +122,10 @@ index ac7674fb1c9d7bd9572c678f57cab44233328bdc..92a1462261029e804da73da2743bbd68 @NotNull diff --git a/src/main/java/org/bukkit/Server.java b/src/main/java/org/bukkit/Server.java -index 871d80d0e0ce7cd80e34bfeebee8c543ea023d8e..56e261efa654e4a6872ccea28f0461df13845d13 100644 +index 6d056cee2fb727db9fbcc0ee98a7c800a8981ad6..da5cab4246bd253fcc4e4d9574bdae1867ebb5ab 100644 --- a/src/main/java/org/bukkit/Server.java +++ b/src/main/java/org/bukkit/Server.java -@@ -2097,5 +2097,12 @@ public interface Server extends PluginMessageRecipient, net.kyori.adventure.audi +@@ -2108,5 +2108,12 @@ public interface Server extends PluginMessageRecipient, net.kyori.adventure.audi */ @NotNull io.papermc.paper.datapack.DatapackManager getDatapackManager(); diff --git a/patches/api/0371-Expose-furnace-minecart-push-values.patch b/patches/api/0370-Expose-furnace-minecart-push-values.patch similarity index 100% rename from patches/api/0371-Expose-furnace-minecart-push-values.patch rename to patches/api/0370-Expose-furnace-minecart-push-values.patch diff --git a/patches/api/0372-More-Projectile-API.patch b/patches/api/0371-More-Projectile-API.patch similarity index 92% rename from patches/api/0372-More-Projectile-API.patch rename to patches/api/0371-More-Projectile-API.patch index c9374b52dc..6a949d5721 100644 --- a/patches/api/0372-More-Projectile-API.patch +++ b/patches/api/0371-More-Projectile-API.patch @@ -3,6 +3,7 @@ From: Owen1212055 <23108066+Owen1212055@users.noreply.github.com> Date: Wed, 26 May 2021 19:34:43 -0400 Subject: [PATCH] More Projectile API +Co-authored-by: Nassim Jahnke diff --git a/src/main/java/org/bukkit/entity/Firework.java b/src/main/java/org/bukkit/entity/Firework.java index d616d5941b3c7b85e350e845901da798601b9a3c..b7a6e3b1ac327c4e03f9d73952c1ce4d54967cf4 100644 @@ -96,10 +97,10 @@ index d1b37530319f6d37ee37f62080289c1e45848bc8..e94c7e279356c510f60508b26277d489 + // Paper end } diff --git a/src/main/java/org/bukkit/entity/ThrownPotion.java b/src/main/java/org/bukkit/entity/ThrownPotion.java -index 10a3c297bd87ad3ab4555054858f47a479e76e1a..1afda5d6d948b7e8589e69d3cd2c045763b5e784 100644 +index 7051e07b4e456aae0ec9e37808b59e5fa62a4027..225ac312613b9e8f3cf680819f2ebe350d1bf48a 100644 --- a/src/main/java/org/bukkit/entity/ThrownPotion.java +++ b/src/main/java/org/bukkit/entity/ThrownPotion.java -@@ -32,12 +32,29 @@ public interface ThrownPotion extends Projectile { +@@ -32,12 +32,34 @@ public interface ThrownPotion extends ThrowableProjectile { /** * Set the ItemStack for this thrown potion. @@ -131,5 +132,10 @@ index 10a3c297bd87ad3ab4555054858f47a479e76e1a..1afda5d6d948b7e8589e69d3cd2c0457 + * @param meta potion meta + */ + void setPotionMeta(@NotNull org.bukkit.inventory.meta.PotionMeta meta); ++ ++ /** ++ * Splashes the potion at its current location. ++ */ ++ void splash(); + // Paper end } diff --git a/patches/api/0373-Add-getComputedBiome-API.patch b/patches/api/0372-Add-getComputedBiome-API.patch similarity index 100% rename from patches/api/0373-Add-getComputedBiome-API.patch rename to patches/api/0372-Add-getComputedBiome-API.patch diff --git a/patches/api/0374-Add-enchantWithLevels-API.patch b/patches/api/0373-Add-enchantWithLevels-API.patch similarity index 100% rename from patches/api/0374-Add-enchantWithLevels-API.patch rename to patches/api/0373-Add-enchantWithLevels-API.patch diff --git a/patches/api/0375-Add-TameableDeathMessageEvent.patch b/patches/api/0374-Add-TameableDeathMessageEvent.patch similarity index 100% rename from patches/api/0375-Add-TameableDeathMessageEvent.patch rename to patches/api/0374-Add-TameableDeathMessageEvent.patch diff --git a/patches/api/0376-Allow-to-change-the-podium-of-the-EnderDragon.patch b/patches/api/0375-Allow-to-change-the-podium-of-the-EnderDragon.patch similarity index 100% rename from patches/api/0376-Allow-to-change-the-podium-of-the-EnderDragon.patch rename to patches/api/0375-Allow-to-change-the-podium-of-the-EnderDragon.patch diff --git a/patches/api/0377-Add-pre-unbreaking-amount-to-PlayerItemDamageEvent.patch b/patches/api/0376-Add-pre-unbreaking-amount-to-PlayerItemDamageEvent.patch similarity index 100% rename from patches/api/0377-Add-pre-unbreaking-amount-to-PlayerItemDamageEvent.patch rename to patches/api/0376-Add-pre-unbreaking-amount-to-PlayerItemDamageEvent.patch diff --git a/patches/api/0378-Update-Folder-Uses-Plugin-Name.patch b/patches/api/0377-Update-Folder-Uses-Plugin-Name.patch similarity index 100% rename from patches/api/0378-Update-Folder-Uses-Plugin-Name.patch rename to patches/api/0377-Update-Folder-Uses-Plugin-Name.patch diff --git a/patches/api/0379-WorldCreator-keepSpawnLoaded.patch b/patches/api/0378-WorldCreator-keepSpawnLoaded.patch similarity index 100% rename from patches/api/0379-WorldCreator-keepSpawnLoaded.patch rename to patches/api/0378-WorldCreator-keepSpawnLoaded.patch diff --git a/patches/api/0380-Add-EntityDyeEvent-and-CollarColorable-interface.patch b/patches/api/0379-Add-EntityDyeEvent-and-CollarColorable-interface.patch similarity index 100% rename from patches/api/0380-Add-EntityDyeEvent-and-CollarColorable-interface.patch rename to patches/api/0379-Add-EntityDyeEvent-and-CollarColorable-interface.patch diff --git a/patches/api/0381-Add-PlayerStopUsingItemEvent.patch b/patches/api/0380-Add-PlayerStopUsingItemEvent.patch similarity index 100% rename from patches/api/0381-Add-PlayerStopUsingItemEvent.patch rename to patches/api/0380-Add-PlayerStopUsingItemEvent.patch diff --git a/patches/api/0382-FallingBlock-auto-expire-setting.patch b/patches/api/0381-FallingBlock-auto-expire-setting.patch similarity index 100% rename from patches/api/0382-FallingBlock-auto-expire-setting.patch rename to patches/api/0381-FallingBlock-auto-expire-setting.patch diff --git a/patches/api/0383-Keyed-Cat-Type.patch b/patches/api/0382-Keyed-Cat-Type.patch similarity index 100% rename from patches/api/0383-Keyed-Cat-Type.patch rename to patches/api/0382-Keyed-Cat-Type.patch diff --git a/patches/api/0384-Add-WardenAngerChangeEvent.patch b/patches/api/0383-Add-WardenAngerChangeEvent.patch similarity index 100% rename from patches/api/0384-Add-WardenAngerChangeEvent.patch rename to patches/api/0383-Add-WardenAngerChangeEvent.patch diff --git a/patches/api/0385-Nameable-Banner-API.patch b/patches/api/0384-Nameable-Banner-API.patch similarity index 100% rename from patches/api/0385-Nameable-Banner-API.patch rename to patches/api/0384-Nameable-Banner-API.patch diff --git a/patches/api/0386-Add-Player-getFishHook.patch b/patches/api/0385-Add-Player-getFishHook.patch similarity index 100% rename from patches/api/0386-Add-Player-getFishHook.patch rename to patches/api/0385-Add-Player-getFishHook.patch diff --git a/patches/api/0387-More-Teleport-API.patch b/patches/api/0386-More-Teleport-API.patch similarity index 100% rename from patches/api/0387-More-Teleport-API.patch rename to patches/api/0386-More-Teleport-API.patch diff --git a/patches/api/0388-Add-EntityPortalReadyEvent.patch b/patches/api/0387-Add-EntityPortalReadyEvent.patch similarity index 100% rename from patches/api/0388-Add-EntityPortalReadyEvent.patch rename to patches/api/0387-Add-EntityPortalReadyEvent.patch diff --git a/patches/api/0388-Custom-Chat-Completion-Suggestions-API.patch b/patches/api/0388-Custom-Chat-Completion-Suggestions-API.patch new file mode 100644 index 0000000000..62cde4be44 --- /dev/null +++ b/patches/api/0388-Custom-Chat-Completion-Suggestions-API.patch @@ -0,0 +1,36 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Owen1212055 <23108066+Owen1212055@users.noreply.github.com> +Date: Sat, 30 Jul 2022 11:23:11 -0400 +Subject: [PATCH] Custom Chat Completion Suggestions API + + +diff --git a/src/main/java/org/bukkit/entity/Player.java b/src/main/java/org/bukkit/entity/Player.java +index 3fcfe8651a9c422fa9c8ff77556477f1461424cf..b607c229cfb1e95b17b6a0073380089ef5e1b675 100644 +--- a/src/main/java/org/bukkit/entity/Player.java ++++ b/src/main/java/org/bukkit/entity/Player.java +@@ -2570,6 +2570,25 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM + * @throws IllegalArgumentException If the level is negative or greater than {@code 4} (i.e. not within {@code [0, 4]}). + */ + void sendOpLevel(byte level); ++ ++ /** ++ * Adds custom chat completion suggestions that the client will ++ * suggest when typing in chat. ++ * ++ * @param completions custom completions ++ */ ++ void addAdditionalChatCompletions(@NotNull java.util.Collection completions); ++ ++ /** ++ * Removes custom chat completion suggestions that the client ++ * suggests when typing in chat. ++ * ++ * Note: this only applies to previously added custom completions, ++ * online player names are always suggested and cannot be removed. ++ * ++ * @param completions custom completions ++ */ ++ void removeAdditionalChatCompletions(@NotNull java.util.Collection completions); + // Paper end + + // Spigot start diff --git a/patches/api/0389-Collision-API.patch b/patches/api/0389-Collision-API.patch new file mode 100644 index 0000000000..8ab9ca750f --- /dev/null +++ b/patches/api/0389-Collision-API.patch @@ -0,0 +1,57 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Owen1212055 <23108066+Owen1212055@users.noreply.github.com> +Date: Wed, 6 Oct 2021 20:10:36 -0400 +Subject: [PATCH] Collision API + + +diff --git a/src/main/java/org/bukkit/RegionAccessor.java b/src/main/java/org/bukkit/RegionAccessor.java +index 3f7e860de4e28745fcdf8d2f41f4a8c210f48909..39fa4c65e0f61450901662ff5c08d54a5d9841b2 100644 +--- a/src/main/java/org/bukkit/RegionAccessor.java ++++ b/src/main/java/org/bukkit/RegionAccessor.java +@@ -424,5 +424,15 @@ public interface RegionAccessor extends Keyed { // Paper + * @return whether a line of sight exists between {@code from} and {@code to} + */ + public boolean lineOfSightExists(@NotNull Location from, @NotNull Location to); ++ ++ /** ++ * Checks if the world collides with the given boundingbox. ++ * This will check for any colliding hard entities (boats, shulkers) / worldborder / blocks. ++ * Does not load chunks that are within the bounding box. ++ * ++ * @param boundingBox the box to check collisions in ++ * @return collides or not ++ */ ++ boolean hasCollisionsIn(@NotNull org.bukkit.util.BoundingBox boundingBox); + // Paper end + } +diff --git a/src/main/java/org/bukkit/entity/Entity.java b/src/main/java/org/bukkit/entity/Entity.java +index 03b35d3ba8ba00c0fa0272450f19355244a014ea..4d4a0d15876cc48c9c0456b9f11a5dda37fd56ce 100644 +--- a/src/main/java/org/bukkit/entity/Entity.java ++++ b/src/main/java/org/bukkit/entity/Entity.java +@@ -897,4 +897,26 @@ public interface Entity extends Metadatable, CommandSender, Nameable, Persistent + */ + boolean isInPowderedSnow(); + // Paper end ++ ++ // Paper Start - Collision API ++ /** ++ * Checks for any collisions with the entity's bounding box at the provided location. ++ * This will check for any colliding entities (boats, shulkers) / worldborder / blocks. ++ * Does not load chunks that are within the bounding box at the specified location. ++ * ++ * @param location the location to check collisions in ++ * @return collides or not ++ */ ++ boolean collidesAt(@NotNull Location location); ++ ++ /** ++ * This checks using the given boundingbox as the entity's boundingbox if the entity would collide with anything. ++ * This will check for any colliding entities (boats, shulkers) / worldborder / blocks. ++ * Does not load chunks that are within the bounding box. ++ * ++ * @param boundingBox the box to check collisions in ++ * @return collides or not ++ */ ++ boolean wouldCollideUsing(@NotNull BoundingBox boundingBox); ++ // Paper End - Collision API + } diff --git a/patches/api/0390-Block-Ticking-API.patch b/patches/api/0390-Block-Ticking-API.patch new file mode 100644 index 0000000000..7c077405ca --- /dev/null +++ b/patches/api/0390-Block-Ticking-API.patch @@ -0,0 +1,51 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Owen1212055 <23108066+Owen1212055@users.noreply.github.com> +Date: Sun, 26 Dec 2021 13:23:52 -0500 +Subject: [PATCH] Block Ticking API + + +diff --git a/src/main/java/org/bukkit/block/Block.java b/src/main/java/org/bukkit/block/Block.java +index e405c279f6135c94c775a856ab88fd3cace6bd5c..9930ebe7a23d306c602840fd43652fbdaba481b3 100644 +--- a/src/main/java/org/bukkit/block/Block.java ++++ b/src/main/java/org/bukkit/block/Block.java +@@ -562,6 +562,21 @@ public interface Block extends Metadatable, net.kyori.adventure.translation.Tran + * @return true if the block was destroyed + */ + boolean breakNaturally(@NotNull ItemStack tool, boolean triggerEffect); ++ ++ /** ++ * Causes the block to be ticked, this is different from {@link Block#randomTick()}, ++ * in that it is usually scheduled to occur, for example ++ * redstone components being activated, sand falling, etc. ++ */ ++ void tick(); ++ ++ /** ++ * Causes the block to be ticked randomly. ++ * This has a chance to execute naturally if {@link BlockData#isRandomlyTicked()} is true. ++ *

++ * For certain blocks, this behavior may be the same as {@link Block#tick()}. ++ */ ++ void randomTick(); + // Paper end + + /** +diff --git a/src/main/java/org/bukkit/block/data/BlockData.java b/src/main/java/org/bukkit/block/data/BlockData.java +index 62273e32e87b0dbc568747a67156366d4d4972bd..bd987bd0a29618dfe07de50b194fd6fa694628ec 100644 +--- a/src/main/java/org/bukkit/block/data/BlockData.java ++++ b/src/main/java/org/bukkit/block/data/BlockData.java +@@ -151,4 +151,14 @@ public interface BlockData extends Cloneable { + * @return true if the face is sturdy and can support a block, false otherwise + */ + boolean isFaceSturdy(@NotNull BlockFace face, @NotNull BlockSupport support); ++ ++ // Paper start - Tick API ++ /** ++ * Gets if this block is ticked randomly in the world. ++ * The blocks current state may change this value. ++ * ++ * @return is ticked randomly ++ */ ++ boolean isRandomlyTicked(); ++ // Paper end + } diff --git a/patches/api/0391-Add-NamespacedKey-biome-methods.patch b/patches/api/0391-Add-NamespacedKey-biome-methods.patch new file mode 100644 index 0000000000..fc1f5c4d7e --- /dev/null +++ b/patches/api/0391-Add-NamespacedKey-biome-methods.patch @@ -0,0 +1,44 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Josh Roy <10731363+JRoy@users.noreply.github.com> +Date: Sun, 14 Aug 2022 12:22:54 -0400 +Subject: [PATCH] Add NamespacedKey biome methods + +Co-authored-by: Thonk <30448663+ExcessiveAmountsOfZombies@users.noreply.github.com> + +diff --git a/src/main/java/org/bukkit/UnsafeValues.java b/src/main/java/org/bukkit/UnsafeValues.java +index 4fcafddf3792b66c618f91e04d102f374de565a8..88acc4d2bd56748630840dc9f1c2cb253711eb38 100644 +--- a/src/main/java/org/bukkit/UnsafeValues.java ++++ b/src/main/java/org/bukkit/UnsafeValues.java +@@ -242,5 +242,32 @@ public interface UnsafeValues { + * @throws IllegalArgumentException if {@link Material#isBlock()} is false + */ + boolean isCollidable(@org.jetbrains.annotations.NotNull Material material); ++ ++ /** ++ * Gets the {@link NamespacedKey} for the biome at the given location. ++ * ++ * @param accessor The {@link RegionAccessor} of the provided coordinates ++ * @param x X-coordinate of the block ++ * @param y Y-coordinate of the block ++ * @param z Z-coordinate of the block ++ * @return the biome's {@link NamespacedKey} ++ */ ++ @org.jetbrains.annotations.NotNull ++ NamespacedKey getBiomeKey(RegionAccessor accessor, int x, int y, int z); ++ ++ /** ++ * Sets the biome at the given location to a biome registered ++ * to the given {@link NamespacedKey}. If no biome by the given ++ * {@link NamespacedKey} exists, an {@link IllegalStateException} ++ * will be thrown. ++ * ++ * @param accessor The {@link RegionAccessor} of the provided coordinates ++ * @param x X-coordinate of the block ++ * @param y Y-coordinate of the block ++ * @param z Z-coordinate of the block ++ * @param biomeKey Biome key ++ * @throws IllegalStateException if no biome by the given key is registered. ++ */ ++ void setBiomeKey(RegionAccessor accessor, int x, int y, int z, NamespacedKey biomeKey); + // Paper end + } diff --git a/patches/removed/1.19.1/0906-Untrash-chat-handling.patch b/patches/removed/1.19.1/0906-Untrash-chat-handling.patch index c10fea24a7..069ec19760 100644 --- a/patches/removed/1.19.1/0906-Untrash-chat-handling.patch +++ b/patches/removed/1.19.1/0906-Untrash-chat-handling.patch @@ -1,5 +1,5 @@ From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: Nassim Jahnke +From: Nassim Jahnke Date: Wed, 8 Jun 2022 21:30:34 +0200 Subject: [PATCH] Untrash chat handling diff --git a/patches/server/0001-Setup-Gradle-project.patch b/patches/server/0001-Setup-Gradle-project.patch index c4dd2d89f4..0f0e187098 100644 --- a/patches/server/0001-Setup-Gradle-project.patch +++ b/patches/server/0001-Setup-Gradle-project.patch @@ -172,7 +172,7 @@ index 0000000000000000000000000000000000000000..d10ff4a52c22033e2adb2a4e7f2cee98 +} diff --git a/pom.xml b/pom.xml deleted file mode 100644 -index a0701510d9e24d734a3e321bd20afbed80e3909b..0000000000000000000000000000000000000000 +index 82a2b163a8b660d0f65dd9eca6651c520b571cd2..0000000000000000000000000000000000000000 --- a/pom.xml +++ /dev/null @@ -1,623 +0,0 @@ @@ -182,7 +182,7 @@ index a0701510d9e24d734a3e321bd20afbed80e3909b..00000000000000000000000000000000 - org.spigotmc - spigot - jar -- 1.19.1-R0.1-SNAPSHOT +- 1.19.2-R0.1-SNAPSHOT - Spigot - https://www.spigotmc.org/ - diff --git a/patches/server/0004-Paper-config-files.patch b/patches/server/0004-Paper-config-files.patch index fb472372b4..cb055ed1c0 100644 --- a/patches/server/0004-Paper-config-files.patch +++ b/patches/server/0004-Paper-config-files.patch @@ -898,10 +898,10 @@ index 0000000000000000000000000000000000000000..69add4a7f1147015806bc9b63a8340d1 +} diff --git a/src/main/java/io/papermc/paper/configuration/PaperConfigurations.java b/src/main/java/io/papermc/paper/configuration/PaperConfigurations.java new file mode 100644 -index 0000000000000000000000000000000000000000..e446542ff64670e368c8515d1716af5407f98c7a +index 0000000000000000000000000000000000000000..b2e961bbd33c6ecb7f049365b7aff6c5caa262ff --- /dev/null +++ b/src/main/java/io/papermc/paper/configuration/PaperConfigurations.java -@@ -0,0 +1,414 @@ +@@ -0,0 +1,431 @@ +package io.papermc.paper.configuration; + +import com.google.common.base.Suppliers; @@ -1023,6 +1023,14 @@ index 0000000000000000000000000000000000000000..e446542ff64670e368c8515d1716af54 + map.require(WORLD_KEY) + ); + ++ private static final String MOVED_NOTICE = """ ++ The global and world default configuration files have moved to %s ++ and the world-specific configuration file has been moved inside ++ the respective world folder. ++ ++ See https://docs.papermc.io/paper/configuration for more information. ++ """; ++ + private static final Supplier SPIGOT_WORLD_DEFAULTS = Suppliers.memoize(() -> new SpigotWorldConfig(RandomStringUtils.randomAlphabetic(255)) { + @Override // override to ensure "verbose" is false + public void init() { @@ -1200,6 +1208,12 @@ index 0000000000000000000000000000000000000000..e446542ff64670e368c8515d1716af54 + } + + public static PaperConfigurations setup(final Path legacyConfig, final Path configDir, final Path worldFolder, final File spigotConfig) throws Exception { ++ final Path legacy = Files.isSymbolicLink(legacyConfig) ? Files.readSymbolicLink(legacyConfig) : legacyConfig; ++ final Path replacementFile = legacy.resolveSibling(legacyConfig.getFileName() + "-README.txt"); ++ if (Files.notExists(replacementFile)) { ++ Files.createFile(replacementFile); ++ Files.writeString(replacementFile, String.format(MOVED_NOTICE, configDir.toAbsolutePath())); ++ } + if (needsConverting(legacyConfig)) { + try { + if (Files.exists(configDir) && !Files.isDirectory(configDir)) { @@ -1215,7 +1229,10 @@ index 0000000000000000000000000000000000000000..e446542ff64670e368c8515d1716af54 + if (Files.exists(legacyConfigBackup) && !Files.isRegularFile(legacyConfigBackup)) { + throw new RuntimeException("Paper needs to create a '" + backupFileName + "' file in the '" + BACKUP_DIR + "' folder. You already have a non-file named '" + backupFileName + "'. Please remove it and restart the server."); + } -+ Files.move(legacyConfig, legacyConfigBackup, StandardCopyOption.REPLACE_EXISTING); // make backup ++ Files.move(legacyConfig.toRealPath(), legacyConfigBackup, StandardCopyOption.REPLACE_EXISTING); // make backup ++ if (Files.isSymbolicLink(legacyConfig)) { ++ Files.delete(legacyConfig); ++ } + convert(legacyConfigBackup, configDir, worldFolder, spigotConfig); + } catch (final IOException ex) { + throw new RuntimeException("Could not convert '" + legacyConfig.getFileName().toString() + "' to the new configuration format", ex); @@ -1309,7 +1326,7 @@ index 0000000000000000000000000000000000000000..e446542ff64670e368c8515d1716af54 + return BasicConfigurationNode.root(options); + } + -+ // Sym links are not correctly checked in createDirectories ++ // Symlinks are not correctly checked in createDirectories + static void createDirectoriesSymlinkAware(Path path) throws IOException { + if (!Files.isDirectory(path)) { + Files.createDirectories(path); @@ -4176,7 +4193,7 @@ index 853e7c2019f5147e9681e95a82eaef0825b6341e..a48a12a31a3d09a9373b688dcc093035 String s = (String) Optional.ofNullable((String) optionset.valueOf("world")).orElse(dedicatedserversettings.getProperties().levelName); LevelStorageSource convertable = LevelStorageSource.createDefault(file.toPath()); diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index e7b1456a123208241d0b1c5956a137d6a5cfbfcd..7740e69617c3d543a67ed0942ba8ec550ad4386d 100644 +index 15ecb1769a0604eed348b0cd31b86ce2010cbda0..8d65c989aef5ec92873a504f5b331dfe7d8b4bff 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java @@ -281,6 +281,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop foundFrame = StackWalker.getInstance(StackWalker.Option.RETAIN_CLASS_REFERENCE) ++ .walk(stream -> stream ++ .filter(frame -> frame.getDeclaringClass().getClassLoader() instanceof PluginClassLoader) ++ .map((frame) -> { ++ PluginClassLoader classLoader = (PluginClassLoader) frame.getDeclaringClass().getClassLoader(); ++ return classLoader.getPlugin(); ++ }) ++ .findFirst()); ++ ++ return foundFrame.orElse(null); ++ } ++} diff --git a/src/main/java/io/papermc/paper/util/WorldUtil.java b/src/main/java/io/papermc/paper/util/WorldUtil.java new file mode 100644 index 0000000000000000000000000000000000000000..67bb91fcfb532a919954cd9d7733d09a6c3fec35 diff --git a/patches/server/0008-Adventure.patch b/patches/server/0008-Adventure.patch index f3571fcee4..92350d9dc2 100644 --- a/patches/server/0008-Adventure.patch +++ b/patches/server/0008-Adventure.patch @@ -98,30 +98,187 @@ index 0000000000000000000000000000000000000000..07cd02c6f9df00844b808218be2afd79 + } + } +} -diff --git a/src/main/java/io/papermc/paper/adventure/ChatProcessor.java b/src/main/java/io/papermc/paper/adventure/ChatProcessor.java +diff --git a/src/main/java/io/papermc/paper/adventure/ChatDecorationProcessor.java b/src/main/java/io/papermc/paper/adventure/ChatDecorationProcessor.java new file mode 100644 -index 0000000000000000000000000000000000000000..3526bc0b6ad590776124966ea907fe2467cbbf5f +index 0000000000000000000000000000000000000000..87e791801b624859477025df49824637eb347dec --- /dev/null -+++ b/src/main/java/io/papermc/paper/adventure/ChatProcessor.java -@@ -0,0 +1,193 @@ ++++ b/src/main/java/io/papermc/paper/adventure/ChatDecorationProcessor.java +@@ -0,0 +1,141 @@ +package io.papermc.paper.adventure; + ++import io.papermc.paper.event.player.AsyncChatCommandDecorateEvent; ++import io.papermc.paper.event.player.AsyncChatDecorateEvent; ++import java.util.ArrayList; ++import java.util.List; ++import java.util.concurrent.CompletableFuture; ++import java.util.regex.Pattern; ++import net.kyori.adventure.text.Component; ++import net.kyori.adventure.text.minimessage.MiniMessage; ++import net.kyori.adventure.text.minimessage.tag.resolver.Placeholder; ++import net.kyori.adventure.text.minimessage.tag.resolver.TagResolver; ++import net.minecraft.Util; ++import net.minecraft.commands.CommandSourceStack; ++import net.minecraft.network.chat.ChatDecorator; ++import net.minecraft.server.MinecraftServer; ++import net.minecraft.server.level.ServerPlayer; ++import org.bukkit.craftbukkit.entity.CraftPlayer; ++import org.bukkit.craftbukkit.util.LazyPlayerSet; ++import org.bukkit.event.Event; ++import org.bukkit.event.player.AsyncPlayerChatPreviewEvent; ++import org.checkerframework.checker.nullness.qual.NonNull; ++import org.checkerframework.checker.nullness.qual.Nullable; ++import org.checkerframework.framework.qual.DefaultQualifier; ++ ++import static io.papermc.paper.adventure.ChatProcessor.DEFAULT_LEGACY_FORMAT; ++import static io.papermc.paper.adventure.ChatProcessor.canYouHearMe; ++import static io.papermc.paper.adventure.ChatProcessor.displayName; ++import static net.kyori.adventure.text.serializer.legacy.LegacyComponentSerializer.legacySection; ++ ++@DefaultQualifier(NonNull.class) ++public final class ChatDecorationProcessor { ++ ++ private static final String DISPLAY_NAME_TAG = "---paper_dn---"; ++ private static final Pattern DISPLAY_NAME_PATTERN = Pattern.compile("%(1\\$)?s"); ++ private static final String CONTENT_TAG = "---paper_content---"; ++ private static final Pattern CONTENT_PATTERN = Pattern.compile("%(2\\$)?s"); ++ ++ final MinecraftServer server; ++ final @Nullable ServerPlayer player; ++ final @Nullable CommandSourceStack commandSourceStack; ++ final Component originalMessage; ++ final boolean isPreview; ++ ++ public ChatDecorationProcessor(final MinecraftServer server, final @Nullable ServerPlayer player, final @Nullable CommandSourceStack commandSourceStack, final net.minecraft.network.chat.Component originalMessage, final boolean isPreview) { ++ this.server = server; ++ this.player = player; ++ this.commandSourceStack = commandSourceStack; ++ this.originalMessage = PaperAdventure.asAdventure(originalMessage); ++ this.isPreview = isPreview; ++ } ++ ++ public CompletableFuture process() { ++ return CompletableFuture.supplyAsync(() -> { ++ ChatDecorator.Result result = new ChatDecorator.ModernResult(this.originalMessage, true, false); ++ if (canYouHearMe(AsyncPlayerChatPreviewEvent.getHandlerList())) { ++ result = this.processLegacy(result); ++ } ++ return this.processModern(result); ++ }, this.server.chatExecutor); ++ } ++ ++ private ChatDecorator.Result processLegacy(final ChatDecorator.Result input) { ++ if (this.player != null) { ++ final CraftPlayer player = this.player.getBukkitEntity(); ++ final String originalMessage = legacySection().serialize(this.originalMessage); ++ final AsyncPlayerChatPreviewEvent event = new AsyncPlayerChatPreviewEvent(true, player, originalMessage, new LazyPlayerSet(this.server)); ++ this.post(event); ++ ++ final boolean isDefaultFormat = DEFAULT_LEGACY_FORMAT.equals(event.getFormat()); ++ if (event.isCancelled() || (isDefaultFormat && originalMessage.equals(event.getMessage()))) { ++ return input; ++ } else { ++ final Component message = legacySection().deserialize(event.getMessage()); ++ final Component component = isDefaultFormat ? message : legacyFormat(event.getFormat(), ((CraftPlayer) event.getPlayer()), legacySection().deserialize(event.getMessage())); ++ return legacy(component, event.getFormat(), new ChatDecorator.MessagePair(message, event.getMessage()), isDefaultFormat); ++ } ++ } ++ return input; ++ } ++ ++ private ChatDecorator.Result processModern(final ChatDecorator.Result input) { ++ final @Nullable CraftPlayer player = Util.mapNullable(this.player, ServerPlayer::getBukkitEntity); ++ ++ final Component initialResult = input.message().component(); ++ final AsyncChatDecorateEvent event; ++ if (this.commandSourceStack != null) { ++ // TODO more command decorate context ++ event = new AsyncChatCommandDecorateEvent(true, player, this.originalMessage, this.isPreview, initialResult); ++ } else { ++ event = new AsyncChatDecorateEvent(true, player, this.originalMessage, this.isPreview, initialResult); ++ } ++ this.post(event); ++ if (!event.isCancelled() && !event.result().equals(initialResult)) { ++ if (input instanceof ChatDecorator.LegacyResult legacyResult) { ++ if (legacyResult.hasNoFormatting()) { ++ /* ++ The MessagePair in the decoration result may be different at this point. This is because the legacy ++ decoration system requires the same modifications be made to the message, so we can't have the initial ++ message value for the legacy chat events be changed by the modern decorate event. ++ */ ++ return noFormatting(event.result(), legacyResult.format(), legacyResult.message().legacyMessage()); ++ } else { ++ final Component formatted = legacyFormat(legacyResult.format(), player, event.result()); ++ return withFormatting(formatted, legacyResult.format(), event.result(), legacyResult.message().legacyMessage()); ++ } ++ } else { ++ return new ChatDecorator.ModernResult(event.result(), true, false); ++ } ++ } ++ return input; ++ } ++ ++ private void post(final Event event) { ++ this.server.server.getPluginManager().callEvent(event); ++ } ++ ++ private static Component legacyFormat(final String format, final @Nullable CraftPlayer player, final Component message) { ++ final List args = new ArrayList<>(player != null ? 2 : 1); ++ if (player != null) { ++ args.add(Placeholder.component(DISPLAY_NAME_TAG, displayName(player))); ++ } ++ args.add(Placeholder.component(CONTENT_TAG, message)); ++ String miniMsg = MiniMessage.miniMessage().serialize(legacySection().deserialize(format)); ++ miniMsg = DISPLAY_NAME_PATTERN.matcher(miniMsg).replaceFirst("<" + DISPLAY_NAME_TAG + ">"); ++ miniMsg = CONTENT_PATTERN.matcher(miniMsg).replaceFirst("<" + CONTENT_TAG + ">"); ++ return MiniMessage.miniMessage().deserialize(miniMsg, TagResolver.resolver(args)); ++ } ++ ++ public static ChatDecorator.LegacyResult legacy(final Component maybeFormatted, final String format, final ChatDecorator.MessagePair message, final boolean hasNoFormatting) { ++ return new ChatDecorator.LegacyResult(maybeFormatted, format, message, hasNoFormatting, false); ++ } ++ ++ public static ChatDecorator.LegacyResult noFormatting(final Component component, final String format, final String legacyMessage) { ++ return new ChatDecorator.LegacyResult(component, format, new ChatDecorator.MessagePair(component, legacyMessage), true, true); ++ } ++ ++ public static ChatDecorator.LegacyResult withFormatting(final Component formatted, final String format, final Component message, final String legacyMessage) { ++ return new ChatDecorator.LegacyResult(formatted, format, new ChatDecorator.MessagePair(message, legacyMessage), false, true); ++ } ++} +diff --git a/src/main/java/io/papermc/paper/adventure/ChatProcessor.java b/src/main/java/io/papermc/paper/adventure/ChatProcessor.java +new file mode 100644 +index 0000000000000000000000000000000000000000..12ea885e815b6814a74ac3aa9d9c325e53721ecd +--- /dev/null ++++ b/src/main/java/io/papermc/paper/adventure/ChatProcessor.java +@@ -0,0 +1,379 @@ ++package io.papermc.paper.adventure; ++ ++import com.google.common.base.Suppliers; +import io.papermc.paper.chat.ChatRenderer; +import io.papermc.paper.event.player.AbstractChatEvent; +import io.papermc.paper.event.player.AsyncChatEvent; +import io.papermc.paper.event.player.ChatEvent; ++import java.util.BitSet; ++import java.util.Collection; +import java.util.HashSet; +import java.util.Set; +import java.util.concurrent.ExecutionException; -+import java.util.regex.Pattern; ++import java.util.function.Function; ++import java.util.function.Supplier; +import net.kyori.adventure.audience.Audience; +import net.kyori.adventure.audience.MessageType; +import net.kyori.adventure.text.Component; -+import net.kyori.adventure.text.TextReplacementConfig; -+import net.kyori.adventure.text.event.ClickEvent; -+import net.kyori.adventure.text.serializer.legacy.LegacyComponentSerializer; ++import net.minecraft.Util; ++import net.minecraft.network.chat.ChatDecorator; ++import net.minecraft.network.chat.ChatMessageContent; ++import net.minecraft.network.chat.ChatType; ++import net.minecraft.network.chat.OutgoingPlayerChatMessage; ++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.command.CommandSender; ++import org.bukkit.command.ConsoleCommandSender; +import org.bukkit.craftbukkit.entity.CraftPlayer; +import org.bukkit.craftbukkit.util.LazyPlayerSet; +import org.bukkit.craftbukkit.util.Waitable; @@ -130,35 +287,54 @@ index 0000000000000000000000000000000000000000..3526bc0b6ad590776124966ea907fe24 +import org.bukkit.event.HandlerList; +import org.bukkit.event.player.AsyncPlayerChatEvent; +import org.bukkit.event.player.PlayerChatEvent; ++import org.checkerframework.checker.nullness.qual.NonNull; ++import org.checkerframework.checker.nullness.qual.Nullable; ++import org.checkerframework.framework.qual.DefaultQualifier; + ++import static net.kyori.adventure.text.serializer.legacy.LegacyComponentSerializer.legacySection; ++ ++@DefaultQualifier(NonNull.class) +public final class ChatProcessor { -+ // <-- copied from adventure-text-serializer-legacy -+ private static final Pattern DEFAULT_URL_PATTERN = Pattern.compile("(?:(https?)://)?([-\\w_.]+\\.\\w{2,})(/\\S*)?"); -+ private static final Pattern URL_SCHEME_PATTERN = Pattern.compile("^[a-z][a-z0-9+\\-.]*:"); -+ private static final TextReplacementConfig URL_REPLACEMENT_CONFIG = TextReplacementConfig.builder() -+ .match(DEFAULT_URL_PATTERN) -+ .replacement(url -> { -+ String clickUrl = url.content(); -+ if (!URL_SCHEME_PATTERN.matcher(clickUrl).find()) { -+ clickUrl = "http://" + clickUrl; -+ } -+ return url.clickEvent(ClickEvent.openUrl(clickUrl)); -+ }) -+ .build(); -+ // copied from adventure-text-serializer-legacy --> -+ private static final String DEFAULT_LEGACY_FORMAT = "<%1$s> %2$s"; // copied from PlayerChatEvent/AsyncPlayerChatEvent ++ static final String DEFAULT_LEGACY_FORMAT = "<%1$s> %2$s"; // copied from PlayerChatEvent/AsyncPlayerChatEvent + final MinecraftServer server; + final ServerPlayer player; -+ final String message; ++ final PlayerChatMessage message; + final boolean async; -+ final Component originalMessage; ++ final String craftbukkit$originalMessage; ++ final Component paper$originalMessage; ++ final OutgoingPlayerChatMessage outgoing; + -+ public ChatProcessor(final MinecraftServer server, final ServerPlayer player, final String message, final boolean async) { ++ static final int MESSAGE_CHANGED = 1; ++ static final int FORMAT_CHANGED = 2; ++ static final int SENDER_CHANGED = 3; // Not used ++ // static final int FORCE_PREVIEW_USE = 4; // TODO (future, maybe?) ++ private final BitSet flags = new BitSet(3); ++ ++ public ChatProcessor(final MinecraftServer server, final ServerPlayer player, final PlayerChatMessage message, final boolean async) { + this.server = server; + this.player = player; ++ /* ++ CraftBukkit's preview/decoration system relies on both the "decorate" and chat event making the same modifications. If ++ there is unsigned content in the legacyMessage, that is because the player sent the legacyMessage without it being ++ previewed (probably by sending it too quickly). We can just ignore that because the same changes will ++ happen in the chat event. ++ ++ If unsigned content is present, it will be the same as `this.legacyMessage.signedContent().previewResult().component()`. ++ */ + this.message = message; + this.async = async; -+ this.originalMessage = Component.text(message); ++ if (this.message.signedContent().decorationResult().modernized()) { ++ this.craftbukkit$originalMessage = this.message.signedContent().decorationResult().message().legacyMessage(); ++ } else { ++ this.craftbukkit$originalMessage = message.signedContent().plain(); ++ } ++ /* ++ this.paper$originalMessage is the input to paper's chat events. This should be the decorated message component. ++ Even if the legacy preview event modified the format, and the client signed the formatted message, this should ++ still just be the message component. ++ */ ++ this.paper$originalMessage = this.message.signedContent().decorationResult().message().component(); ++ this.outgoing = OutgoingPlayerChatMessage.create(this.message); + } + + @SuppressWarnings("deprecated") @@ -167,7 +343,7 @@ index 0000000000000000000000000000000000000000..3526bc0b6ad590776124966ea907fe24 + final boolean listenersOnSyncEvent = canYouHearMe(PlayerChatEvent.getHandlerList()); + if (listenersOnAsyncEvent || listenersOnSyncEvent) { + final CraftPlayer player = this.player.getBukkitEntity(); -+ final AsyncPlayerChatEvent ae = new AsyncPlayerChatEvent(this.async, player, this.message, new LazyPlayerSet(this.server)); ++ final AsyncPlayerChatEvent ae = new AsyncPlayerChatEvent(this.async, player, this.craftbukkit$originalMessage, new LazyPlayerSet(this.server)); + this.post(ae); + if (listenersOnSyncEvent) { + final PlayerChatEvent se = new PlayerChatEvent(player, ae.getMessage(), ae.getFormat(), ae.getRecipients()); @@ -179,33 +355,73 @@ index 0000000000000000000000000000000000000000..3526bc0b6ad590776124966ea907fe24 + return null; + } + }); ++ this.readLegacyModifications(se.getMessage(), se.getFormat(), se.getPlayer()); + this.processModern( -+ legacyRenderer(se.getFormat()), ++ this.modernRenderer(se.getFormat()), + this.viewersFromLegacy(se.getRecipients()), -+ LegacyComponentSerializer.legacySection().deserialize(se.getMessage()), ++ this.modernMessage(se.getMessage()), ++ se.getPlayer(), + se.isCancelled() + ); + } else { ++ this.readLegacyModifications(ae.getMessage(), ae.getFormat(), ae.getPlayer()); + this.processModern( -+ legacyRenderer(ae.getFormat()), ++ this.modernRenderer(ae.getFormat()), + this.viewersFromLegacy(ae.getRecipients()), -+ LegacyComponentSerializer.legacySection().deserialize(ae.getMessage()), ++ this.modernMessage(ae.getMessage()), ++ ae.getPlayer(), + ae.isCancelled() + ); + } + } else { + this.processModern( -+ ChatRenderer.defaultRenderer(), ++ defaultRenderer(), + new LazyChatAudienceSet(this.server), -+ Component.text(this.message).replaceText(URL_REPLACEMENT_CONFIG), ++ this.paper$originalMessage, ++ this.player.getBukkitEntity(), + false + ); + } + } + -+ private void processModern(final ChatRenderer renderer, final Set viewers, final Component message, final boolean cancelled) { -+ final CraftPlayer player = this.player.getBukkitEntity(); -+ final AsyncChatEvent ae = new AsyncChatEvent(this.async, player, viewers, renderer, message, this.originalMessage); ++ private ChatRenderer modernRenderer(final String format) { ++ if (this.flags.get(FORMAT_CHANGED)) { ++ return legacyRenderer(format); ++ } else if (this.message.signedContent().decorationResult() instanceof ChatDecorator.LegacyResult legacyResult) { ++ return legacyRenderer(legacyResult.format()); ++ } else { ++ return defaultRenderer(); ++ } ++ } ++ ++ private Component modernMessage(final String legacyMessage) { ++ if (this.flags.get(MESSAGE_CHANGED)) { ++ return legacySection().deserialize(legacyMessage); ++ } else if (this.message.unsignedContent().isEmpty() && this.message.signedContent().decorationResult() instanceof ChatDecorator.LegacyResult legacyResult) { ++ return legacyResult.message().component(); ++ } else { ++ return this.paper$originalMessage; ++ } ++ } ++ ++ private void readLegacyModifications(final String message, final String format, final Player playerSender) { ++ final ChatMessageContent content = this.message.signedContent(); ++ if (content.decorationResult() instanceof ChatDecorator.LegacyResult result) { ++ if ((content.isDecorated() || this.message.unsignedContent().isPresent()) && !result.modernized()) { ++ this.flags.set(MESSAGE_CHANGED, !message.equals(result.message().legacyMessage())); ++ } else { ++ this.flags.set(MESSAGE_CHANGED, !message.equals(this.craftbukkit$originalMessage)); ++ } ++ this.flags.set(FORMAT_CHANGED, !format.equals(result.format())); ++ } else { ++ this.flags.set(MESSAGE_CHANGED, !message.equals(this.craftbukkit$originalMessage)); ++ this.flags.set(FORMAT_CHANGED, !format.equals(DEFAULT_LEGACY_FORMAT)); ++ } ++ this.flags.set(SENDER_CHANGED, playerSender != this.player.getBukkitEntity()); ++ } ++ ++ private void processModern(final ChatRenderer renderer, final Set viewers, final Component message, final Player player, final boolean cancelled) { ++ final AsyncChatEvent ae = new AsyncChatEvent(this.async, player, viewers, renderer, message, this.paper$originalMessage); + ae.setCancelled(cancelled); // propagate cancelled state + this.post(ae); + final boolean listenersOnSyncEvent = canYouHearMe(ChatEvent.getHandlerList()); @@ -213,39 +429,148 @@ index 0000000000000000000000000000000000000000..3526bc0b6ad590776124966ea907fe24 + this.queueIfAsyncOrRunImmediately(new Waitable() { + @Override + protected Void evaluate() { -+ final ChatEvent se = new ChatEvent(player, ae.viewers(), ae.renderer(), ae.message(), ChatProcessor.this.originalMessage); ++ final ChatEvent se = new ChatEvent(player, ae.viewers(), ae.renderer(), ae.message(), ChatProcessor.this.paper$originalMessage/*, ae.usePreviewComponent()*/); + se.setCancelled(ae.isCancelled()); // propagate cancelled state + ChatProcessor.this.post(se); ++ ChatProcessor.this.readModernModifications(se, renderer); + ChatProcessor.this.complete(se); + return null; + } + }); + } else { ++ this.readModernModifications(ae, renderer); + this.complete(ae); + } + } + ++ private void readModernModifications(final AbstractChatEvent chatEvent, final ChatRenderer originalRenderer) { ++ if (this.message.signedContent().isDecorated()) { ++ this.flags.set(MESSAGE_CHANGED, !chatEvent.message().equals(this.message.signedContent().decorationResult().message().component())); ++ } else { ++ this.flags.set(MESSAGE_CHANGED, !chatEvent.message().equals(this.paper$originalMessage)); ++ } ++ if (originalRenderer != chatEvent.renderer()) { // don't set to false if it hasn't changed ++ this.flags.set(FORMAT_CHANGED, true); ++ } ++ // this.flags.set(FORCE_PREVIEW_USE, chatEvent.usePreviewComponent()); // TODO (future, maybe?) ++ } ++ + private void complete(final AbstractChatEvent event) { + if (event.isCancelled()) { ++ this.outgoing.sendHeadersToRemainingPlayers(this.server.getPlayerList()); + return; + } + -+ final CraftPlayer player = this.player.getBukkitEntity(); ++ final CraftPlayer player = ((CraftPlayer) event.getPlayer()); + final Component displayName = displayName(player); + final Component message = event.message(); + final ChatRenderer renderer = event.renderer(); + + final Set viewers = event.viewers(); ++ final ResourceKey chatTypeKey = renderer instanceof ChatRenderer.Default ? ChatType.CHAT : ChatType.RAW; ++ final ChatType.Bound chatType = ChatType.bind(chatTypeKey, this.player.level.registryAccess(), PaperAdventure.asVanilla(displayName(player))); + -+ if (viewers instanceof LazyChatAudienceSet lazyAudienceSet && lazyAudienceSet.isLazy()) { -+ this.server.console.sendMessage(player, renderer.render(player, displayName, message, this.server.console), MessageType.CHAT); -+ for (final ServerPlayer viewer : this.server.getPlayerList().getPlayers()) { -+ final Player bukkit = viewer.getBukkitEntity(); -+ bukkit.sendMessage(player, renderer.render(player, displayName, message, bukkit), MessageType.CHAT); ++ OutgoingChat outgoingChat = viewers instanceof LazyChatAudienceSet lazyAudienceSet && lazyAudienceSet.isLazy() ? new ServerOutgoingChat() : new ViewersOutgoingChat(); ++ /* if (this.flags.get(FORCE_PREVIEW_USE)) { // TODO (future, maybe?) ++ outgoingChat.sendOriginal(player, viewers, chatType); ++ } else */ ++ if (this.flags.get(FORMAT_CHANGED)) { ++ if (renderer instanceof ChatRenderer.ViewerUnaware unaware) { ++ outgoingChat.sendFormatChangedViewerUnaware(player, PaperAdventure.asVanilla(unaware.render(player, displayName, message)), viewers, chatType); ++ } else { ++ outgoingChat.sendFormatChangedViewerAware(player, displayName, message, renderer, viewers, chatType); + } ++ } else if (this.flags.get(MESSAGE_CHANGED)) { ++ if (!(renderer instanceof ChatRenderer.ViewerUnaware unaware)) { ++ throw new IllegalStateException("BUG: There should not be a non-legacy renderer at this point"); ++ } ++ final Component renderedComponent = chatTypeKey == ChatType.CHAT ? message : unaware.render(player, displayName, message); ++ outgoingChat.sendMessageChanged(player, PaperAdventure.asVanilla(renderedComponent), viewers, chatType); + } else { -+ for (final Audience viewer : viewers) { -+ viewer.sendMessage(player, renderer.render(player, displayName, message, viewer), MessageType.CHAT); ++ outgoingChat.sendOriginal(player, viewers, chatType); ++ } ++ } ++ ++ interface OutgoingChat { ++ default void sendFormatChangedViewerUnaware(CraftPlayer player, net.minecraft.network.chat.Component renderedMessage, Set viewers, ChatType.Bound chatType) { ++ this.sendMessageChanged(player, renderedMessage, viewers, chatType); ++ } ++ ++ void sendFormatChangedViewerAware(CraftPlayer player, Component displayName, Component message, ChatRenderer renderer, Set viewers, ChatType.Bound chatType); ++ ++ void sendMessageChanged(CraftPlayer player, net.minecraft.network.chat.Component renderedMessage, Set viewers, ChatType.Bound chatType); ++ ++ void sendOriginal(CraftPlayer player, Set viewers, ChatType.Bound chatType); ++ } ++ ++ final class ServerOutgoingChat implements OutgoingChat { ++ @Override ++ public void sendFormatChangedViewerAware(CraftPlayer player, Component displayName, Component message, ChatRenderer renderer, Set viewers, ChatType.Bound chatType) { ++ ChatProcessor.this.server.getPlayerList().broadcastChatMessage(ChatProcessor.this.message, ChatProcessor.this.player, chatType, viewer -> PaperAdventure.asVanilla(renderer.render(player, displayName, message, viewer))); ++ } ++ ++ @Override ++ public void sendMessageChanged(CraftPlayer player, net.minecraft.network.chat.Component renderedMessage, Set viewers, ChatType.Bound chatType) { ++ ChatProcessor.this.server.getPlayerList().broadcastChatMessage(ChatProcessor.this.message.withUnsignedContent(renderedMessage), ChatProcessor.this.player, chatType); ++ } ++ ++ @Override ++ public void sendOriginal(CraftPlayer player, Set viewers, ChatType.Bound chatType) { ++ ChatProcessor.this.server.getPlayerList().broadcastChatMessage(ChatProcessor.this.message, ChatProcessor.this.player, chatType); ++ } ++ } ++ ++ final class ViewersOutgoingChat implements OutgoingChat { ++ @Override ++ public void sendFormatChangedViewerAware(CraftPlayer player, Component displayName, Component message, ChatRenderer renderer, Set viewers, ChatType.Bound chatType) { ++ this.broadcastToViewers(viewers, player, chatType, v -> PaperAdventure.asVanilla(renderer.render(player, displayName, message, v))); ++ } ++ ++ @Override ++ public void sendMessageChanged(CraftPlayer player, net.minecraft.network.chat.Component renderedMessage, Set viewers, ChatType.Bound chatType) { ++ this.broadcastToViewers(viewers, player, chatType, new ConstantFunction(renderedMessage)); ++ } ++ ++ @Override ++ public void sendOriginal(CraftPlayer player, Set viewers, ChatType.Bound chatType) { ++ this.broadcastToViewers(viewers, player, chatType, null); ++ } ++ ++ private void broadcastToViewers(Collection viewers, final Player source, final ChatType.Bound chatType, final @Nullable Function msgFunction) { ++ final Supplier fallbackSupplier = Suppliers.memoize(() -> PaperAdventure.asAdventure(msgFunction instanceof ConstantFunction constantFunction ? constantFunction.component : ChatProcessor.this.message.serverContent())); ++ final Function audienceMsgFunction = !(msgFunction instanceof ConstantFunction || msgFunction == null) ? msgFunction.andThen(PaperAdventure::asAdventure) : viewer -> fallbackSupplier.get(); ++ for (Audience viewer : viewers) { ++ if (viewer instanceof Player || viewer instanceof ConsoleCommandSender) { ++ // players and console have builtin PlayerChatMessage sending support while other audiences do not ++ this.sendToViewer((CommandSender) viewer, chatType, msgFunction); ++ } else { ++ viewer.sendMessage(source, audienceMsgFunction.apply(viewer), MessageType.CHAT); ++ } ++ } ++ ++ // Make sure to send remaining headers ++ ChatProcessor.this.outgoing.sendHeadersToRemainingPlayers(ChatProcessor.this.server.getPlayerList()); ++ } ++ ++ private void sendToViewer(final CommandSender viewer, final ChatType.Bound chatType, final @Nullable Function msgFunction) { ++ if (viewer instanceof ConsoleCommandSender) { ++ this.sendToServer(chatType, msgFunction); ++ } else if (viewer instanceof CraftPlayer craftPlayer) { ++ craftPlayer.getHandle().sendChatMessage(ChatProcessor.this.outgoing, ChatProcessor.this.player.shouldFilterMessageTo(craftPlayer.getHandle()), chatType, Util.mapNullable(msgFunction, f -> f.apply(viewer))); ++ } else { ++ throw new IllegalStateException("Should only be a Player or Console"); ++ } ++ } ++ ++ private void sendToServer(final ChatType.Bound chatType, final @Nullable Function msgFunction) { ++ final PlayerChatMessage toConsoleMessage = msgFunction == null ? ChatProcessor.this.message : ChatProcessor.this.message.withUnsignedContent(msgFunction.apply(ChatProcessor.this.server.console)); ++ ChatProcessor.this.server.logChatMessage(toConsoleMessage.serverContent(), chatType, ChatProcessor.this.server.getPlayerList().verifyChatTrusted(toConsoleMessage, ChatProcessor.this.player.asChatSender()) ? null : "Not Secure"); ++ } ++ ++ record ConstantFunction(net.minecraft.network.chat.Component component) implements Function { ++ @Override ++ public net.minecraft.network.chat.Component apply(Audience audience) { ++ return this.component; + } + } + } @@ -259,19 +584,27 @@ index 0000000000000000000000000000000000000000..3526bc0b6ad590776124966ea907fe24 + return viewers; + } + -+ private static String legacyDisplayName(final CraftPlayer player) { ++ static String legacyDisplayName(final CraftPlayer player) { + return player.getDisplayName(); + } + -+ private static Component displayName(final CraftPlayer player) { ++ static Component displayName(final CraftPlayer player) { + return player.displayName(); + } + ++ private static ChatRenderer.Default defaultRenderer() { ++ return (ChatRenderer.Default) ChatRenderer.defaultRenderer(); ++ } ++ + private static ChatRenderer legacyRenderer(final String format) { + if (DEFAULT_LEGACY_FORMAT.equals(format)) { -+ return ChatRenderer.defaultRenderer(); ++ return defaultRenderer(); + } -+ return ChatRenderer.viewerUnaware((player, displayName, message) -> LegacyComponentSerializer.legacySection().deserialize(String.format(format, legacyDisplayName((CraftPlayer) player), LegacyComponentSerializer.legacySection().serialize(message))).replaceText(URL_REPLACEMENT_CONFIG)); ++ return ChatRenderer.viewerUnaware((player, sourceDisplayName, message) -> legacySection().deserialize(legacyFormat(format, player, legacySection().serialize(message)))); ++ } ++ ++ static String legacyFormat(final String format, Player player, String message) { ++ return String.format(format, legacyDisplayName((CraftPlayer) player), message); + } + + private void queueIfAsyncOrRunImmediately(final Waitable waitable) { @@ -293,7 +626,7 @@ index 0000000000000000000000000000000000000000..3526bc0b6ad590776124966ea907fe24 + this.server.server.getPluginManager().callEvent(event); + } + -+ private static boolean canYouHearMe(final HandlerList handlers) { ++ static boolean canYouHearMe(final HandlerList handlers) { + return handlers.getRegisteredListeners().length > 0; + } +} @@ -361,7 +694,7 @@ index 0000000000000000000000000000000000000000..2fd6c3e65354071af71c7d8ebb97b559 +} diff --git a/src/main/java/io/papermc/paper/adventure/PaperAdventure.java b/src/main/java/io/papermc/paper/adventure/PaperAdventure.java new file mode 100644 -index 0000000000000000000000000000000000000000..3f25a9b1a74cfa0c9a4d0379ecda109d99f33db3 +index 0000000000000000000000000000000000000000..6679038054796b9bdfeb6fb4b29e50aa63052101 --- /dev/null +++ b/src/main/java/io/papermc/paper/adventure/PaperAdventure.java @@ -0,0 +1,331 @@ @@ -384,8 +717,8 @@ index 0000000000000000000000000000000000000000..3f25a9b1a74cfa0c9a4d0379ecda109d +import net.kyori.adventure.text.TranslatableComponent; +import net.kyori.adventure.text.flattener.ComponentFlattener; +import net.kyori.adventure.text.format.TextColor; ++import net.kyori.adventure.text.serializer.ComponentSerializer; +import net.kyori.adventure.text.serializer.gson.GsonComponentSerializer; -+import net.kyori.adventure.text.serializer.legacy.LegacyComponentSerializer; +import net.kyori.adventure.text.serializer.plain.PlainComponentSerializer; +import net.kyori.adventure.text.serializer.plain.PlainTextComponentSerializer; +import net.kyori.adventure.translation.GlobalTranslator; @@ -474,7 +807,7 @@ index 0000000000000000000000000000000000000000..3f25a9b1a74cfa0c9a4d0379ecda109d + return decoded.toString(); + } + }; -+ static final WrapperAwareSerializer WRAPPER_AWARE_SERIALIZER = new WrapperAwareSerializer(); ++ public static final ComponentSerializer WRAPPER_AWARE_SERIALIZER = new WrapperAwareSerializer(); + + private PaperAdventure() { + } @@ -1090,6 +1423,28 @@ index 98f2def9125d6faf5859572a004fa8d2fa066417..436f381c727cda72c04859c540dce471 @Nullable public static ChatFormatting getById(int colorIndex) { 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 +index 83ffb7a08630fdaf8655569d82974625c0eaf1ff..4da1ebcd0226897f8b03bd00a851f793df3506f4 100644 +--- a/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 + MinecraftServer minecraftServer = source.getServer(); + source.getChatMessageChainer().append(() -> { + CompletableFuture completableFuture = this.filterPlainText(source, this.signedArgument.signedContent().plain()); +- CompletableFuture completableFuture2 = minecraftServer.getChatDecorator().decorate(source.getPlayer(), this.signedArgument); ++ CompletableFuture completableFuture2 = minecraftServer.getChatDecorator().decorate(source.getPlayer(), source,this.signedArgument); // Paper + return CompletableFuture.allOf(completableFuture, completableFuture2).thenAcceptAsync((void_) -> { + PlayerChatMessage playerChatMessage = completableFuture2.join().filter(completableFuture.join().mask()); + callback.accept(playerChatMessage); +@@ -131,7 +131,7 @@ public class MessageArgument implements SignedArgument + + CompletableFuture resolveDecoratedComponent(CommandSourceStack source) throws CommandSyntaxException { + Component component = this.resolveComponent(source); +- CompletableFuture completableFuture = source.getServer().getChatDecorator().decorate(source.getPlayer(), component); ++ CompletableFuture completableFuture = source.getServer().getChatDecorator().decorate(source.getPlayer(), source, component, true).thenApply(net.minecraft.network.chat.ChatDecorator.Result::component); // Paper + MessageArgument.logResolutionFailure(source, completableFuture); + return completableFuture; + } diff --git a/src/main/java/net/minecraft/network/FriendlyByteBuf.java b/src/main/java/net/minecraft/network/FriendlyByteBuf.java index c4854debe11b8bb61fa49c76c1854f94c1e7777f..42514a0c7066dc79050c0496d6463528b593f9e4 100644 --- a/src/main/java/net/minecraft/network/FriendlyByteBuf.java @@ -1147,6 +1502,169 @@ index 021a26a6b1c258deffc26c035ab52a4ea027d9a1..00d432bd395e7f7fb6ee24e371818d13 try { 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 +index 0906160cb6b6b211ad50a29e5ab80ac99ac8b85b..1fbd30c52c2f1aa0594bd744ab4590709f5d34dd 100644 +--- a/src/main/java/net/minecraft/network/chat/ChatDecorator.java ++++ b/src/main/java/net/minecraft/network/chat/ChatDecorator.java +@@ -10,12 +10,82 @@ public interface ChatDecorator { + return CompletableFuture.completedFuture(message); + }; + ++ @io.papermc.paper.annotation.DoNotUse // Paper + CompletableFuture decorate(@Nullable ServerPlayer sender, Component message); + ++ @io.papermc.paper.annotation.DoNotUse // Paper + default CompletableFuture 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 ++ default CompletableFuture decorate(@Nullable ServerPlayer sender, @Nullable net.minecraft.commands.CommandSourceStack commandSourceStack, Component message, boolean isPreview) { ++ throw new UnsupportedOperationException("Must override this implementation"); ++ } ++ ++ static ChatDecorator create(ImprovedChatDecorator delegate) { ++ return new ChatDecorator() { ++ @Override ++ public CompletableFuture decorate(@Nullable ServerPlayer sender, Component message) { ++ return this.decorate(sender, null, message, true).thenApply(Result::component); ++ } ++ ++ @Override ++ public CompletableFuture decorate(@Nullable ServerPlayer sender, @Nullable net.minecraft.commands.CommandSourceStack commandSourceStack, Component message, boolean isPreview) { ++ return delegate.decorate(sender, commandSourceStack, message, isPreview); ++ } ++ }; ++ } ++ ++ @FunctionalInterface ++ interface ImprovedChatDecorator { ++ CompletableFuture decorate(@Nullable ServerPlayer sender, @Nullable net.minecraft.commands.CommandSourceStack commandSourceStack, Component message, boolean isPreview); ++ } ++ ++ interface Result { ++ boolean hasNoFormatting(); ++ ++ Component component(); ++ ++ MessagePair message(); ++ ++ boolean modernized(); ++ } ++ ++ record MessagePair(net.kyori.adventure.text.Component component, String legacyMessage) { } ++ ++ record LegacyResult(Component component, String format, MessagePair message, boolean hasNoFormatting, boolean modernized) implements Result { ++ public LegacyResult(net.kyori.adventure.text.Component component, String format, MessagePair message, boolean hasNoFormatting, boolean modernified) { ++ this(io.papermc.paper.adventure.PaperAdventure.asVanilla(component), format, message, hasNoFormatting, modernified); ++ } ++ public LegacyResult { ++ component = component instanceof io.papermc.paper.adventure.AdventureComponent adventureComponent ? adventureComponent.deepConverted() : component; ++ } ++ } ++ ++ record ModernResult(Component maybeAdventureComponent, boolean hasNoFormatting, boolean modernized) implements Result { ++ public ModernResult(net.kyori.adventure.text.Component component, boolean hasNoFormatting, boolean modernized) { ++ this(io.papermc.paper.adventure.PaperAdventure.asVanilla(component), hasNoFormatting, modernized); ++ } ++ ++ @Override ++ public Component component() { ++ return this.maybeAdventureComponent instanceof io.papermc.paper.adventure.AdventureComponent adventureComponent ? adventureComponent.deepConverted() : this.maybeAdventureComponent; ++ } ++ ++ @Override ++ public MessagePair message() { ++ final net.kyori.adventure.text.Component adventureComponent = io.papermc.paper.adventure.PaperAdventure.WRAPPER_AWARE_SERIALIZER.deserialize(this.maybeAdventureComponent); ++ return new MessagePair(adventureComponent, net.kyori.adventure.text.serializer.legacy.LegacyComponentSerializer.legacySection().serialize(adventureComponent)); ++ } ++ } ++ default CompletableFuture decorate(@Nullable ServerPlayer serverPlayer, @Nullable net.minecraft.commands.CommandSourceStack commandSourceStack, PlayerChatMessage playerChatMessage) { ++ return playerChatMessage.signedContent().isDecorated() ? CompletableFuture.completedFuture(playerChatMessage) : this.decorate(serverPlayer, commandSourceStack, playerChatMessage.serverContent(), false).thenApply(result -> { ++ return new PlayerChatMessage(playerChatMessage.signedHeader(), playerChatMessage.headerSignature(), playerChatMessage.signedBody().withContent(playerChatMessage.signedContent().withDecorationResult(result)), playerChatMessage.unsignedContent(), playerChatMessage.filterMask()).withUnsignedContent(result.component()); ++ }); ++ } ++ // Paper end ++ + static PlayerChatMessage attachIfNotDecorated(PlayerChatMessage message, Component attached) { + return !message.signedContent().isDecorated() ? message.withUnsignedContent(attached) : message; + } +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 +--- a/src/main/java/net/minecraft/network/chat/ChatMessageContent.java ++++ b/src/main/java/net/minecraft/network/chat/ChatMessageContent.java +@@ -3,7 +3,17 @@ package net.minecraft.network.chat; + import java.util.Objects; + import net.minecraft.network.FriendlyByteBuf; + +-public record ChatMessageContent(String plain, Component decorated) { ++// Paper start ++public record ChatMessageContent(String plain, Component decorated, ChatDecorator.Result decorationResult) { ++ ++ public ChatMessageContent(String plain, Component decorated) { ++ this(plain, decorated, new ChatDecorator.ModernResult(decorated, true, false)); ++ } ++ ++ public ChatMessageContent withDecorationResult(ChatDecorator.Result result) { ++ return new ChatMessageContent(this.plain, this.decorated, result); ++ } ++ // Paper end + public ChatMessageContent(String content) { + this(content, Component.literal(content)); + } +diff --git a/src/main/java/net/minecraft/network/chat/ChatPreviewCache.java b/src/main/java/net/minecraft/network/chat/ChatPreviewCache.java +index 85e75f3eb58be03b500e663a128663cbe9331605..487822cc8e491c38a276d0d78db6f5207de8a65b 100644 +--- a/src/main/java/net/minecraft/network/chat/ChatPreviewCache.java ++++ b/src/main/java/net/minecraft/network/chat/ChatPreviewCache.java +@@ -1,27 +1,44 @@ + package net.minecraft.network.chat; + + import javax.annotation.Nullable; ++import net.minecraft.Util; + + public class ChatPreviewCache { + @Nullable + private ChatPreviewCache.Result result; + + public void set(String query, Component preview) { +- this.result = new ChatPreviewCache.Result(query, preview); ++ // Paper start ++ this.set(query, new ChatDecorator.ModernResult(java.util.Objects.requireNonNull(preview), true, false)); ++ } ++ public void set(String query, ChatDecorator.Result decoratorResult) { ++ this.result = new ChatPreviewCache.Result(query, java.util.Objects.requireNonNull(decoratorResult)); ++ // Paper end + } + + @Nullable + public Component pull(String query) { ++ // Paper start ++ return net.minecraft.Util.mapNullable(this.pullFull(query), Result::preview); ++ } ++ public @Nullable Result pullFull(String query) { ++ // Paper end + ChatPreviewCache.Result result = this.result; + if (result != null && result.matches(query)) { + this.result = null; +- return result.preview(); ++ return result; // Paper + } else { + return null; + } + } + +- static record Result(String query, Component preview) { ++ // Paper start ++ public record Result(String query, ChatDecorator.Result decoratorResult) { ++ ++ public Component preview() { ++ return this.decoratorResult.component(); ++ } ++ // Paper end + public boolean matches(String query) { + return this.query.equals(query); + } diff --git a/src/main/java/net/minecraft/network/chat/Component.java b/src/main/java/net/minecraft/network/chat/Component.java index 06736982f7625c1a532315afe94e5e0c45ec1331..e7d9e2d8c87ddf3658b1c2e0f2a3e98ef8080cec 100644 --- a/src/main/java/net/minecraft/network/chat/Component.java @@ -1175,6 +1693,55 @@ index 06736982f7625c1a532315afe94e5e0c45ec1331..e7d9e2d8c87ddf3658b1c2e0f2a3e98e JsonObject jsonobject = new JsonObject(); 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 +index de717cf25308bbade7b2c0a9187cf89238663636..bd82f0316df85b621c1970ff30bbbec0d2712ccd 100644 +--- a/src/main/java/net/minecraft/network/chat/OutgoingPlayerChatMessage.java ++++ b/src/main/java/net/minecraft/network/chat/OutgoingPlayerChatMessage.java +@@ -14,6 +14,12 @@ public interface OutgoingPlayerChatMessage { + + void sendToPlayer(ServerPlayer sender, boolean filterMaskEnabled, ChatType.Bound params); + ++ // Paper start ++ default void sendToPlayer(ServerPlayer sender, boolean filterMaskEnabled, ChatType.Bound params, @javax.annotation.Nullable Component unsigned) { ++ this.sendToPlayer(sender, filterMaskEnabled, params); ++ } ++ // Paper end ++ + void sendHeadersToRemainingPlayers(PlayerList playerManager); + + static OutgoingPlayerChatMessage create(PlayerChatMessage message) { +@@ -34,7 +40,15 @@ public interface OutgoingPlayerChatMessage { + + @Override + public void sendToPlayer(ServerPlayer sender, boolean filterMaskEnabled, ChatType.Bound params) { ++ // Paper start ++ this.sendToPlayer(sender, filterMaskEnabled, params, null); ++ } ++ ++ @Override ++ public void sendToPlayer(ServerPlayer sender, boolean filterMaskEnabled, ChatType.Bound params, @javax.annotation.Nullable Component unsigned) { ++ // Paper end + PlayerChatMessage playerChatMessage = this.message.filter(filterMaskEnabled); ++ playerChatMessage = unsigned != null ? playerChatMessage.withUnsignedContent(unsigned) : playerChatMessage; // Paper + if (!playerChatMessage.isFullyFiltered()) { + RegistryAccess registryAccess = sender.level.registryAccess(); + ChatType.BoundNetwork boundNetwork = params.toNetwork(registryAccess); +@@ -64,7 +78,15 @@ public interface OutgoingPlayerChatMessage { + + @Override + public void sendToPlayer(ServerPlayer sender, boolean filterMaskEnabled, ChatType.Bound params) { ++ // Paper start ++ this.sendToPlayer(sender, filterMaskEnabled, params, null); ++ } ++ ++ @Override ++ public void sendToPlayer(ServerPlayer sender, boolean filterMaskEnabled, ChatType.Bound params, @javax.annotation.Nullable Component unsigned) { ++ // Paper end + PlayerChatMessage playerChatMessage = this.message.filter(filterMaskEnabled); ++ playerChatMessage = unsigned != null ? playerChatMessage.withUnsignedContent(unsigned) : playerChatMessage; // Paper + if (!playerChatMessage.isFullyFiltered()) { + this.playersWithFullMessage.add(sender); + 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 index 02183c810f9968621b9b20c1f7b54258b620c507..32ef3edebe94a2014168b7e438752a80b2687e5f 100644 --- a/src/main/java/net/minecraft/network/protocol/game/ClientboundSetActionBarTextPacket.java @@ -1326,7 +1893,7 @@ index 762a9392ffac3042356709dddd15bb3516048bed..3544e2dc2522e9d6305d727d56e73490 buf.writeComponent(this.footer); } diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index 3aadba90ab32388b9e8ef96f182fa263c760f53b..acc5ce86ae8aa5ada21e6c97f7921caca4b0bd00 100644 +index 805a1773d55e2551911e5b8e69052e23f630359b..e4220f14a5ebf43dd3491fc8649c2be5238c5798 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java @@ -229,6 +229,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop { +- // SPIGOT-7127: Console /say and similar +- if (entityplayer == null) { +- return CompletableFuture.completedFuture(ichatbasecomponent); +- } +- +- return CompletableFuture.supplyAsync(() -> { +- AsyncPlayerChatPreviewEvent event = new AsyncPlayerChatPreviewEvent(true, entityplayer.getBukkitEntity(), CraftChatMessage.fromComponent(ichatbasecomponent), new LazyPlayerSet(this)); +- String originalFormat = event.getFormat(), originalMessage = event.getMessage(); +- this.server.getPluginManager().callEvent(event); +- +- if (originalFormat.equals(event.getFormat()) && originalMessage.equals(event.getMessage()) && event.getPlayer().getName().equalsIgnoreCase(event.getPlayer().getDisplayName())) { +- return ichatbasecomponent; +- } +- +- return CraftChatMessage.fromStringOrNull(String.format(event.getFormat(), event.getPlayer().getDisplayName(), event.getMessage())); +- }, chatExecutor); +- }; ++ // Paper start - moved to ChatPreviewProcessor ++ return ChatDecorator.create((sender, commandSourceStack, message, isPreview) -> { ++ final io.papermc.paper.adventure.ChatDecorationProcessor processor = new io.papermc.paper.adventure.ChatDecorationProcessor(this, sender, commandSourceStack, message, isPreview); ++ return processor.process(); ++ }); ++ // Paper end + // CraftBukkit end + } + diff --git a/src/main/java/net/minecraft/server/level/ServerPlayer.java b/src/main/java/net/minecraft/server/level/ServerPlayer.java -index 4759a0eceeccf28b62cb8865b423235d47d07443..58aea845e8ce6e46e52fc3bdfa9c64153c32a750 100644 +index 84564ca128d2dfc79c0b5a13b699cf6fc80bdea7..9ab4588e4e512176b881ad4c252e400ff6ea97bd 100644 --- a/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; @@ -1411,7 +2013,22 @@ index 4759a0eceeccf28b62cb8865b423235d47d07443..58aea845e8ce6e46e52fc3bdfa9c6415 this.connection.send(new ClientboundPlayerCombatKillPacket(this.getCombatTracker(), ichatbasecomponent), PacketSendListener.exceptionallySend(() -> { boolean flag1 = true; -@@ -1751,6 +1749,7 @@ public class ServerPlayer extends Player { +@@ -1729,8 +1727,13 @@ public class ServerPlayer extends Player { + } + + public void sendChatMessage(OutgoingPlayerChatMessage message, boolean filterMaskEnabled, ChatType.Bound params) { ++ // Paper start ++ this.sendChatMessage(message, filterMaskEnabled, params, null); ++ } ++ public void sendChatMessage(OutgoingPlayerChatMessage message, boolean filterMaskEnabled, ChatType.Bound params, @Nullable Component unsigned) { ++ // Paper end + if (this.acceptsChatMessages()) { +- message.sendToPlayer(this, filterMaskEnabled, params); ++ message.sendToPlayer(this, filterMaskEnabled, params, unsigned); // Paper + } + + } +@@ -1751,6 +1754,7 @@ public class ServerPlayer extends Player { } public String locale = "en_us"; // CraftBukkit - add, lowercase @@ -1419,7 +2036,7 @@ index 4759a0eceeccf28b62cb8865b423235d47d07443..58aea845e8ce6e46e52fc3bdfa9c6415 public void updateOptions(ServerboundClientInformationPacket packet) { // CraftBukkit start if (getMainArm() != packet.mainHand()) { -@@ -1762,6 +1761,10 @@ public class ServerPlayer extends Player { +@@ -1762,6 +1766,10 @@ public class ServerPlayer extends Player { this.server.server.getPluginManager().callEvent(event); } this.locale = packet.language; @@ -1431,19 +2048,19 @@ index 4759a0eceeccf28b62cb8865b423235d47d07443..58aea845e8ce6e46e52fc3bdfa9c6415 // CraftBukkit end 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 -index 13f996d163739f419b701854b5248a02edfc93c0..59932a4f83461280ab3c097add951e5a138eb53d 100644 +index bc253a8140f6775d038b2b0bfa185de99b3010d8..a258c965a4a0352f9d77def6748b176f3bdab106 100644 --- a/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; +@@ -188,6 +188,8 @@ import org.apache.commons.lang3.StringUtils; import org.slf4j.Logger; // CraftBukkit start +import io.papermc.paper.adventure.ChatProcessor; // Paper +import io.papermc.paper.adventure.PaperAdventure; // Paper + import java.util.Arrays; import java.util.concurrent.ExecutionException; import java.util.concurrent.atomic.AtomicInteger; - import net.minecraft.network.chat.OutgoingPlayerChatMessage; -@@ -441,14 +443,17 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic +@@ -444,14 +446,17 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic return this.server.isSingleplayerOwner(this.player.getGameProfile()); } @@ -1467,7 +2084,7 @@ index 13f996d163739f419b701854b5248a02edfc93c0..59932a4f83461280ab3c097add951e5a // CraftBukkit start - fire PlayerKickEvent if (this.processedDisconnect) { return; -@@ -457,7 +462,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic +@@ -460,7 +465,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic Waitable waitable = new Waitable() { @Override protected Object evaluate() { @@ -1476,7 +2093,7 @@ index 13f996d163739f419b701854b5248a02edfc93c0..59932a4f83461280ab3c097add951e5a return null; } }; -@@ -474,9 +479,9 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic +@@ -477,9 +482,9 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic return; } @@ -1488,7 +2105,7 @@ index 13f996d163739f419b701854b5248a02edfc93c0..59932a4f83461280ab3c097add951e5a if (this.cserver.getServer().isRunning()) { this.cserver.getPluginManager().callEvent(event); -@@ -488,7 +493,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic +@@ -491,7 +496,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic } this.player.kickLeaveMessage = event.getLeaveMessage(); // CraftBukkit - SPIGOT-3034: Forward leave message to PlayerQuitEvent // Send the possibly modified leave message @@ -1497,7 +2114,7 @@ index 13f996d163739f419b701854b5248a02edfc93c0..59932a4f83461280ab3c097add951e5a // CraftBukkit end this.connection.send(new ClientboundDisconnectPacket(ichatbasecomponent), PacketSendListener.thenRun(() -> { -@@ -1785,9 +1790,11 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic +@@ -1788,9 +1793,11 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic */ this.player.disconnect(); @@ -1512,21 +2129,76 @@ index 13f996d163739f419b701854b5248a02edfc93c0..59932a4f83461280ab3c097add951e5a } // CraftBukkit end this.player.getTextFilter().leave(); -@@ -2039,7 +2046,12 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic +@@ -1880,7 +1887,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic + if (this.verifyChatMessage(playerchatmessage)) { + this.chatMessageChain.append(() -> { + CompletableFuture completablefuture = this.filterTextPacket(playerchatmessage.signedContent().plain()); +- CompletableFuture completablefuture1 = this.server.getChatDecorator().decorate(this.player, playerchatmessage); ++ CompletableFuture completablefuture1 = this.server.getChatDecorator().decorate(this.player, null, playerchatmessage); // Paper + + return CompletableFuture.allOf(completablefuture, completablefuture1).thenAcceptAsync((ovoid) -> { + FilterMask filtermask = ((FilteredText) completablefuture.join()).mask(); +@@ -2042,7 +2049,12 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic this.handleCommand(s); } else if (this.player.getChatVisibility() == ChatVisiblity.SYSTEM) { // Do nothing, this is coming from a plugin - } else { + // Paper start + } else if (true) { -+ final ChatProcessor cp = new ChatProcessor(this.server, this.player, s, async); ++ final ChatProcessor cp = new ChatProcessor(this.server, this.player, original, async); + cp.process(); + // Paper end + } else if (false) { // Paper Player player = this.getCraftPlayer(); AsyncPlayerChatEvent event = new AsyncPlayerChatEvent(async, player, s, new LazyPlayerSet(this.server)); String originalFormat = event.getFormat(), originalMessage = event.getMessage(); -@@ -3076,30 +3088,30 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic +@@ -2175,9 +2187,12 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic + } + + private ChatMessageContent getSignedContent(ServerboundChatPacket packet) { +- Component ichatbasecomponent = this.chatPreviewCache.pull(packet.message()); ++ // Paper start ++ final net.minecraft.network.chat.ChatPreviewCache.Result result = this.chatPreviewCache.pullFull(packet.message()); ++ Component ichatbasecomponent = result != null ? result.preview() : null; ++ // Paper end + +- return packet.signedPreview() && ichatbasecomponent != null ? new ChatMessageContent(packet.message(), ichatbasecomponent) : new ChatMessageContent(packet.message()); ++ return packet.signedPreview() && ichatbasecomponent != null ? new ChatMessageContent(packet.message(), ichatbasecomponent, result.decoratorResult()) : new ChatMessageContent(packet.message()); // Paper end + } + + private void broadcastChatMessage(PlayerChatMessage message) { +@@ -2280,14 +2295,17 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic + + private CompletableFuture queryChatPreview(String query) { + MutableComponent ichatmutablecomponent = Component.literal(query); +- CompletableFuture completablefuture = this.server.getChatDecorator().decorate(this.player, (Component) ichatmutablecomponent).thenApply((ichatbasecomponent) -> { +- return !ichatmutablecomponent.equals(ichatbasecomponent) ? ichatbasecomponent : null; ++ // Paper start ++ final CompletableFuture result = this.server.getChatDecorator().decorate(this.player, null, ichatmutablecomponent, true); ++ CompletableFuture completablefuture = result.thenApply((res) -> { ++ return !ichatmutablecomponent.equals(res.component()) ? res : null; ++ // Paper end + }); + + completablefuture.thenAcceptAsync((ichatbasecomponent) -> { +- this.chatPreviewCache.set(query, ichatbasecomponent); ++ if (ichatbasecomponent != null) this.chatPreviewCache.set(query, ichatbasecomponent); // Paper + }, this.server); +- return completablefuture; ++ return completablefuture.thenApply(net.minecraft.network.chat.ChatDecorator.Result::component); // paper + } + + private CompletableFuture queryCommandPreview(String query) { +@@ -2296,7 +2314,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic + CompletableFuture completablefuture = this.getPreviewedArgument(commandlistenerwrapper, PreviewableCommand.of(parseresults)); + + completablefuture.thenAcceptAsync((ichatbasecomponent) -> { +- this.chatPreviewCache.set(query, ichatbasecomponent); ++ if (ichatbasecomponent != null) this.chatPreviewCache.set(query, ichatbasecomponent); // Paper + }, this.server); + return completablefuture; + } +@@ -3092,30 +3110,30 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic return; } @@ -1565,10 +2237,10 @@ index 13f996d163739f419b701854b5248a02edfc93c0..59932a4f83461280ab3c097add951e5a } // CraftBukkit end 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 +++ 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) { final PlayerPreLoginEvent event = new PlayerPreLoginEvent(playerName, address, uniqueId); if (asyncEvent.getResult() != PlayerPreLoginEvent.Result.ALLOWED) { @@ -1577,7 +2249,7 @@ index fed3a8c5a23f3a7b279f209aaaab5f6ffa3f137c..5054c3208d1723a33a96d23edcbc9f14 } Waitable waitable = new Waitable() { @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); if (waitable.get() != PlayerPreLoginEvent.Result.ALLOWED) { @@ -1606,7 +2278,7 @@ index 3a587073dbe5e8a599d342c5f758d842b7b6cddb..a426adfba3fccf1815177e0b8065684c @Override diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java -index ba6f4e9f74a524201390bd0e9106a6cf6afe0375..946b2b7341a10c25fae71d76f7b181b555fe38b6 100644 +index 6987bee4bf2c1f3d47ffdd5329f6c0c63a2962a5..521f485366c65527ac3289dd27d8f2e311706a10 100644 --- a/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; @@ -1721,6 +2393,52 @@ index ba6f4e9f74a524201390bd0e9106a6cf6afe0375..946b2b7341a10c25fae71d76f7b181b5 } // CraftBukkit end +@@ -1169,14 +1169,25 @@ public abstract class PlayerList { + } + + public void broadcastChatMessage(PlayerChatMessage message, ServerPlayer sender, ChatType.Bound params) { ++ // Paper start ++ this.broadcastChatMessage(message, sender, params, null); ++ } ++ public void broadcastChatMessage(PlayerChatMessage message, ServerPlayer sender, ChatType.Bound params, @Nullable Function unsignedFunction) { ++ // Paper end + Objects.requireNonNull(sender); +- this.broadcastChatMessage(message, sender::shouldFilterMessageTo, sender, sender.asChatSender(), params); ++ this.broadcastChatMessage(message, sender::shouldFilterMessageTo, sender, sender.asChatSender(), params, unsignedFunction); // Paper + } + + private void broadcastChatMessage(PlayerChatMessage message, Predicate shouldSendFiltered, @Nullable ServerPlayer sender, ChatSender sourceProfile, ChatType.Bound params) { ++ // Paper start ++ this.broadcastChatMessage(message, shouldSendFiltered, sender, sourceProfile, params, null); ++ } ++ ++ private void broadcastChatMessage(PlayerChatMessage message, Predicate shouldSendFiltered, @Nullable ServerPlayer sender, ChatSender sourceProfile, ChatType.Bound params, @Nullable Function unsignedFunction) { ++ // Paper end + boolean flag = this.verifyChatTrusted(message, sourceProfile); + +- this.server.logChatMessage(message.serverContent(), params, flag ? null : "Not Secure"); ++ this.server.logChatMessage((unsignedFunction == null ? message : message.withUnsignedContent(unsignedFunction.apply(this.server.console))).serverContent(), params, flag ? null : "Not Secure"); // Paper + OutgoingPlayerChatMessage outgoingplayerchatmessage = OutgoingPlayerChatMessage.create(message); + boolean flag1 = message.isFullyFiltered(); + boolean flag2 = false; +@@ -1186,7 +1197,7 @@ public abstract class PlayerList { + ServerPlayer entityplayer1 = (ServerPlayer) iterator.next(); + boolean flag3 = shouldSendFiltered.test(entityplayer1); + +- entityplayer1.sendChatMessage(outgoingplayerchatmessage, flag3, params); ++ entityplayer1.sendChatMessage(outgoingplayerchatmessage, flag3, params, unsignedFunction == null ? null : unsignedFunction.apply(entityplayer1.getBukkitEntity())); // Paper + if (sender != entityplayer1) { + flag2 |= flag1 && flag3; + } +@@ -1213,7 +1224,7 @@ public abstract class PlayerList { + + } + +- private boolean verifyChatTrusted(PlayerChatMessage message, ChatSender profile) { ++ public boolean verifyChatTrusted(PlayerChatMessage message, ChatSender profile) { // Paper - private -> public + return !message.hasExpiredServer(Instant.now()) && message.verify(profile); + } + diff --git a/src/main/java/net/minecraft/world/BossEvent.java b/src/main/java/net/minecraft/world/BossEvent.java index 4c62df5a3781ec9df4a5c5f1b528649e6e8a62d1..affd1b8c7589ba59330dc0b6fc803cce4ee57397 100644 --- a/src/main/java/net/minecraft/world/BossEvent.java @@ -1831,10 +2549,10 @@ index 595b56b2ab9a813ba71399d306117294fa90dc65..3527d40102d512d0e276edc969ea3c18 } collection = icons; diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -index a850bb8a4268c0210ee7af98f51131759ff95f30..837fb51698e6650c6df720f798b7196322b6e7bb 100644 +index 4dd952faac05f553b28d1252296b0587369865f4..6139a06453e370865889f47644a6840fce2934f2 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -@@ -590,8 +590,10 @@ public final class CraftServer implements Server { +@@ -592,8 +592,10 @@ public final class CraftServer implements Server { } @Override @@ -1845,7 +2563,7 @@ index a850bb8a4268c0210ee7af98f51131759ff95f30..837fb51698e6650c6df720f798b71963 } @Override -@@ -1411,7 +1413,15 @@ public final class CraftServer implements Server { +@@ -1413,7 +1415,15 @@ public final class CraftServer implements Server { return this.configuration.getInt("settings.spawn-radius", -1); } @@ -1861,7 +2579,7 @@ index a850bb8a4268c0210ee7af98f51131759ff95f30..837fb51698e6650c6df720f798b71963 public String getShutdownMessage() { return this.configuration.getString("settings.shutdown-message"); } -@@ -1579,7 +1589,20 @@ public final class CraftServer implements Server { +@@ -1581,7 +1591,20 @@ public final class CraftServer implements Server { } @Override @@ -1882,7 +2600,7 @@ index a850bb8a4268c0210ee7af98f51131759ff95f30..837fb51698e6650c6df720f798b71963 Set recipients = new HashSet<>(); for (Permissible permissible : this.getPluginManager().getPermissionSubscriptions(permission)) { if (permissible instanceof CommandSender && permissible.hasPermission(permission)) { -@@ -1587,14 +1610,14 @@ public final class CraftServer implements Server { +@@ -1589,14 +1612,14 @@ public final class CraftServer implements Server { } } @@ -1899,7 +2617,7 @@ index a850bb8a4268c0210ee7af98f51131759ff95f30..837fb51698e6650c6df720f798b71963 for (CommandSender recipient : recipients) { recipient.sendMessage(message); -@@ -1845,6 +1868,14 @@ public final class CraftServer implements Server { +@@ -1847,6 +1870,14 @@ public final class CraftServer implements Server { return CraftInventoryCreator.INSTANCE.createInventory(owner, type); } @@ -1914,7 +2632,7 @@ index a850bb8a4268c0210ee7af98f51131759ff95f30..837fb51698e6650c6df720f798b71963 @Override public Inventory createInventory(InventoryHolder owner, InventoryType type, String title) { Validate.isTrue(type.isCreatable(), "Cannot open an inventory of type ", type); -@@ -1857,13 +1888,28 @@ public final class CraftServer implements Server { +@@ -1859,13 +1890,28 @@ public final class CraftServer implements Server { return CraftInventoryCreator.INSTANCE.createInventory(owner, size); } @@ -1943,7 +2661,7 @@ index a850bb8a4268c0210ee7af98f51131759ff95f30..837fb51698e6650c6df720f798b71963 public Merchant createMerchant(String title) { return new CraftMerchantCustom(title == null ? InventoryType.MERCHANT.getDefaultTitle() : title); } -@@ -1928,6 +1974,12 @@ public final class CraftServer implements Server { +@@ -1930,6 +1976,12 @@ public final class CraftServer implements Server { return Thread.currentThread().equals(console.serverThread) || this.console.hasStopped() || !org.spigotmc.AsyncCatcher.enabled; // All bets are off if we have shut down (e.g. due to watchdog) } @@ -1956,7 +2674,7 @@ index a850bb8a4268c0210ee7af98f51131759ff95f30..837fb51698e6650c6df720f798b71963 @Override public String getMotd() { return this.console.getMotd(); -@@ -2350,4 +2402,15 @@ public final class CraftServer implements Server { +@@ -2357,4 +2409,15 @@ public final class CraftServer implements Server { return this.spigot; } // Spigot end @@ -2004,7 +2722,7 @@ index 93308369f0bbd1e95569d9d573b8b6f42c8ae5a7..cf7762e76a2d35acdfc12627e9750fbe + // Paper end } diff --git a/src/main/java/org/bukkit/craftbukkit/Main.java b/src/main/java/org/bukkit/craftbukkit/Main.java -index b05cea49219c6582bacc705f41e72ca7c7eb6a8c..c520e8e53356188ee00dc10a6a74c88b5e2f6e94 100644 +index e8d71985f2e96574081e4f609d62a3b8bded8249..681b58e6de48cccac82c7b6833f6fcea46d83dde 100644 --- a/src/main/java/org/bukkit/craftbukkit/Main.java +++ b/src/main/java/org/bukkit/craftbukkit/Main.java @@ -19,6 +19,12 @@ public class Main { @@ -2486,7 +3204,7 @@ index 446fdca49a5a6999626a7ee3a1d5c168b15a09dd..f9863e138994f6c7a7975a852f106faa public boolean isOp() { return true; diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -index cadafdfd3469b6f813f5e0add116640313fb6209..ac6fd14f18f2fa2247db4d2d8c9233f862b85111 100644 +index e9036bbb2ec2862252c3a39a4022e195784291ca..ef5e29e0a66f8d4cb819c4383cf3f1317d4e5bb0 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java @@ -269,14 +269,39 @@ public class CraftPlayer extends CraftHumanEntity implements Player { @@ -3512,11 +4230,24 @@ index 1980240d3dc0331ddf2ff56e163e2bfbd3b231ab..7a7f3f53aef601f124d474d9890e23d8 @Override public Inventory createInventory(InventoryHolder holder, InventoryType type, String title) { // BrewingStand does not extend TileEntityLootable +diff --git a/src/main/java/org/bukkit/craftbukkit/map/CraftMapRenderer.java b/src/main/java/org/bukkit/craftbukkit/map/CraftMapRenderer.java +index b47f18b1e448807a17ca9f2ae9609680233da837..9683d7d103af66fffd68c11abc38fb4fd2f99482 100644 +--- a/src/main/java/org/bukkit/craftbukkit/map/CraftMapRenderer.java ++++ b/src/main/java/org/bukkit/craftbukkit/map/CraftMapRenderer.java +@@ -42,7 +42,7 @@ public class CraftMapRenderer extends MapRenderer { + } + + MapDecoration decoration = worldMap.decorations.get(key); +- cursors.addCursor(decoration.getX(), decoration.getY(), (byte) (decoration.getRot() & 15), decoration.getType().getIcon(), true, CraftChatMessage.fromComponent(decoration.getName())); ++ cursors.addCursor(decoration.getX(), decoration.getY(), (byte) (decoration.getRot() & 15), decoration.getType().getIcon(), true, decoration.getName() == null ? null : io.papermc.paper.adventure.PaperAdventure.asAdventure(decoration.getName())); // Paper + } + } + diff --git a/src/main/java/org/bukkit/craftbukkit/scoreboard/CraftObjective.java b/src/main/java/org/bukkit/craftbukkit/scoreboard/CraftObjective.java -index e9bb0728ae5c16aad4acc106d332db5095db4033..6752cd9b3bc246fc2a7764df0d2b40d3e638fa62 100644 +index 0d25c7c03f7ac21a4b21bb95b5bd921c43430cf9..b7f0277b50a0f45c32b818bf9fe1218874aa8533 100644 --- a/src/main/java/org/bukkit/craftbukkit/scoreboard/CraftObjective.java +++ b/src/main/java/org/bukkit/craftbukkit/scoreboard/CraftObjective.java -@@ -30,6 +30,21 @@ final class CraftObjective extends CraftScoreboardComponent implements Objective +@@ -31,6 +31,21 @@ final class CraftObjective extends CraftScoreboardComponent implements Objective return this.objective.getName(); } @@ -3539,20 +4270,28 @@ index e9bb0728ae5c16aad4acc106d332db5095db4033..6752cd9b3bc246fc2a7764df0d2b40d3 public String getDisplayName() throws IllegalStateException { CraftScoreboard scoreboard = this.checkState(); diff --git a/src/main/java/org/bukkit/craftbukkit/scoreboard/CraftScoreboard.java b/src/main/java/org/bukkit/craftbukkit/scoreboard/CraftScoreboard.java -index afc059755ae3e7b1c0a4cf3c6b8f32ce13cc458d..9130c478b80fc50ef1fc4e27b1afa51e3f97d618 100644 +index c624867e28dd5187d58a6bcb9067b0c10ff7e733..f367261b119ab48c1d17b2b6552cce481c6effbb 100644 --- a/src/main/java/org/bukkit/craftbukkit/scoreboard/CraftScoreboard.java +++ b/src/main/java/org/bukkit/craftbukkit/scoreboard/CraftScoreboard.java -@@ -27,6 +27,27 @@ public final class CraftScoreboard implements org.bukkit.scoreboard.Scoreboard { +@@ -28,6 +28,34 @@ public final class CraftScoreboard implements org.bukkit.scoreboard.Scoreboard { public CraftObjective registerNewObjective(String name, String criteria) throws IllegalArgumentException { return this.registerNewObjective(name, criteria, name); } + // Paper start + @Override + public CraftObjective registerNewObjective(String name, String criteria, net.kyori.adventure.text.Component displayName) { -+ return registerNewObjective(name, criteria, displayName, org.bukkit.scoreboard.RenderType.INTEGER); ++ return registerNewObjective(name, CraftCriteria.getFromBukkit(criteria), displayName, RenderType.INTEGER); + } + @Override + public CraftObjective registerNewObjective(String name, String criteria, net.kyori.adventure.text.Component displayName, RenderType renderType) { ++ return registerNewObjective(name, CraftCriteria.getFromBukkit(criteria), displayName, renderType); ++ } ++ @Override ++ public CraftObjective registerNewObjective(String name, Criteria criteria, net.kyori.adventure.text.Component displayName) throws IllegalArgumentException { ++ return registerNewObjective(name, criteria, displayName, RenderType.INTEGER); ++ } ++ @Override ++ public CraftObjective registerNewObjective(String name, Criteria criteria, net.kyori.adventure.text.Component displayName, RenderType renderType) throws IllegalArgumentException { + if (displayName == null) { + displayName = net.kyori.adventure.text.Component.empty(); + } @@ -3562,32 +4301,27 @@ index afc059755ae3e7b1c0a4cf3c6b8f32ce13cc458d..9130c478b80fc50ef1fc4e27b1afa51e + Validate.notNull(renderType, "RenderType cannot be null"); + Validate.isTrue(name.length() <= Short.MAX_VALUE, "The name '" + name + "' is longer than the limit of 32767 characters"); + Validate.isTrue(board.getObjective(name) == null, "An objective of name '" + name + "' already exists"); -+ CraftCriteria craftCriteria = CraftCriteria.getFromBukkit(criteria); -+ net.minecraft.world.scores.Objective objective = board.addObjective(name, craftCriteria.criteria, io.papermc.paper.adventure.PaperAdventure.asVanilla(displayName), CraftScoreboardTranslations.fromBukkitRender(renderType)); ++ net.minecraft.world.scores.Objective objective = board.addObjective(name, ((CraftCriteria) criteria).criteria, io.papermc.paper.adventure.PaperAdventure.asVanilla(displayName), CraftScoreboardTranslations.fromBukkitRender(renderType)); + return new CraftObjective(this, objective); + } + // Paper end @Override public CraftObjective registerNewObjective(String name, String criteria, String displayName) throws IllegalArgumentException { -@@ -35,7 +56,7 @@ public final class CraftScoreboard implements org.bukkit.scoreboard.Scoreboard { +@@ -46,16 +74,7 @@ public final class CraftScoreboard implements org.bukkit.scoreboard.Scoreboard { @Override - public CraftObjective registerNewObjective(String name, String criteria, String displayName, RenderType renderType) throws IllegalArgumentException { + public CraftObjective registerNewObjective(String name, Criteria criteria, String displayName, RenderType renderType) throws IllegalArgumentException { - Validate.notNull(name, "Objective name cannot be null"); -+ /*Validate.notNull(name, "Objective name cannot be null"); // Paper - Validate.notNull(criteria, "Criteria cannot be null"); - Validate.notNull(displayName, "Display name cannot be null"); - Validate.notNull(renderType, "RenderType cannot be null"); -@@ -45,7 +66,11 @@ public final class CraftScoreboard implements org.bukkit.scoreboard.Scoreboard { - - CraftCriteria craftCriteria = CraftCriteria.getFromBukkit(criteria); - net.minecraft.world.scores.Objective objective = this.board.addObjective(name, craftCriteria.criteria, CraftChatMessage.fromStringOrNull(displayName), CraftScoreboardTranslations.fromBukkitRender(renderType)); +- Validate.notNull(criteria, "Criteria cannot be null"); +- Validate.notNull(displayName, "Display name cannot be null"); +- Validate.notNull(renderType, "RenderType cannot be null"); +- Validate.isTrue(name.length() <= Short.MAX_VALUE, "The name '" + name + "' is longer than the limit of 32767 characters"); +- Validate.isTrue(displayName.length() <= 128, "The display name '" + displayName + "' is longer than the limit of 128 characters"); +- Validate.isTrue(this.board.getObjective(name) == null, "An objective of name '" + name + "' already exists"); +- +- net.minecraft.world.scores.Objective objective = this.board.addObjective(name, ((CraftCriteria) criteria).criteria, CraftChatMessage.fromStringOrNull(displayName), CraftScoreboardTranslations.fromBukkitRender(renderType)); - return new CraftObjective(this, objective); -+ -+ CraftCriteria craftCriteria = CraftCriteria.getFromBukkit(criteria); -+ ScoreboardObjective objective = board.registerObjective(name, craftCriteria.criteria, CraftChatMessage.fromStringOrNull(displayName), CraftScoreboardTranslations.fromBukkitRender(renderType)); -+ return new CraftObjective(this, objective);*/ // Paper + return registerNewObjective(name, criteria, net.kyori.adventure.text.serializer.legacy.LegacyComponentSerializer.legacySection().deserialize(displayName), renderType); // Paper } @@ -3673,7 +4407,7 @@ index 78ea79b66cc9e90402ef5cdc2e5e04e0c74b1c26..4fede2161792ba3e7cdf0cc5a1f53318 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 -index 8c5165c449f740e51aad3f41405aaad1cfe5c657..a9a900f09b95d84b53adbe0405c322d36b6edad1 100644 +index d805ac4274fb6149bf8efea6b771ecfe79aea76f..56a3dc9dcbd2229c60aa64e2d4c0ed147539a5ef 100644 --- a/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 { diff --git a/patches/server/0009-Paper-command.patch b/patches/server/0009-Paper-command.patch index 82aa9db917..7a3a1c2956 100644 --- a/patches/server/0009-Paper-command.patch +++ b/patches/server/0009-Paper-command.patch @@ -559,10 +559,10 @@ index 08ae7a96e93c0d8547f560b3f753804525621c6b..8f29bb843fc456384f7b4e216afca501 this.setPvpAllowed(dedicatedserverproperties.pvp); diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -index 837fb51698e6650c6df720f798b7196322b6e7bb..80333fe069e417ef692cb7b80292ed42d6e820a1 100644 +index e4f8ccb45a16c35b5256e209435840609d527695..82199864f2046528358af08d4aa4a283fa3e7ffd 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -@@ -894,6 +894,7 @@ public final class CraftServer implements Server { +@@ -896,6 +896,7 @@ public final class CraftServer implements Server { this.commandMap.clearCommands(); this.reloadData(); org.spigotmc.SpigotConfig.registerCommands(); // Spigot @@ -570,7 +570,7 @@ index 837fb51698e6650c6df720f798b7196322b6e7bb..80333fe069e417ef692cb7b80292ed42 this.overrideAllCommandBlockCommands = this.commandsConfiguration.getStringList("command-block-overrides").contains("*"); this.ignoreVanillaPermissions = this.commandsConfiguration.getBoolean("ignore-vanilla-permissions"); -@@ -2404,6 +2405,34 @@ public final class CraftServer implements Server { +@@ -2411,6 +2412,34 @@ public final class CraftServer implements Server { // Spigot end // Paper start diff --git a/patches/server/0010-Not-implemeneted.patch b/patches/server/0010-Not-implemeneted.patch index 8820930234..55e55d31d4 100644 --- a/patches/server/0010-Not-implemeneted.patch +++ b/patches/server/0010-Not-implemeneted.patch @@ -7,14 +7,16 @@ Currently a placeholder patch. diff --git a/src/main/java/io/papermc/paper/util/TickThread.java b/src/main/java/io/papermc/paper/util/TickThread.java new file mode 100644 -index 0000000000000000000000000000000000000000..c92f7e59f490f7b289325d9cc2bf7c2cf1750c7a +index 0000000000000000000000000000000000000000..be130b03ca116fd6d104df26c32312db1655b09e --- /dev/null +++ b/src/main/java/io/papermc/paper/util/TickThread.java -@@ -0,0 +1,41 @@ +@@ -0,0 +1,78 @@ +package io.papermc.paper.util; + +import net.minecraft.server.MinecraftServer; ++import net.minecraft.world.entity.Entity; +import org.bukkit.Bukkit; ++import java.util.concurrent.atomic.AtomicInteger; + +public final class TickThread extends Thread { + @@ -33,9 +35,22 @@ index 0000000000000000000000000000000000000000..c92f7e59f490f7b289325d9cc2bf7c2c + ensureTickThread(reason); + } + -+ + public static void ensureTickThread(final String reason) { -+ if (!Bukkit.isPrimaryThread()) { ++ if (!isTickThread()) { ++ MinecraftServer.LOGGER.error("Thread " + Thread.currentThread().getName() + " failed main thread check: " + reason, new Throwable()); ++ throw new IllegalStateException(reason); ++ } ++ } ++ ++ public static void ensureTickThread(final int chunkX, final int chunkZ, final String reason) { ++ if (!isTickThreadFor(chunkX, chunkZ)) { ++ MinecraftServer.LOGGER.error("Thread " + Thread.currentThread().getName() + " failed main thread check: " + reason, new Throwable()); ++ throw new IllegalStateException(reason); ++ } ++ } ++ ++ public static void ensureTickThread(final Entity entity, final String reason) { ++ if (!isTickThreadFor(entity.chunkPosition().x, entity.chunkPosition().z)) { + MinecraftServer.LOGGER.error("Thread " + Thread.currentThread().getName() + " failed main thread check: " + reason, new Throwable()); + throw new IllegalStateException(reason); + } @@ -43,7 +58,17 @@ index 0000000000000000000000000000000000000000..c92f7e59f490f7b289325d9cc2bf7c2c + + public final int id; /* We don't override getId as the spec requires that it be unique (with respect to all other threads) */ + -+ public TickThread(final Runnable run, final String name, final int id) { ++ private static final AtomicInteger ID_GENERATOR = new AtomicInteger(); ++ ++ public TickThread(final String name) { ++ this(null, name); ++ } ++ ++ public TickThread(final Runnable run, final String name) { ++ this(run, name, ID_GENERATOR.incrementAndGet()); ++ } ++ ++ private TickThread(final Runnable run, final String name, final int id) { + super(run, name); + this.id = id; + } @@ -51,6 +76,18 @@ index 0000000000000000000000000000000000000000..c92f7e59f490f7b289325d9cc2bf7c2c + public static TickThread getCurrentTickThread() { + return (TickThread)Thread.currentThread(); + } ++ ++ public static boolean isTickThread() { ++ return Bukkit.isPrimaryThread(); ++ } ++ ++ public static boolean isTickThreadFor(final int chunkX, final int chunkZ) { ++ return Bukkit.isPrimaryThread(); ++ } ++ ++ public static boolean isTickThreadFor(final Entity entity) { ++ return Bukkit.isPrimaryThread(); ++ } +} diff --git a/src/main/java/org/spigotmc/AsyncCatcher.java b/src/main/java/org/spigotmc/AsyncCatcher.java index bbf0d9d9c44fe8d7add2f978994ec129420814c7..78669fa035b7537ff7e533cf32aaf2995625424f 100644 diff --git a/patches/server/0012-Timings-v2.patch b/patches/server/0012-Timings-v2.patch index 958cbe6c77..df9edbac22 100644 --- a/patches/server/0012-Timings-v2.patch +++ b/patches/server/0012-Timings-v2.patch @@ -729,7 +729,7 @@ index 13421daa96b4ba302581f36abcd730952713d8cd..049e64c355d5f064009b1107ad15d28c } catch (Exception exception) { if (listener.shouldPropagateHandlingExceptions()) { diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index acc5ce86ae8aa5ada21e6c97f7921caca4b0bd00..35df8fb2d2818df21fe3bd8832d9d81ce3a66233 100644 +index e4220f14a5ebf43dd3491fc8649c2be5238c5798..53be6189d3fa6a65a09996683913fbbf5133dcb7 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java @@ -177,7 +177,7 @@ import org.bukkit.event.player.AsyncPlayerChatPreviewEvent; @@ -1146,7 +1146,7 @@ index 186a8f5895fedbaf27a7949d9bdbb1a9f2e36fbf..86acdd910eebb8beac4536942119c9e9 } diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java -index 95c3273d2379509cf6cd51a718f18b8697908932..1d4d60fa861b5e819c59f06168a096688d06e656 100644 +index a60af68365b4cb0e09061e1956d2ae6790659bc0..28669f2e9c4a49322fe44c730b2ed145c9c61273 100644 --- a/src/main/java/net/minecraft/server/level/ServerLevel.java +++ b/src/main/java/net/minecraft/server/level/ServerLevel.java @@ -1,6 +1,8 @@ @@ -1262,10 +1262,10 @@ index 95c3273d2379509cf6cd51a718f18b8697908932..1d4d60fa861b5e819c59f06168a09668 this.entityManager.saveAll(); } else { diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -index 59932a4f83461280ab3c097add951e5a138eb53d..4bdb7b50315c68a3f3c929745bf090f5c7a51c52 100644 +index a258c965a4a0352f9d77def6748b176f3bdab106..cdc24defe649644ceade1c6cfcfe20c29ca936c1 100644 --- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -@@ -339,7 +339,6 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic +@@ -342,7 +342,6 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic @Override public void tick() { @@ -1273,7 +1273,7 @@ index 59932a4f83461280ab3c097add951e5a138eb53d..4bdb7b50315c68a3f3c929745bf090f5 if (this.ackBlockChangesUpTo > -1) { this.send(new ClientboundBlockChangedAckPacket(this.ackBlockChangesUpTo)); this.ackBlockChangesUpTo = -1; -@@ -420,7 +419,6 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic +@@ -423,7 +422,6 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic this.player.resetLastActionTime(); // CraftBukkit - SPIGOT-854 this.disconnect(Component.translatable("multiplayer.disconnect.idling")); } @@ -1281,7 +1281,7 @@ index 59932a4f83461280ab3c097add951e5a138eb53d..4bdb7b50315c68a3f3c929745bf090f5 this.chatPreviewThrottler.tick(); } -@@ -2146,7 +2144,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic +@@ -2149,7 +2147,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic } private void handleCommand(String s) { @@ -1290,7 +1290,7 @@ index 59932a4f83461280ab3c097add951e5a138eb53d..4bdb7b50315c68a3f3c929745bf090f5 if ( org.spigotmc.SpigotConfig.logCommands ) // Spigot this.LOGGER.info(this.player.getScoreboardName() + " issued server command: " + s); -@@ -2156,7 +2154,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic +@@ -2159,7 +2157,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic this.cserver.getPluginManager().callEvent(event); if (event.isCancelled()) { @@ -1299,7 +1299,7 @@ index 59932a4f83461280ab3c097add951e5a138eb53d..4bdb7b50315c68a3f3c929745bf090f5 return; } -@@ -2169,7 +2167,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic +@@ -2172,7 +2170,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic java.util.logging.Logger.getLogger(ServerGamePacketListenerImpl.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); return; } finally { @@ -1309,7 +1309,7 @@ index 59932a4f83461280ab3c097add951e5a138eb53d..4bdb7b50315c68a3f3c929745bf090f5 } // CraftBukkit end diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java -index 946b2b7341a10c25fae71d76f7b181b555fe38b6..e3e9758827e741a9140c650dafa411144f26e672 100644 +index 521f485366c65527ac3289dd27d8f2e311706a10..5833cc3d5014dad82607afc4d643b6bed885be64 100644 --- a/src/main/java/net/minecraft/server/players/PlayerList.java +++ b/src/main/java/net/minecraft/server/players/PlayerList.java @@ -1,5 +1,6 @@ @@ -1634,10 +1634,10 @@ index 98ba88896c73651591b8ad8e070868fb443ae999..864e2e0355a5fb8c1d4a5b0896ba299f }; } diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -index 80333fe069e417ef692cb7b80292ed42d6e820a1..7b645fd1bb170a09f56a827048f5d8816254df2f 100644 +index 295318717fc603b3adc58fbda39bd65e97462b88..eb5c7e15366ee5902d8c754a1e9daec50d26fb17 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -@@ -2372,12 +2372,31 @@ public final class CraftServer implements Server { +@@ -2379,12 +2379,31 @@ public final class CraftServer implements Server { private final org.bukkit.Server.Spigot spigot = new org.bukkit.Server.Spigot() { @@ -1839,7 +1839,7 @@ index b0ffa23faf62629043dfd613315eaf9c5fcc2cfe..00000000000000000000000000000000 - } -} diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -index 3fe120364ac61d40d6d8b16339e3086a3c0ac512..7a95748f52ef064af3173deedc229ec0b5f65cac 100644 +index ef5e29e0a66f8d4cb819c4383cf3f1317d4e5bb0..a2dd86fde8882c774ad44be3ca66f7c80bb77389 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java @@ -2275,6 +2275,14 @@ public class CraftPlayer extends CraftHumanEntity implements Player { @@ -2035,7 +2035,7 @@ index e52ef47b783785dc214746b678e7b549aea9a274..3d90b3426873a3528af14f7f1ab0adae this.value = value; } diff --git a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java -index a9a900f09b95d84b53adbe0405c322d36b6edad1..4f1945f854f4a022184ca4756b59d08b01693d6b 100644 +index 56a3dc9dcbd2229c60aa64e2d4c0ed147539a5ef..e309a589e6ce76294187c906820a88367da25305 100644 --- a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java +++ b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java @@ -217,6 +217,12 @@ public final class CraftMagicNumbers implements UnsafeValues { diff --git a/patches/server/0013-Add-command-line-option-to-load-extra-plugin-jars-no.patch b/patches/server/0013-Add-command-line-option-to-load-extra-plugin-jars-no.patch index 8c0dfd9cbd..f7a089ab62 100644 --- a/patches/server/0013-Add-command-line-option-to-load-extra-plugin-jars-no.patch +++ b/patches/server/0013-Add-command-line-option-to-load-extra-plugin-jars-no.patch @@ -7,10 +7,10 @@ Subject: [PATCH] Add command line option to load extra plugin jars not in the ex: java -jar paperclip.jar nogui -add-plugin=/path/to/plugin.jar -add-plugin=/path/to/another/plugin_jar.jar diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -index 7b645fd1bb170a09f56a827048f5d8816254df2f..a9d9bc91b150597275d9b15f21dc00b49c5e3b28 100644 +index 5badb27d2060b0b13c54f8945848afbeb775fc6c..45c51529c9f94dfbd575ca94acd3c025bdb909e9 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -@@ -403,10 +403,15 @@ public final class CraftServer implements Server { +@@ -405,10 +405,15 @@ public final class CraftServer implements Server { public void loadPlugins() { this.pluginManager.registerInterface(JavaPluginLoader.class); @@ -29,7 +29,7 @@ index 7b645fd1bb170a09f56a827048f5d8816254df2f..a9d9bc91b150597275d9b15f21dc00b4 for (Plugin plugin : plugins) { try { String message = String.format("Loading %s", plugin.getDescription().getFullName()); -@@ -421,6 +426,35 @@ public final class CraftServer implements Server { +@@ -423,6 +428,35 @@ public final class CraftServer implements Server { } } @@ -66,7 +66,7 @@ index 7b645fd1bb170a09f56a827048f5d8816254df2f..a9d9bc91b150597275d9b15f21dc00b4 if (type == PluginLoadOrder.STARTUP) { this.helpMap.clear(); diff --git a/src/main/java/org/bukkit/craftbukkit/Main.java b/src/main/java/org/bukkit/craftbukkit/Main.java -index c520e8e53356188ee00dc10a6a74c88b5e2f6e94..155087d30e826205088ad9d449b33d4b29dca716 100644 +index 681b58e6de48cccac82c7b6833f6fcea46d83dde..f64a690ed3173f78ed60b0262c0c868d97a803d5 100644 --- a/src/main/java/org/bukkit/craftbukkit/Main.java +++ b/src/main/java/org/bukkit/craftbukkit/Main.java @@ -147,6 +147,12 @@ public class Main { diff --git a/patches/server/0021-Show-Paper-in-client-crashes-server-lists-and-Mojang.patch b/patches/server/0021-Show-Paper-in-client-crashes-server-lists-and-Mojang.patch index b24c0768f4..15e19a0a94 100644 --- a/patches/server/0021-Show-Paper-in-client-crashes-server-lists-and-Mojang.patch +++ b/patches/server/0021-Show-Paper-in-client-crashes-server-lists-and-Mojang.patch @@ -6,10 +6,10 @@ Subject: [PATCH] Show 'Paper' in client crashes, server lists, and Mojang diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index 35df8fb2d2818df21fe3bd8832d9d81ce3a66233..c7660c2c9c5e1fb166ba6a3216f14e5fa934528d 100644 +index 53be6189d3fa6a65a09996683913fbbf5133dcb7..e6acf596c2c62134e8d2e499d273aa326f792451 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java -@@ -1416,7 +1416,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -index 4bdb7b50315c68a3f3c929745bf090f5c7a51c52..6ce257fca3a3645fdb68f877279bcae343dbd548 100644 +index cdc24defe649644ceade1c6cfcfe20c29ca936c1..4fe65f979e8c3c15aea2211035745a71aef0feeb 100644 --- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -@@ -2023,7 +2023,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic +@@ -2026,7 +2026,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic return true; } @@ -33,7 +33,7 @@ index 4bdb7b50315c68a3f3c929745bf090f5c7a51c52..6ce257fca3a3645fdb68f877279bcae3 for (int i = 0; i < message.length(); ++i) { if (!SharedConstants.isAllowedChatCharacter(message.charAt(i))) { return true; -@@ -2040,7 +2040,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic +@@ -2043,7 +2043,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic } OutgoingPlayerChatMessage outgoing = OutgoingPlayerChatMessage.create(original); @@ -42,7 +42,7 @@ index 4bdb7b50315c68a3f3c929745bf090f5c7a51c52..6ce257fca3a3645fdb68f877279bcae3 this.handleCommand(s); } else if (this.player.getChatVisibility() == ChatVisiblity.SYSTEM) { // Do nothing, this is coming from a plugin -@@ -2143,7 +2143,29 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic +@@ -2146,7 +2146,29 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic } } @@ -74,10 +74,10 @@ index 4bdb7b50315c68a3f3c929745bf090f5c7a51c52..6ce257fca3a3645fdb68f877279bcae3 if ( org.spigotmc.SpigotConfig.logCommands ) // Spigot this.LOGGER.info(this.player.getScoreboardName() + " issued server command: " + s); diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -index 415393e965c7253412ec4d893c3e62ad14dd69f2..846c5144fefd1dfd1bbd8e6f82bd9248be34ad1a 100644 +index 56efe95512c851b965f2295d5eac7bc0c67bdb1f..1c6577bbbc005131661cbb4667cff6494b8fe5e4 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -@@ -861,6 +861,28 @@ public final class CraftServer implements Server { +@@ -863,6 +863,28 @@ public final class CraftServer implements Server { Validate.notNull(commandLine, "CommandLine cannot be null"); org.spigotmc.AsyncCatcher.catchOp("command dispatch"); // Spigot @@ -107,7 +107,7 @@ index 415393e965c7253412ec4d893c3e62ad14dd69f2..846c5144fefd1dfd1bbd8e6f82bd9248 return true; } diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -index 82a640887a75c360539c1787dbbb32750f6b1379..69d2a0422f1066f7f52e7c81fa6c99019bb6dbfc 100644 +index 82a640887a75c360539c1787dbbb32750f6b1379..2666e55d72fd7731a2bde42d690762a2747dac90 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java @@ -461,7 +461,19 @@ public class CraftPlayer extends CraftHumanEntity implements Player { @@ -124,7 +124,7 @@ index 82a640887a75c360539c1787dbbb32750f6b1379..69d2a0422f1066f7f52e7c81fa6c9901 + } else { + // TODO text filtering + // TODO chat decorating -+ this.getHandle().connection.chat(msg, PlayerChatMessage.unsigned(net.minecraft.network.chat.MessageSigner.create(this.getUniqueId()), new net.minecraft.network.chat.ChatMessageContent(msg)), false); ++ this.getHandle().connection.chat(msg, PlayerChatMessage.system(new net.minecraft.network.chat.ChatMessageContent(msg)), false); + } + } + // Paper en diff --git a/patches/server/0049-Expose-server-CommandMap.patch b/patches/server/0049-Expose-server-CommandMap.patch index ef044311a1..1eb15fa1c0 100644 --- a/patches/server/0049-Expose-server-CommandMap.patch +++ b/patches/server/0049-Expose-server-CommandMap.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Expose server CommandMap diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -index 846c5144fefd1dfd1bbd8e6f82bd9248be34ad1a..3c1f2bcaedba7ec59d1a865ca8b5615a5c6d3d52 100644 +index b61a98f2711c8aeca65e6e782c07ace05c56fbe8..4c0f321128271f77a54b1ed814033cdd8a712350 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -@@ -1981,6 +1981,7 @@ public final class CraftServer implements Server { +@@ -1983,6 +1983,7 @@ public final class CraftServer implements Server { return this.helpMap; } diff --git a/patches/server/0054-Add-velocity-warnings.patch b/patches/server/0054-Add-velocity-warnings.patch index 7ec4434dab..649ff7887d 100644 --- a/patches/server/0054-Add-velocity-warnings.patch +++ b/patches/server/0054-Add-velocity-warnings.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Add velocity warnings diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -index 3c1f2bcaedba7ec59d1a865ca8b5615a5c6d3d52..3dc04ad966c9f44f62af918c50ff1e8ed461fe3b 100644 +index 4c0f321128271f77a54b1ed814033cdd8a712350..fe4bf2bdd43d4d85c62d3939305dbecc1ae01eb9 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -@@ -278,6 +278,7 @@ public final class CraftServer implements Server { +@@ -280,6 +280,7 @@ public final class CraftServer implements Server { public boolean ignoreVanillaPermissions = false; private final List playerView; public int reloadCount; diff --git a/patches/server/0061-Complete-resource-pack-API.patch b/patches/server/0061-Complete-resource-pack-API.patch index a11e070cd2..d92f972605 100644 --- a/patches/server/0061-Complete-resource-pack-API.patch +++ b/patches/server/0061-Complete-resource-pack-API.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Complete resource pack API diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -index 6ce257fca3a3645fdb68f877279bcae343dbd548..2e9aa7bcdaf86165190d16098d7f6363bfa2f837 100644 +index 4fe65f979e8c3c15aea2211035745a71aef0feeb..bcd95c61ba98604552c3269e974e27b88658f38e 100644 --- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -@@ -1753,8 +1753,11 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic +@@ -1756,8 +1756,11 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic ServerGamePacketListenerImpl.LOGGER.info("Disconnecting {} due to resource pack rejection", this.player.getName()); this.disconnect(Component.translatable("multiplayer.requiredTexturePrompt.disconnect")); } @@ -23,7 +23,7 @@ index 6ce257fca3a3645fdb68f877279bcae343dbd548..2e9aa7bcdaf86165190d16098d7f6363 @Override diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -index 3794d05b17378ebf517199adbbfd54a395ef6b37..b85ca8bded5157adad810b9a50ca0fe377597c93 100644 +index d91f69639724aeeb4264f86cf8f76edc22567649..6ae934c6c7c50dd38ff2e762fddfe650e97aa4ae 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java @@ -144,6 +144,7 @@ import org.bukkit.plugin.Plugin; diff --git a/patches/server/0062-Default-loading-permissions.yml-before-plugins.patch b/patches/server/0062-Default-loading-permissions.yml-before-plugins.patch index cd39cadade..2492bada58 100644 --- a/patches/server/0062-Default-loading-permissions.yml-before-plugins.patch +++ b/patches/server/0062-Default-loading-permissions.yml-before-plugins.patch @@ -16,10 +16,10 @@ modify that. Under the previous logic, plugins were unable (cleanly) override pe A config option has been added for those who depend on the previous behavior, but I don't expect that. diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -index 3dc04ad966c9f44f62af918c50ff1e8ed461fe3b..9f9d2c32d184a9ef7f2fbdef85129654b43cf3ab 100644 +index fe4bf2bdd43d4d85c62d3939305dbecc1ae01eb9..63eabacf2743d14bb02147869e51491e392b96bf 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -@@ -460,6 +460,7 @@ public final class CraftServer implements Server { +@@ -462,6 +462,7 @@ public final class CraftServer implements Server { if (type == PluginLoadOrder.STARTUP) { this.helpMap.clear(); this.helpMap.initializeGeneralTopics(); @@ -27,7 +27,7 @@ index 3dc04ad966c9f44f62af918c50ff1e8ed461fe3b..9f9d2c32d184a9ef7f2fbdef85129654 } Plugin[] plugins = this.pluginManager.getPlugins(); -@@ -479,7 +480,7 @@ public final class CraftServer implements Server { +@@ -481,7 +482,7 @@ public final class CraftServer implements Server { this.commandMap.registerServerAliases(); DefaultPermissions.registerCorePermissions(); CraftDefaultPermissions.registerCorePermissions(); diff --git a/patches/server/0063-Allow-Reloading-of-Custom-Permissions.patch b/patches/server/0063-Allow-Reloading-of-Custom-Permissions.patch index 248ca2704d..88c1b9b95a 100644 --- a/patches/server/0063-Allow-Reloading-of-Custom-Permissions.patch +++ b/patches/server/0063-Allow-Reloading-of-Custom-Permissions.patch @@ -6,10 +6,10 @@ Subject: [PATCH] Allow Reloading of Custom Permissions https://github.com/PaperMC/Paper/issues/49 diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -index 9f9d2c32d184a9ef7f2fbdef85129654b43cf3ab..bb90cb49fc2b4bb4034d43d16eee61643773ecfa 100644 +index 63eabacf2743d14bb02147869e51491e392b96bf..858707ce778fad5bbdcc31e61de57dbfed2f94b4 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -@@ -2530,5 +2530,23 @@ public final class CraftServer implements Server { +@@ -2537,5 +2537,23 @@ public final class CraftServer implements Server { } return this.adventure$audiences; } diff --git a/patches/server/0064-Remove-Metadata-on-reload.patch b/patches/server/0064-Remove-Metadata-on-reload.patch index 4a9ce42f3b..dce360d5ec 100644 --- a/patches/server/0064-Remove-Metadata-on-reload.patch +++ b/patches/server/0064-Remove-Metadata-on-reload.patch @@ -7,10 +7,10 @@ Metadata is not meant to persist reload as things break badly with non primitive This will remove metadata on reload so it does not crash everything if a plugin uses it. diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -index bb90cb49fc2b4bb4034d43d16eee61643773ecfa..aa6a40eae3a3897ab3cca93921635e4e3e37db9f 100644 +index 858707ce778fad5bbdcc31e61de57dbfed2f94b4..460d95ece9a9ba053a50d5a1cf69ac3bc85131a3 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -@@ -948,8 +948,16 @@ public final class CraftServer implements Server { +@@ -950,8 +950,16 @@ public final class CraftServer implements Server { world.spigotConfig.init(); // Spigot } diff --git a/patches/server/0079-Add-PlayerUseUnknownEntityEvent.patch b/patches/server/0079-Add-PlayerUseUnknownEntityEvent.patch index 6e717ab751..63947ccb44 100644 --- a/patches/server/0079-Add-PlayerUseUnknownEntityEvent.patch +++ b/patches/server/0079-Add-PlayerUseUnknownEntityEvent.patch @@ -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 bcd95c61ba98604552c3269e974e27b88658f38e..33237c6a9f8885abdd5379d17be2b71ad7c2204e 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 +@@ -2635,8 +2635,37 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic }); } } diff --git a/patches/server/0083-Option-to-use-vanilla-per-world-scoreboard-coloring-.patch b/patches/server/0083-Option-to-use-vanilla-per-world-scoreboard-coloring-.patch index 4b02783b1c..7ef4294205 100644 --- a/patches/server/0083-Option-to-use-vanilla-per-world-scoreboard-coloring-.patch +++ b/patches/server/0083-Option-to-use-vanilla-per-world-scoreboard-coloring-.patch @@ -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 12ea885e815b6814a74ac3aa9d9c325e53721ecd..28ddab1121e314e82bf764fd89f36714bd7445f8 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 { +@@ -332,10 +334,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(); + } diff --git a/patches/server/0089-remove-null-possibility-for-getServer-singleton.patch b/patches/server/0089-remove-null-possibility-for-getServer-singleton.patch index 071d34adab..d043453096 100644 --- a/patches/server/0089-remove-null-possibility-for-getServer-singleton.patch +++ b/patches/server/0089-remove-null-possibility-for-getServer-singleton.patch @@ -6,7 +6,7 @@ Subject: [PATCH] remove null possibility for getServer singleton to stop IDE complaining about potential NPE diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index 0dffb6e8d6f4edfb4dfaa6b24e81d72356446ebc..b3834c86eb79400c8cef60daa03c90a66b03b688 100644 +index a6c184d450e08737e0053f7526de2ab6e20c454b..c667f8b115ad77ca3d3f908d69915d60d950ffe5 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java @@ -181,6 +181,7 @@ import co.aikar.timings.MinecraftTimings; // Paper @@ -25,7 +25,7 @@ index 0dffb6e8d6f4edfb4dfaa6b24e81d72356446ebc..b3834c86eb79400c8cef60daa03c90a6 this.metricsRecorder = InactiveMetricsRecorder.INSTANCE; this.profiler = this.metricsRecorder.getProfiler(); this.onMetricsRecordingStopped = (methodprofilerresults) -> { -@@ -2281,9 +2283,8 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop 80) { ServerGamePacketListenerImpl.LOGGER.warn("{} was kicked for floating too long!", this.player.getName().getString()); @@ -17,7 +17,7 @@ index d3d141d18d9e66bc04e4c1af38b44bdd41e8d416..aea8d2376e88a327985f7f5d34e355cd return; } } else { -@@ -374,7 +374,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic +@@ -377,7 +377,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic if (this.clientVehicleIsFloating && this.player.getRootVehicle().getControllingPassenger() == this.player) { if (++this.aboveGroundVehicleTickCount > 80) { ServerGamePacketListenerImpl.LOGGER.warn("{} was kicked for floating a vehicle too long!", this.player.getName().getString()); diff --git a/patches/server/0108-Cache-user-authenticator-threads.patch b/patches/server/0108-Cache-user-authenticator-threads.patch index fe8c25f931..971fc83aa8 100644 --- a/patches/server/0108-Cache-user-authenticator-threads.patch +++ b/patches/server/0108-Cache-user-authenticator-threads.patch @@ -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 -index 5054c3208d1723a33a96d23edcbc9f1483b879e5..72bc5648706380639440456fc938d9350e12f1cc 100644 +index bcf189d0ae917b99fff62167740ddb0012082138..6e315a2e87bbc4b03e4e0f38ba0b0f6b592a433e 100644 --- a/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 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)); } else { // Spigot start @@ -38,7 +38,7 @@ index 5054c3208d1723a33a96d23edcbc9f1483b879e5..72bc5648706380639440456fc938d935 @Override public void run() { 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); } } @@ -48,7 +48,7 @@ index 5054c3208d1723a33a96d23edcbc9f1483b879e5..72bc5648706380639440456fc938d935 // 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); } @@ -58,7 +58,7 @@ index 5054c3208d1723a33a96d23edcbc9f1483b879e5..72bc5648706380639440456fc938d935 public void run() { 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; } diff --git a/patches/server/0109-Allow-Reloading-of-Command-Aliases.patch b/patches/server/0109-Allow-Reloading-of-Command-Aliases.patch index f94697a6b2..6cc98da194 100644 --- a/patches/server/0109-Allow-Reloading-of-Command-Aliases.patch +++ b/patches/server/0109-Allow-Reloading-of-Command-Aliases.patch @@ -6,10 +6,10 @@ Subject: [PATCH] Allow Reloading of Command Aliases Reload the aliases stored in commands.yml diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -index 34d4157d187ff8485d860eb4f75b898aee06863c..8c041ca80cb20800178f8d4a5584e1b26bf3cb15 100644 +index cc4bd65d8f9f3824e77e4509a8f0dbda5c2f01a6..34b35a4e2e723f4bfe6773da1e9958badadec221 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -@@ -2556,5 +2556,24 @@ public final class CraftServer implements Server { +@@ -2563,5 +2563,24 @@ public final class CraftServer implements Server { DefaultPermissions.registerCorePermissions(); CraftDefaultPermissions.registerCorePermissions(); } diff --git a/patches/server/0119-Properly-fix-item-duplication-bug.patch b/patches/server/0119-Properly-fix-item-duplication-bug.patch index aaf16b075f..6126f06bb0 100644 --- a/patches/server/0119-Properly-fix-item-duplication-bug.patch +++ b/patches/server/0119-Properly-fix-item-duplication-bug.patch @@ -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 5b568d8f3f2e8bd466ac1edae9cafc602a226175..69dc4063ae0a3e7271ce0e4ca79c0b059de24bc8 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 952ad96c310b8d1285e1dd07ec224d5005d5c8cc..2b54fe257db874cb74a9bd002de8721d47409e6a 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 +@@ -3274,7 +3274,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic } public final boolean isDisconnected() { diff --git a/patches/server/0130-Properly-handle-async-calls-to-restart-the-server.patch b/patches/server/0130-Properly-handle-async-calls-to-restart-the-server.patch index b07682fbd0..22e1461d66 100644 --- a/patches/server/0130-Properly-handle-async-calls-to-restart-the-server.patch +++ b/patches/server/0130-Properly-handle-async-calls-to-restart-the-server.patch @@ -30,11 +30,11 @@ will have plugins and worlds saving to the disk has a high potential to result in corruption/dataloss. diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index f3f528cc7f07da69c45e4290de098c0443c7a952..41928abfffbf6102e92cb45532e691b35a603a31 100644 +index 8c9bc0995f5b59e05a4ecebbe2bfb5d65ec92dcf..81e54058bc5e034b076e2bad1115c53950b3b39b 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java @@ -221,6 +221,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop, ServerLevel> levels; + private Map, ServerLevel> levels; private PlayerList playerList; private volatile boolean running; + private volatile boolean isRestarting = false; // Paper - flag to signify we're attempting to restart @@ -64,7 +64,7 @@ index f3f528cc7f07da69c45e4290de098c0443c7a952..41928abfffbf6102e92cb45532e691b3 if (flag) { try { diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java -index 23687ae4a06be741a82cec1178d891aed4640084..03a19b3869eea9a59f4003a81ab488603347cd4a 100644 +index aadeb9c63436214d541c563179ed7a32bfdd6d88..dee794f1128309c87d02b1a6a19cf9db314994e3 100644 --- a/src/main/java/net/minecraft/server/players/PlayerList.java +++ b/src/main/java/net/minecraft/server/players/PlayerList.java @@ -1152,8 +1152,15 @@ public abstract class PlayerList { diff --git a/patches/server/0131-Add-option-to-make-parrots-stay-on-shoulders-despite.patch b/patches/server/0131-Add-option-to-make-parrots-stay-on-shoulders-despite.patch index c18bd20fc5..62dc6bafbf 100644 --- a/patches/server/0131-Add-option-to-make-parrots-stay-on-shoulders-despite.patch +++ b/patches/server/0131-Add-option-to-make-parrots-stay-on-shoulders-despite.patch @@ -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 2b54fe257db874cb74a9bd002de8721d47409e6a..c06fbadc3960a31b376f814ad050f34954728762 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 +@@ -2455,6 +2455,13 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic switch (packet.getAction()) { case PRESS_SHIFT_KEY: this.player.setShiftKeyDown(true); diff --git a/patches/server/0132-Add-configuration-option-to-prevent-player-names-fro.patch b/patches/server/0132-Add-configuration-option-to-prevent-player-names-fro.patch index 2ced48b9ad..f6d8e60cf3 100644 --- a/patches/server/0132-Add-configuration-option-to-prevent-player-names-fro.patch +++ b/patches/server/0132-Add-configuration-option-to-prevent-player-names-fro.patch @@ -6,10 +6,10 @@ Subject: [PATCH] Add configuration option to prevent player names from being diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -index 8c041ca80cb20800178f8d4a5584e1b26bf3cb15..be392b054d3fe86118265cbe65067e83b37f36e8 100644 +index 34b35a4e2e723f4bfe6773da1e9958badadec221..593b998592cc340f8ff1f8806394fea7e0871cf0 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -@@ -2575,5 +2575,10 @@ public final class CraftServer implements Server { +@@ -2582,5 +2582,10 @@ public final class CraftServer implements Server { commandMap.registerServerAliases(); return true; } diff --git a/patches/server/0133-Use-TerminalConsoleAppender-for-console-improvements.patch b/patches/server/0133-Use-TerminalConsoleAppender-for-console-improvements.patch index eca14c202a..cdb6d9a12c 100644 --- a/patches/server/0133-Use-TerminalConsoleAppender-for-console-improvements.patch +++ b/patches/server/0133-Use-TerminalConsoleAppender-for-console-improvements.patch @@ -112,7 +112,7 @@ index 0000000000000000000000000000000000000000..685deaa0e5d1ddc13e3a7c0471b1cfcf + +} diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index 41928abfffbf6102e92cb45532e691b35a603a31..68072a78d241bcfb54a206e7b85f038d51e26e58 100644 +index 81e54058bc5e034b076e2bad1115c53950b3b39b..f4effe6f006df5209cd130f42ff1cd207547bbc5 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java @@ -156,7 +156,7 @@ import org.slf4j.Logger; @@ -161,7 +161,7 @@ index 41928abfffbf6102e92cb45532e691b35a603a31..68072a78d241bcfb54a206e7b85f038d } catch (Exception ignored) { } // CraftBukkit end -@@ -1554,7 +1558,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop 0.0D; if (this.player.isOnGround() && !packet.isOnGround() && flag) { diff --git a/patches/server/0157-handle-ServerboundKeepAlivePacket-async.patch b/patches/server/0157-handle-ServerboundKeepAlivePacket-async.patch index 18988ee1e2..05c48ce612 100644 --- a/patches/server/0157-handle-ServerboundKeepAlivePacket-async.patch +++ b/patches/server/0157-handle-ServerboundKeepAlivePacket-async.patch @@ -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 9eb204ba4df5064fcca40c9445a5fc6a10d1b3aa..96091153862433ffe2fdc90c00f1cc6be02e8977 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 +@@ -3233,14 +3233,18 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic @Override public void handleKeepAlive(ServerboundKeepAlivePacket packet) { diff --git a/patches/server/0159-revert-serverside-behavior-of-keepalives.patch b/patches/server/0159-revert-serverside-behavior-of-keepalives.patch index 44e1901c57..27d0bf3171 100644 --- a/patches/server/0159-revert-serverside-behavior-of-keepalives.patch +++ b/patches/server/0159-revert-serverside-behavior-of-keepalives.patch @@ -17,10 +17,10 @@ from networking or during connections flood of chunk packets on slower clients, at the cost of dead connections being kept open for longer. diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -index 1be835e21c1400bbd4f6b793061c3d9f9c0625cd..0a2a55979ee58458928f78f1383a653717d0a18a 100644 +index 96091153862433ffe2fdc90c00f1cc6be02e8977..90b09d4fcb267dff4ab3c910948876a4408abcd1 100644 --- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -@@ -253,7 +253,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic +@@ -256,7 +256,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic public ServerPlayer player; private int tickCount; private int ackBlockChangesUpTo = -1; @@ -29,7 +29,7 @@ index 1be835e21c1400bbd4f6b793061c3d9f9c0625cd..0a2a55979ee58458928f78f1383a6537 private boolean keepAlivePending; private long keepAliveChallenge; // CraftBukkit start - multithreaded fields -@@ -290,6 +290,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic +@@ -293,6 +293,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic private final SignedMessageChain.Decoder signedMessageDecoder; private final LastSeenMessagesValidator lastSeenMessagesValidator; private final FutureChain chatMessageChain; @@ -37,7 +37,7 @@ index 1be835e21c1400bbd4f6b793061c3d9f9c0625cd..0a2a55979ee58458928f78f1383a6537 public ServerGamePacketListenerImpl(MinecraftServer server, Connection connection, ServerPlayer player) { this.lastChatTimeStamp = new AtomicReference(Instant.EPOCH); -@@ -388,18 +389,25 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic +@@ -391,18 +392,25 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic } this.server.getProfiler().push("keepAlive"); diff --git a/patches/server/0162-Prevent-logins-from-being-processed-when-the-player-.patch b/patches/server/0162-Prevent-logins-from-being-processed-when-the-player-.patch index 254bf53d0a..a7bab6af89 100644 --- a/patches/server/0162-Prevent-logins-from-being-processed-when-the-player-.patch +++ b/patches/server/0162-Prevent-logins-from-being-processed-when-the-player-.patch @@ -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 -index 6a0cd6763202a0a0e301a3a64f09f8cc60aa6b1d..85f2c4673b18126dce748051a20ababc6cbbf221 100644 +index 552b7d612d0f833f3280a2a60839e2ef93b59271..158862d2ea50a34dea10e074f3776bc5ed5a327f 100644 --- a/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 if (this.state == ServerLoginPacketListenerImpl.State.READY_TO_ACCEPT) { diff --git a/patches/server/0166-AsyncTabCompleteEvent.patch b/patches/server/0166-AsyncTabCompleteEvent.patch index 7eb28ae99d..ab9832afe8 100644 --- a/patches/server/0166-AsyncTabCompleteEvent.patch +++ b/patches/server/0166-AsyncTabCompleteEvent.patch @@ -1,5 +1,5 @@ From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: Aikar +From: Jason Penilla <11360596+jpenilla@users.noreply.github.com> Date: Sun, 26 Nov 2017 13:19:58 -0500 Subject: [PATCH] AsyncTabCompleteEvent @@ -13,12 +13,20 @@ completion, such as offline players. Also adds isCommand and getLocation to the sync TabCompleteEvent +Co-authored-by: Aikar + diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -index 0a2a55979ee58458928f78f1383a653717d0a18a..7fb4e1cf4eb21dd19a581b082caf9825cdaa4ad9 100644 +index 90b09d4fcb267dff4ab3c910948876a4408abcd1..d5861e01f7bc18a95f9287128aa829a28780e8c4 100644 --- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -@@ -783,10 +783,10 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic +@@ -784,27 +784,58 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic + } + ++ // Paper start ++ private static final java.util.concurrent.ExecutorService TAB_COMPLETE_EXECUTOR = java.util.concurrent.Executors.newFixedThreadPool(4, ++ new com.google.common.util.concurrent.ThreadFactoryBuilder().setDaemon(true).setNameFormat("Async Tab Complete Thread - #%d").setUncaughtExceptionHandler(new net.minecraft.DefaultUncaughtExceptionHandlerWithName(net.minecraft.server.MinecraftServer.LOGGER)).build()); ++ // Paper end @Override public void handleCustomCommandSuggestions(ServerboundCommandSuggestionPacket packet) { - PacketUtils.ensureRunningOnSameThread(packet, this, this.player.getLevel()); @@ -30,52 +38,57 @@ index 0a2a55979ee58458928f78f1383a653717d0a18a..7fb4e1cf4eb21dd19a581b082caf9825 return; } // CraftBukkit end -@@ -796,12 +796,35 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic ++ // Paper start - async tab completion ++ TAB_COMPLETE_EXECUTOR.execute(() -> { + StringReader stringreader = new StringReader(packet.getCommand()); + + if (stringreader.canRead() && stringreader.peek() == '/') { stringreader.skip(); } ++ final String command = packet.getCommand(); ++ final com.destroystokyo.paper.event.server.AsyncTabCompleteEvent event = new com.destroystokyo.paper.event.server.AsyncTabCompleteEvent(this.getCraftPlayer(), command, true, null); ++ event.callEvent(); ++ final java.util.List completions = event.isCancelled() ? com.google.common.collect.ImmutableList.of() : event.completions(); ++ // If the event isn't handled, we can assume that we have no completions, and so we'll ask the server ++ if (!event.isHandled()) { ++ if (!event.isCancelled()) { - ParseResults parseresults = this.server.getCommands().getDispatcher().parse(stringreader, this.player.createCommandSourceStack()); -+ // Paper start - async tab completion -+ com.destroystokyo.paper.event.server.AsyncTabCompleteEvent event; -+ java.util.List completions = new java.util.ArrayList<>(); -+ String buffer = packet.getCommand(); -+ event = new com.destroystokyo.paper.event.server.AsyncTabCompleteEvent(this.getCraftPlayer(), completions, -+ buffer, true, null); -+ event.callEvent(); -+ completions = event.isCancelled() ? com.google.common.collect.ImmutableList.of() : event.getCompletions(); -+ // If the event isn't handled, we can assume that we have no completions, and so we'll ask the server -+ if (!event.isHandled()) { -+ if (!event.isCancelled()) { ++ this.server.scheduleOnMain(() -> { // This needs to be on main ++ ParseResults parseresults = this.server.getCommands().getDispatcher().parse(stringreader, this.player.createCommandSourceStack()); - this.server.getCommands().getDispatcher().getCompletionSuggestions(parseresults).thenAccept((suggestions) -> { - if (suggestions.isEmpty()) return; // CraftBukkit - don't send through empty suggestions - prevents [] from showing for plugins with nothing more to offer - this.connection.send(new ClientboundCommandSuggestionsPacket(packet.getId(), suggestions)); -- }); -+ this.server.scheduleOnMain(() -> { // Paper - This needs to be on main -+ ParseResults parseresults = this.server.getCommands().getDispatcher().parse(stringreader, this.player.createCommandSourceStack()); -+ -+ this.server.getCommands().getDispatcher().getCompletionSuggestions(parseresults).thenAccept((suggestions) -> { -+ if (suggestions.isEmpty()) return; // CraftBukkit - don't send through empty suggestions - prevents [] from showing for plugins with nothing more to offer -+ this.connection.send(new ClientboundCommandSuggestionsPacket(packet.getId(), suggestions)); ++ this.server.getCommands().getDispatcher().getCompletionSuggestions(parseresults).thenAccept((suggestions) -> { ++ if (suggestions.isEmpty()) return; // CraftBukkit - don't send through empty suggestions - prevents [] from showing for plugins with nothing more to offer ++ this.connection.send(new ClientboundCommandSuggestionsPacket(packet.getId(), suggestions)); ++ }); + }); ++ } ++ } else if (!completions.isEmpty()) { ++ final com.mojang.brigadier.suggestion.SuggestionsBuilder builder0 = new com.mojang.brigadier.suggestion.SuggestionsBuilder(command, stringreader.getTotalLength()); ++ final com.mojang.brigadier.suggestion.SuggestionsBuilder builder = builder0.createOffset(builder0.getInput().lastIndexOf(' ') + 1); ++ completions.forEach(completion -> { ++ final Integer intSuggestion = com.google.common.primitives.Ints.tryParse(completion.suggestion()); ++ if (intSuggestion != null) { ++ builder.suggest(intSuggestion, PaperAdventure.asVanilla(completion.tooltip())); ++ } else { ++ builder.suggest(completion.suggestion(), PaperAdventure.asVanilla(completion.tooltip())); ++ } + }); ++ player.connection.send(new ClientboundCommandSuggestionsPacket(packet.getId(), builder.buildFuture().join())); + } -+ } else if (!completions.isEmpty()) { -+ com.mojang.brigadier.suggestion.SuggestionsBuilder builder = new com.mojang.brigadier.suggestion.SuggestionsBuilder(packet.getCommand(), stringreader.getTotalLength()); -+ -+ builder = builder.createOffset(builder.getInput().lastIndexOf(' ') + 1); -+ completions.forEach(builder::suggest); -+ player.connection.send(new ClientboundCommandSuggestionsPacket(packet.getId(), builder.buildFuture().join())); -+ } + }); + // Paper end - async tab completion } @Override diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -index 733423010e7941d160b838d614c732980111fb55..45d3fc8174ff32c140c1c234b655a6971a27913e 100644 +index 90d88637b5690524d1899541abbb310d330d0e50..565ae5e0dc0db9aaf694003cb30e9af3ff6fc78d 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -@@ -2084,7 +2084,7 @@ public final class CraftServer implements Server { +@@ -2086,7 +2086,7 @@ public final class CraftServer implements Server { offers = this.tabCompleteChat(player, message); } @@ -85,42 +98,64 @@ index 733423010e7941d160b838d614c732980111fb55..45d3fc8174ff32c140c1c234b655a697 return tabEvent.isCancelled() ? Collections.EMPTY_LIST : tabEvent.getCompletions(); diff --git a/src/main/java/org/bukkit/craftbukkit/command/ConsoleCommandCompleter.java b/src/main/java/org/bukkit/craftbukkit/command/ConsoleCommandCompleter.java -index b996fde481cebbbcce80a6c267591136db7cc0bc..e5af155d75f717d33c23e22ff8b96bb3ff87844d 100644 +index b996fde481cebbbcce80a6c267591136db7cc0bc..14cd8ae69d9b25dc5edad4ff96ff4a9acb1f22cb 100644 --- a/src/main/java/org/bukkit/craftbukkit/command/ConsoleCommandCompleter.java +++ b/src/main/java/org/bukkit/craftbukkit/command/ConsoleCommandCompleter.java -@@ -28,6 +28,39 @@ public class ConsoleCommandCompleter implements Completer { +@@ -28,6 +28,61 @@ public class ConsoleCommandCompleter implements Completer { public void complete(LineReader reader, ParsedLine line, List candidates) { final CraftServer server = this.server.server; final String buffer = line.line(); + // Async Tab Complete -+ com.destroystokyo.paper.event.server.AsyncTabCompleteEvent event; -+ java.util.List completions = new java.util.ArrayList<>(); -+ event = new com.destroystokyo.paper.event.server.AsyncTabCompleteEvent(server.getConsoleSender(), completions, -+ buffer, true, null); ++ final com.destroystokyo.paper.event.server.AsyncTabCompleteEvent event = ++ new com.destroystokyo.paper.event.server.AsyncTabCompleteEvent(server.getConsoleSender(), buffer, true, null); + event.callEvent(); -+ completions = event.isCancelled() ? com.google.common.collect.ImmutableList.of() : event.getCompletions(); ++ final List completions = event.isCancelled() ? com.google.common.collect.ImmutableList.of() : event.completions(); + + if (event.isCancelled() || event.isHandled()) { + // Still fire sync event with the provided completions, if someone is listening + if (!event.isCancelled() && TabCompleteEvent.getHandlerList().getRegisteredListeners().length > 0) { -+ List finalCompletions = completions; ++ List finalCompletions = new java.util.ArrayList<>(completions); + Waitable> syncCompletions = new Waitable>() { + @Override + protected List evaluate() { -+ org.bukkit.event.server.TabCompleteEvent syncEvent = new org.bukkit.event.server.TabCompleteEvent(server.getConsoleSender(), buffer, finalCompletions); ++ org.bukkit.event.server.TabCompleteEvent syncEvent = new org.bukkit.event.server.TabCompleteEvent(server.getConsoleSender(), buffer, ++ finalCompletions.stream() ++ .map(com.destroystokyo.paper.event.server.AsyncTabCompleteEvent.Completion::suggestion) ++ .collect(java.util.stream.Collectors.toList())); + return syncEvent.callEvent() ? syncEvent.getCompletions() : com.google.common.collect.ImmutableList.of(); + } + }; + server.getServer().processQueue.add(syncCompletions); + try { -+ completions = syncCompletions.get(); ++ final List legacyCompletions = syncCompletions.get(); ++ completions.removeIf(it -> !legacyCompletions.contains(it.suggestion())); // remove any suggestions that were removed ++ // add any new suggestions ++ for (final String completion : legacyCompletions) { ++ if (notNewSuggestion(completions, completion)) { ++ continue; ++ } ++ completions.add(com.destroystokyo.paper.event.server.AsyncTabCompleteEvent.Completion.completion(completion)); ++ } + } catch (InterruptedException | ExecutionException e1) { + e1.printStackTrace(); + } + } + + if (!completions.isEmpty()) { -+ candidates.addAll(completions.stream().map(Candidate::new).collect(java.util.stream.Collectors.toList())); ++ for (final com.destroystokyo.paper.event.server.AsyncTabCompleteEvent.Completion completion : completions) { ++ if (completion.suggestion().isEmpty()) { ++ continue; ++ } ++ candidates.add(new Candidate( ++ completion.suggestion(), ++ completion.suggestion(), ++ null, ++ io.papermc.paper.adventure.PaperAdventure.PLAIN.serializeOr(completion.tooltip(), null), ++ null, ++ null, ++ false ++ )); ++ } + } + return; + } @@ -128,3 +163,19 @@ index b996fde481cebbbcce80a6c267591136db7cc0bc..e5af155d75f717d33c23e22ff8b96bb3 // Paper end Waitable> waitable = new Waitable>() { @Override +@@ -73,4 +128,15 @@ public class ConsoleCommandCompleter implements Completer { + Thread.currentThread().interrupt(); + } + } ++ ++ // Paper start ++ private boolean notNewSuggestion(final List completions, final String completion) { ++ for (final com.destroystokyo.paper.event.server.AsyncTabCompleteEvent.Completion it : completions) { ++ if (it.suggestion().equals(completion)) { ++ return true; ++ } ++ } ++ return false; ++ } ++ // Paper end + } diff --git a/patches/server/0180-Ability-to-change-PlayerProfile-in-AsyncPreLoginEven.patch b/patches/server/0180-Ability-to-change-PlayerProfile-in-AsyncPreLoginEven.patch index ebe4ecf519..67e2059650 100644 --- a/patches/server/0180-Ability-to-change-PlayerProfile-in-AsyncPreLoginEven.patch +++ b/patches/server/0180-Ability-to-change-PlayerProfile-in-AsyncPreLoginEven.patch @@ -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. 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 +++ 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(); final org.bukkit.craftbukkit.CraftServer server = ServerLoginPacketListenerImpl.this.server.server; diff --git a/patches/server/0181-Player.setPlayerProfile-API.patch b/patches/server/0181-Player.setPlayerProfile-API.patch index 30cb3dee4a..c09ca131cd 100644 --- a/patches/server/0181-Player.setPlayerProfile-API.patch +++ b/patches/server/0181-Player.setPlayerProfile-API.patch @@ -6,10 +6,10 @@ Subject: [PATCH] Player.setPlayerProfile API 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 -index 681c4dddac4ffc5997f3ea92befaeafc36da99c4..7c3c76b7ef169e0c0832e26212775111deb505c0 100644 +index fa949d01da7b6c1a489d17955108f7082f959c66..c83395364edb4f2ba8515326b19c4f1a436a0502 100644 --- a/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; // Paper start @@ -24,7 +24,7 @@ index 681c4dddac4ffc5997f3ea92befaeafc36da99c4..7c3c76b7ef169e0c0832e26212775111 playerName = gameProfile.getName(); 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 -index d1271b9c31502407dfeaf8eb47b73f515bf6c0fd..32554bad10cccec164bc36063333244344c16473 100644 +index 299f2a8c45462d8070312c98554dbcc05298c681..31bcabd4c6ac3aa261c439a154ba7eb0f8caa0b8 100644 --- a/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; @@ -131,7 +131,7 @@ index d1271b9c31502407dfeaf8eb47b73f515bf6c0fd..32554bad10cccec164bc360633332443 + ServerLevel worldserver = handle.getLevel(); + connection.send(new net.minecraft.network.protocol.game.ClientboundRespawnPacket(worldserver.dimensionTypeId(), worldserver.dimension(), BiomeManager.obfuscateSeed(worldserver.getSeed()), handle.gameMode.getGameModeForPlayer(), handle.gameMode.getPreviousGameModeForPlayer(), worldserver.isDebug(), worldserver.isFlat(), true, this.getHandle().getLastDeathLocation())); + handle.onUpdateAbilities(); -+ connection.send(new net.minecraft.network.protocol.game.ClientboundPlayerPositionPacket(loc.getX(), loc.getY(), loc.getZ(), loc.getYaw(), loc.getPitch(), java.util.Collections.emptySet(), 0, false)); ++ connection.internalTeleport(loc.getX(), loc.getY(), loc.getZ(), loc.getYaw(), loc.getPitch(), java.util.Collections.emptySet(), false); + net.minecraft.server.MinecraftServer.getServer().getPlayerList().sendAllPlayerInfo(handle); + + if (this.isOp()) { diff --git a/patches/server/0182-getPlayerUniqueId-API.patch b/patches/server/0182-getPlayerUniqueId-API.patch index 059bc2b977..0b83ebb1eb 100644 --- a/patches/server/0182-getPlayerUniqueId-API.patch +++ b/patches/server/0182-getPlayerUniqueId-API.patch @@ -9,10 +9,10 @@ In Offline Mode, will return an Offline UUID This is a more performant way to obtain a UUID for a name than loading an OfflinePlayer diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -index 45d3fc8174ff32c140c1c234b655a6971a27913e..1775174221c84b627ea778c0d0892ce46c1d56b6 100644 +index be5982fea6f354131e4562e2a109b4c56c77bcd9..e8becfe4cfb0b431d99a78b7726e96afbdefcf12 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -@@ -1706,6 +1706,25 @@ public final class CraftServer implements Server { +@@ -1708,6 +1708,25 @@ public final class CraftServer implements Server { return recipients.size(); } diff --git a/patches/server/0189-Fix-exploit-that-allowed-colored-signs-to-be-created.patch b/patches/server/0189-Fix-exploit-that-allowed-colored-signs-to-be-created.patch index 22d93ebb58..250b4dfb89 100644 --- a/patches/server/0189-Fix-exploit-that-allowed-colored-signs-to-be-created.patch +++ b/patches/server/0189-Fix-exploit-that-allowed-colored-signs-to-be-created.patch @@ -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 d5861e01f7bc18a95f9287128aa829a28780e8c4..727350fb397e9be2917fa383dc6b8abeb15670e7 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 +@@ -3247,9 +3247,9 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic FilteredText filteredtext = (FilteredText) signText.get(i); if (this.player.isTextFilteringEnabled()) { diff --git a/patches/server/0215-InventoryCloseEvent-Reason-API.patch b/patches/server/0215-InventoryCloseEvent-Reason-API.patch index d92c40acec..d62c930502 100644 --- a/patches/server/0215-InventoryCloseEvent-Reason-API.patch +++ b/patches/server/0215-InventoryCloseEvent-Reason-API.patch @@ -7,7 +7,7 @@ Allows you to determine why an inventory was closed, enabling plugin developers to "confirm" things based on if it was player triggered close or not. diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java -index 3d3926a14229d922fb7b7e76c9babb031bf7d9ab..5029436157fe7279a2a583f06b7d02a0413d2178 100644 +index 0b1676f71e8da09af3cc0db1c6c17059a6bcf60c..45038c25904d919e0b69deaecdc09272df05bab4 100644 --- a/src/main/java/net/minecraft/server/level/ServerLevel.java +++ b/src/main/java/net/minecraft/server/level/ServerLevel.java @@ -1159,7 +1159,7 @@ public class ServerLevel extends Level implements WorldGenLevel { @@ -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 4eb69b62b4c3f568cad83fdc4b19cbde2c588be7..35a6dd9cfed631f66e31c71911433ec880711905 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,10 +75,10 @@ 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 727350fb397e9be2917fa383dc6b8abeb15670e7..f7552186d8a5144c23d495bdc6a450e55d8f40d1 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; +@@ -219,6 +219,7 @@ import org.bukkit.event.inventory.ClickType; import org.bukkit.event.inventory.CraftItemEvent; import org.bukkit.event.inventory.InventoryAction; import org.bukkit.event.inventory.InventoryClickEvent; @@ -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 +@@ -2773,10 +2774,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 8d46d3a77fa9717075dcfef44a42948c2f274182..04a41c3ab90fcdfaedb1646137fb5dde12a9331b 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 7234e96d6d956d84fbcbcb321c1fb05906da6adb..69c3602abfddc9c065736cf08c32f88029df0e5c 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 { diff --git a/patches/server/0217-Refresh-player-inventory-when-cancelling-PlayerInter.patch b/patches/server/0217-Refresh-player-inventory-when-cancelling-PlayerInter.patch index 3bb306582c..f381a0ed77 100644 --- a/patches/server/0217-Refresh-player-inventory-when-cancelling-PlayerInter.patch +++ b/patches/server/0217-Refresh-player-inventory-when-cancelling-PlayerInter.patch @@ -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 f7552186d8a5144c23d495bdc6a450e55d8f40d1..abd3899c41c8c8be53cab04d946d15e621369d9a 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 +@@ -2658,6 +2658,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic } if (event.isCancelled()) { diff --git a/patches/server/0234-Break-up-and-make-tab-spam-limits-configurable.patch b/patches/server/0234-Break-up-and-make-tab-spam-limits-configurable.patch index b8f3c3056c..d6f929806f 100644 --- a/patches/server/0234-Break-up-and-make-tab-spam-limits-configurable.patch +++ b/patches/server/0234-Break-up-and-make-tab-spam-limits-configurable.patch @@ -22,10 +22,10 @@ to take the burden of this into their own hand without having to rely on plugins doing unsafe things. diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -index af966cd751b73af9e01c8561d3e74972a241b0f5..8a6fd7616df0f81e4b67a217846786d9c7bcd21f 100644 +index abd3899c41c8c8be53cab04d946d15e621369d9a..0bac1fa4637d7132871b8f57b0431724bc9aa8c1 100644 --- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -@@ -259,6 +259,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic +@@ -262,6 +262,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic private long keepAliveChallenge; // CraftBukkit start - multithreaded fields private final AtomicInteger chatSpamTickCount = new AtomicInteger(); @@ -33,7 +33,7 @@ index af966cd751b73af9e01c8561d3e74972a241b0f5..8a6fd7616df0f81e4b67a217846786d9 // CraftBukkit end private int dropSpamTickCount; private double firstGoodX; -@@ -413,6 +414,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic +@@ -416,6 +417,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic this.server.getProfiler().pop(); // CraftBukkit start for (int spam; (spam = this.chatSpamTickCount.get()) > 0 && !this.chatSpamTickCount.compareAndSet(spam, spam - 1); ) ; @@ -41,7 +41,7 @@ index af966cd751b73af9e01c8561d3e74972a241b0f5..8a6fd7616df0f81e4b67a217846786d9 /* Use thread-safe field access instead if (this.chatSpamTickCount > 0) { --this.chatSpamTickCount; -@@ -786,7 +788,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic +@@ -793,7 +795,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic public void handleCustomCommandSuggestions(ServerboundCommandSuggestionPacket packet) { // PacketUtils.ensureRunningOnSameThread(packet, this, this.player.getLevel()); // Paper - run this async // CraftBukkit start diff --git a/patches/server/0238-Add-Early-Warning-Feature-to-WatchDog.patch b/patches/server/0238-Add-Early-Warning-Feature-to-WatchDog.patch index 2a9ef7c0b2..beb82f3bbd 100644 --- a/patches/server/0238-Add-Early-Warning-Feature-to-WatchDog.patch +++ b/patches/server/0238-Add-Early-Warning-Feature-to-WatchDog.patch @@ -9,7 +9,7 @@ thread dumps at an interval until the point of crash. This will help diagnose what was going on in that time before the crash. diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index bb50ca7bcbdf46d29bd749050674dc18d7e282e4..f78e2d7926e665278a4d7dd78529e92abb54be85 100644 +index e7cd33be3c74ca79f9f0fecea010081b24a14417..ac36f50fd721b0087248bfb733fe4ea78a115778 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java @@ -1061,6 +1061,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop comparator; diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -index 8a6fd7616df0f81e4b67a217846786d9c7bcd21f..c4fffd9e5c3a263376832956b6700bafe143aa33 100644 +index 0bac1fa4637d7132871b8f57b0431724bc9aa8c1..d991354d65305ab7d02666f7c3362e4136c3f6af 100644 --- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -@@ -792,6 +792,13 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic +@@ -799,6 +799,13 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic server.scheduleOnMain(() -> this.disconnect(Component.translatable("disconnect.spam", new Object[0]))); // Paper return; } @@ -2835,8 +2835,8 @@ index 8a6fd7616df0f81e4b67a217846786d9c7bcd21f..c4fffd9e5c3a263376832956b6700baf + } + // Paper end // CraftBukkit end - StringReader stringreader = new StringReader(packet.getCommand()); - + // Paper start - async tab completion + TAB_COMPLETE_EXECUTOR.execute(() -> { diff --git a/src/main/java/net/minecraft/util/worldupdate/WorldUpgrader.java b/src/main/java/net/minecraft/util/worldupdate/WorldUpgrader.java index 821052e93ee753db6aaf499bbf39dc30598fe72f..2955c1ee153c410ea45fe367bac8597621c9bbd0 100644 --- a/src/main/java/net/minecraft/util/worldupdate/WorldUpgrader.java diff --git a/patches/server/0271-Call-player-spectator-target-events-and-improve-impl.patch b/patches/server/0271-Call-player-spectator-target-events-and-improve-impl.patch index b3d594b2dd..bc8632e576 100644 --- a/patches/server/0271-Call-player-spectator-target-events-and-improve-impl.patch +++ b/patches/server/0271-Call-player-spectator-target-events-and-improve-impl.patch @@ -19,10 +19,10 @@ spectate the target entity. Co-authored-by: Spottedleaf 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) { diff --git a/patches/server/0274-Add-more-Witch-API.patch b/patches/server/0273-Add-more-Witch-API.patch similarity index 100% rename from patches/server/0274-Add-more-Witch-API.patch rename to patches/server/0273-Add-more-Witch-API.patch diff --git a/patches/server/0275-Check-Drowned-for-Villager-Aggression-Config.patch b/patches/server/0274-Check-Drowned-for-Villager-Aggression-Config.patch similarity index 100% rename from patches/server/0275-Check-Drowned-for-Villager-Aggression-Config.patch rename to patches/server/0274-Check-Drowned-for-Villager-Aggression-Config.patch diff --git a/patches/server/0276-Add-option-to-prevent-players-from-moving-into-unloa.patch b/patches/server/0275-Add-option-to-prevent-players-from-moving-into-unloa.patch similarity index 93% rename from patches/server/0276-Add-option-to-prevent-players-from-moving-into-unloa.patch rename to patches/server/0275-Add-option-to-prevent-players-from-moving-into-unloa.patch index 835ab28b89..bcbabba356 100644 --- a/patches/server/0276-Add-option-to-prevent-players-from-moving-into-unloa.patch +++ b/patches/server/0275-Add-option-to-prevent-players-from-moving-into-unloa.patch @@ -6,10 +6,10 @@ Subject: [PATCH] Add option to prevent players from moving into unloaded diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -index c4fffd9e5c3a263376832956b6700bafe143aa33..30858fb07046d17ca66f821fe071b8aecbd00875 100644 +index d991354d65305ab7d02666f7c3362e4136c3f6af..5beba7d1ba44bde3d9cefccc80b6b8795a47b945 100644 --- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -@@ -568,9 +568,9 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic +@@ -571,9 +571,9 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic double d0 = entity.getX(); double d1 = entity.getY(); double d2 = entity.getZ(); @@ -22,7 +22,7 @@ index c4fffd9e5c3a263376832956b6700bafe143aa33..30858fb07046d17ca66f821fe071b8ae float f = Mth.wrapDegrees(packet.getYRot()); float f1 = Mth.wrapDegrees(packet.getXRot()); double d6 = d3 - this.vehicleFirstGoodX; -@@ -605,6 +605,16 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic +@@ -608,6 +608,16 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic } speed *= 2f; // TODO: Get the speed of the vehicle instead of the player @@ -39,7 +39,7 @@ index c4fffd9e5c3a263376832956b6700bafe143aa33..30858fb07046d17ca66f821fe071b8ae if (d10 - d9 > Math.max(100.0D, Math.pow((double) (org.spigotmc.SpigotConfig.movedTooQuicklyMultiplier * (float) i * speed), 2)) && !this.isSingleplayerOwner()) { // CraftBukkit end ServerGamePacketListenerImpl.LOGGER.warn("{} (vehicle of {}) moved too quickly! {},{},{}", new Object[]{entity.getName().getString(), this.player.getName().getString(), d6, d7, d8}); -@@ -1246,9 +1256,9 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic +@@ -1257,9 +1267,9 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic this.allowedPlayerTicks = 20; // CraftBukkit } else { this.awaitingTeleportTime = this.tickCount; @@ -52,7 +52,7 @@ index c4fffd9e5c3a263376832956b6700bafe143aa33..30858fb07046d17ca66f821fe071b8ae float f = Mth.wrapDegrees(packet.getYRot(this.player.getYRot())); float f1 = Mth.wrapDegrees(packet.getXRot(this.player.getXRot())); -@@ -1304,6 +1314,12 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic +@@ -1315,6 +1325,12 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic } else { speed = this.player.getAbilities().walkingSpeed * 10f; } diff --git a/patches/server/0277-Reset-players-airTicks-on-respawn.patch b/patches/server/0276-Reset-players-airTicks-on-respawn.patch similarity index 83% rename from patches/server/0277-Reset-players-airTicks-on-respawn.patch rename to patches/server/0276-Reset-players-airTicks-on-respawn.patch index 4263234b5a..ca5fce40d8 100644 --- a/patches/server/0277-Reset-players-airTicks-on-respawn.patch +++ b/patches/server/0276-Reset-players-airTicks-on-respawn.patch @@ -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 be79f80270a7400451dcaac55fba8d3ab7bdda52..5f10a2d21553a8dc8c03ea5951190860ee5a4615 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 diff --git a/patches/server/0278-Don-t-sleep-after-profile-lookups-if-not-needed.patch b/patches/server/0277-Don-t-sleep-after-profile-lookups-if-not-needed.patch similarity index 100% rename from patches/server/0278-Don-t-sleep-after-profile-lookups-if-not-needed.patch rename to patches/server/0277-Don-t-sleep-after-profile-lookups-if-not-needed.patch diff --git a/patches/server/0279-Improve-Server-Thread-Pool-and-Thread-Priorities.patch b/patches/server/0278-Improve-Server-Thread-Pool-and-Thread-Priorities.patch similarity index 98% rename from patches/server/0279-Improve-Server-Thread-Pool-and-Thread-Priorities.patch rename to patches/server/0278-Improve-Server-Thread-Pool-and-Thread-Priorities.patch index 3bd7cbcf84..02b480cd0c 100644 --- a/patches/server/0279-Improve-Server-Thread-Pool-and-Thread-Priorities.patch +++ b/patches/server/0278-Improve-Server-Thread-Pool-and-Thread-Priorities.patch @@ -58,7 +58,7 @@ index 336a26733b5bf73455f8ec10347c1e08b8e866f7..4fce18c52c8144460ebf0c1e336dce71 return executorService; } diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index 95f0525bd4ad62853559cc60d5d2b707cffcb727..202802af054b32beb0dc0d5a7f1dbde8748036c1 100644 +index 560e213f39d82613bd1bfcfb4eb3bd7aeed1c0c6..3d1c7bfeafbad2c5b7275f75d263a3817bd3a8aa 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java @@ -306,6 +306,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop> { diff --git a/patches/server/0288-force-entity-dismount-during-teleportation.patch b/patches/server/0287-force-entity-dismount-during-teleportation.patch similarity index 98% rename from patches/server/0288-force-entity-dismount-during-teleportation.patch rename to patches/server/0287-force-entity-dismount-during-teleportation.patch index ac2768d3f0..cdbeee7cd1 100644 --- a/patches/server/0288-force-entity-dismount-during-teleportation.patch +++ b/patches/server/0287-force-entity-dismount-during-teleportation.patch @@ -20,7 +20,7 @@ this is going to be the best soultion all around. Improvements/suggestions welcome! diff --git a/src/main/java/net/minecraft/server/level/ServerPlayer.java b/src/main/java/net/minecraft/server/level/ServerPlayer.java -index ca3206ad7c6e4acf31eda406c439fc7c70e47c01..f95e8e53fc0438858921446f44279f747414b12f 100644 +index 5f10a2d21553a8dc8c03ea5951190860ee5a4615..b81314654d562036680666bd95be4ec21d9b66e1 100644 --- a/src/main/java/net/minecraft/server/level/ServerPlayer.java +++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java @@ -1335,11 +1335,13 @@ public class ServerPlayer extends Player { diff --git a/patches/server/0289-Add-more-Zombie-API.patch b/patches/server/0288-Add-more-Zombie-API.patch similarity index 100% rename from patches/server/0289-Add-more-Zombie-API.patch rename to patches/server/0288-Add-more-Zombie-API.patch diff --git a/patches/server/0290-Book-Size-Limits.patch b/patches/server/0289-Book-Size-Limits.patch similarity index 94% rename from patches/server/0290-Book-Size-Limits.patch rename to patches/server/0289-Book-Size-Limits.patch index 9f1cb31e2d..4a91022d7e 100644 --- a/patches/server/0290-Book-Size-Limits.patch +++ b/patches/server/0289-Book-Size-Limits.patch @@ -6,10 +6,10 @@ Subject: [PATCH] Book Size Limits Puts some limits on the size of books. diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -index e1bd98981239f7dccb0f4560c8db167848fd8376..2205849e8aaa161c5772b39d9368765a552a5a94 100644 +index e107aa00f51430a38e190be6d8b1ccba70a3c055..c1270536fc3566454c98419f4bddc0b3b684d63b 100644 --- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -@@ -1113,6 +1113,45 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic +@@ -1124,6 +1124,45 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic @Override public void handleEditBook(ServerboundEditBookPacket packet) { diff --git a/patches/server/0291-Add-PlayerConnectionCloseEvent.patch b/patches/server/0290-Add-PlayerConnectionCloseEvent.patch similarity index 97% rename from patches/server/0291-Add-PlayerConnectionCloseEvent.patch rename to patches/server/0290-Add-PlayerConnectionCloseEvent.patch index 2f64296ef8..d9509c863c 100644 --- a/patches/server/0291-Add-PlayerConnectionCloseEvent.patch +++ b/patches/server/0290-Add-PlayerConnectionCloseEvent.patch @@ -34,7 +34,7 @@ how PlayerPreLoginEvent interacts with PlayerConnectionCloseEvent is undefined. diff --git a/src/main/java/net/minecraft/network/Connection.java b/src/main/java/net/minecraft/network/Connection.java -index 83c5264e4af146d3712cee4550d84c824a3a96d6..f6162d65d341ef3df1a9b3f45d7d0c25d52f35cf 100644 +index 07fd527dd5b72ecc66311c1b81e578158e12a35c..527acbc15f3fe30541eef555480e158ab83a6130 100644 --- a/src/main/java/net/minecraft/network/Connection.java +++ b/src/main/java/net/minecraft/network/Connection.java @@ -439,6 +439,26 @@ public class Connection extends SimpleChannelInboundHandler> { diff --git a/patches/server/0292-Prevent-Enderman-from-loading-chunks.patch b/patches/server/0291-Prevent-Enderman-from-loading-chunks.patch similarity index 100% rename from patches/server/0292-Prevent-Enderman-from-loading-chunks.patch rename to patches/server/0291-Prevent-Enderman-from-loading-chunks.patch diff --git a/patches/server/0293-Add-APIs-to-replace-OfflinePlayer-getLastPlayed.patch b/patches/server/0292-Add-APIs-to-replace-OfflinePlayer-getLastPlayed.patch similarity index 95% rename from patches/server/0293-Add-APIs-to-replace-OfflinePlayer-getLastPlayed.patch rename to patches/server/0292-Add-APIs-to-replace-OfflinePlayer-getLastPlayed.patch index d105707985..98ca430f21 100644 --- a/patches/server/0293-Add-APIs-to-replace-OfflinePlayer-getLastPlayed.patch +++ b/patches/server/0292-Add-APIs-to-replace-OfflinePlayer-getLastPlayed.patch @@ -16,7 +16,7 @@ intent to remove) and replace it with two new methods, clearly named and documented as to their purpose. diff --git a/src/main/java/net/minecraft/server/level/ServerPlayer.java b/src/main/java/net/minecraft/server/level/ServerPlayer.java -index f95e8e53fc0438858921446f44279f747414b12f..eaf95c84896f71f36e250b3a07bb504230e4d85d 100644 +index b81314654d562036680666bd95be4ec21d9b66e1..3f9b13048eff59094a229d1a41d219bbd7f3eb01 100644 --- a/src/main/java/net/minecraft/server/level/ServerPlayer.java +++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java @@ -230,6 +230,7 @@ public class ServerPlayer extends Player { @@ -28,7 +28,7 @@ index f95e8e53fc0438858921446f44279f747414b12f..eaf95c84896f71f36e250b3a07bb5042 public boolean queueHealthUpdatePacket = false; public net.minecraft.network.protocol.game.ClientboundSetHealthPacket queuedHealthUpdatePacket; diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java -index 734a7b101e5ac9ac4ceb0ba3cb74b94bf2c18683..f6f086d1e5f08e5beae142685cfb682b8e5683f1 100644 +index f8ad63b05ece77cf973ef41ef40111780f0d2d04..bb0c40246f70deecf10b9540d6cba7f65cc91372 100644 --- a/src/main/java/net/minecraft/server/players/PlayerList.java +++ b/src/main/java/net/minecraft/server/players/PlayerList.java @@ -178,6 +178,7 @@ public abstract class PlayerList { @@ -106,7 +106,7 @@ index e7442952ef1f03969949014492a7ddc6d0796ba5..d7823d7dc88cfba6f6ac9dae220e03de public Location getLastDeathLocation() { if (this.getData().contains("LastDeathLocation", 10)) { diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -index df164a6fe8d53d34db93f4f1f2af6a9c1c98a7e8..500c1a317f58c1b24ae1b7cbcd101f1d327e3ae8 100644 +index 0fcde65af63c4fcfbbef5875bec759b209cfd5f1..1a7f5978ad9ab1ee15f2e40e8109cf6dad5f890c 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java @@ -168,6 +168,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player { diff --git a/patches/server/0294-Workaround-for-vehicle-tracking-issue-on-disconnect.patch b/patches/server/0293-Workaround-for-vehicle-tracking-issue-on-disconnect.patch similarity index 91% rename from patches/server/0294-Workaround-for-vehicle-tracking-issue-on-disconnect.patch rename to patches/server/0293-Workaround-for-vehicle-tracking-issue-on-disconnect.patch index 839d91d66d..303280c1ee 100644 --- a/patches/server/0294-Workaround-for-vehicle-tracking-issue-on-disconnect.patch +++ b/patches/server/0293-Workaround-for-vehicle-tracking-issue-on-disconnect.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Workaround for vehicle tracking issue on disconnect diff --git a/src/main/java/net/minecraft/server/level/ServerPlayer.java b/src/main/java/net/minecraft/server/level/ServerPlayer.java -index eaf95c84896f71f36e250b3a07bb504230e4d85d..dff1961404ccbc767624e32a1c5158cbbe63d9f7 100644 +index 3f9b13048eff59094a229d1a41d219bbd7f3eb01..3d85bf30b146401bfdbc4056cdbf03f263b4e9a9 100644 --- a/src/main/java/net/minecraft/server/level/ServerPlayer.java +++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java @@ -1577,6 +1577,13 @@ public class ServerPlayer extends Player { diff --git a/patches/server/0295-Block-Entity-remove-from-being-called-on-Players.patch b/patches/server/0294-Block-Entity-remove-from-being-called-on-Players.patch similarity index 94% rename from patches/server/0295-Block-Entity-remove-from-being-called-on-Players.patch rename to patches/server/0294-Block-Entity-remove-from-being-called-on-Players.patch index ddcc815d8e..d734c87a14 100644 --- a/patches/server/0295-Block-Entity-remove-from-being-called-on-Players.patch +++ b/patches/server/0294-Block-Entity-remove-from-being-called-on-Players.patch @@ -12,7 +12,7 @@ Player we will look at limiting the scope of this change. It appears to be unintentional in the few cases we've seen so far. diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -index 500c1a317f58c1b24ae1b7cbcd101f1d327e3ae8..f201e1b7f4487ce79e296b74e71ed959568fd0ad 100644 +index 1a7f5978ad9ab1ee15f2e40e8109cf6dad5f890c..8a349c179e9abcda140546c56ea884422b409b5d 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java @@ -2557,6 +2557,15 @@ public class CraftPlayer extends CraftHumanEntity implements Player { diff --git a/patches/server/0296-BlockDestroyEvent.patch b/patches/server/0295-BlockDestroyEvent.patch similarity index 100% rename from patches/server/0296-BlockDestroyEvent.patch rename to patches/server/0295-BlockDestroyEvent.patch diff --git a/patches/server/0296-Async-command-map-building.patch b/patches/server/0296-Async-command-map-building.patch new file mode 100644 index 0000000000..8a809e4308 --- /dev/null +++ b/patches/server/0296-Async-command-map-building.patch @@ -0,0 +1,66 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Callahan +Date: Wed, 8 Apr 2020 02:42:14 -0500 +Subject: [PATCH] Async command map building + +This adds a custom pool inorder to make sure that they are closed +without much though, as it doesn't matter if the client is not sent +commands if the server is restarting. Using the default async pool caused issues to arise +due to the shutdown logic generally being much later. + +diff --git a/src/main/java/net/minecraft/commands/Commands.java b/src/main/java/net/minecraft/commands/Commands.java +index 2bf67468a6c745bc6243c65210477ba129bfcb07..c4315531f93f4ed68b4621157b02572886e1ed30 100644 +--- a/src/main/java/net/minecraft/commands/Commands.java ++++ b/src/main/java/net/minecraft/commands/Commands.java +@@ -360,6 +360,24 @@ public class Commands { + if ( org.spigotmc.SpigotConfig.tabComplete < 0 ) return; // Spigot + // CraftBukkit start + // Register Vanilla commands into builtRoot as before ++ // Paper start - Async command map building ++ COMMAND_SENDING_POOL.execute(() -> { ++ this.sendAsync(player); ++ }); ++ } ++ ++ public static final java.util.concurrent.ThreadPoolExecutor COMMAND_SENDING_POOL = new java.util.concurrent.ThreadPoolExecutor( ++ 0, 2, 60L, java.util.concurrent.TimeUnit.SECONDS, ++ new java.util.concurrent.LinkedBlockingQueue<>(), ++ new com.google.common.util.concurrent.ThreadFactoryBuilder() ++ .setNameFormat("Paper Async Command Builder Thread Pool - %1$d") ++ .setUncaughtExceptionHandler(new net.minecraft.DefaultUncaughtExceptionHandlerWithName(net.minecraft.server.MinecraftServer.LOGGER)) ++ .build(), ++ new java.util.concurrent.ThreadPoolExecutor.DiscardPolicy() ++ ); ++ ++ private void sendAsync(ServerPlayer player) { ++ // Paper end - Async command map building + Map, CommandNode> map = Maps.newIdentityHashMap(); // Use identity to prevent aliasing issues + RootCommandNode vanillaRoot = new RootCommandNode(); + +@@ -377,7 +395,14 @@ public class Commands { + for (CommandNode node : rootcommandnode.getChildren()) { + bukkit.add(node.getName()); + } ++ // Paper start - Async command map building ++ net.minecraft.server.MinecraftServer.getServer().execute(() -> { ++ runSync(player, bukkit, rootcommandnode); ++ }); ++ } + ++ private void runSync(ServerPlayer player, Collection bukkit, RootCommandNode rootcommandnode) { ++ // Paper end - Async command map building + PlayerCommandSendEvent event = new PlayerCommandSendEvent(player.getBukkitEntity(), new LinkedHashSet<>(bukkit)); + event.getPlayer().getServer().getPluginManager().callEvent(event); + +diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java +index 89c0c0d0d3458f38a1a0b91617b84f439af667c8..6f6125c3896fb388e0840d3e224b826bfa10eec0 100644 +--- a/src/main/java/net/minecraft/server/MinecraftServer.java ++++ b/src/main/java/net/minecraft/server/MinecraftServer.java +@@ -879,6 +879,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop -Date: Wed, 8 Apr 2020 02:42:14 -0500 -Subject: [PATCH] Async command map building - - -diff --git a/src/main/java/net/minecraft/commands/Commands.java b/src/main/java/net/minecraft/commands/Commands.java -index 2bf67468a6c745bc6243c65210477ba129bfcb07..685e04b1f17938d49cd126bcfe2f488f21afbea2 100644 ---- a/src/main/java/net/minecraft/commands/Commands.java -+++ b/src/main/java/net/minecraft/commands/Commands.java -@@ -34,6 +34,7 @@ import net.minecraft.network.chat.ComponentUtils; - import net.minecraft.network.chat.HoverEvent; - import net.minecraft.network.chat.MutableComponent; - import net.minecraft.network.protocol.game.ClientboundCommandsPacket; -+import net.minecraft.server.MinecraftServer; - import net.minecraft.server.commands.AdvancementCommands; - import net.minecraft.server.commands.AttributeCommand; - import net.minecraft.server.commands.BanIpCommands; -@@ -360,6 +361,12 @@ public class Commands { - if ( org.spigotmc.SpigotConfig.tabComplete < 0 ) return; // Spigot - // CraftBukkit start - // Register Vanilla commands into builtRoot as before -+ // Paper start - Async command map building -+ net.minecraft.server.MCUtil.scheduleAsyncTask(() -> this.sendAsync(player)); -+ } -+ -+ private void sendAsync(ServerPlayer player) { -+ // Paper end - Async command map building - Map, CommandNode> map = Maps.newIdentityHashMap(); // Use identity to prevent aliasing issues - RootCommandNode vanillaRoot = new RootCommandNode(); - -@@ -377,7 +384,14 @@ public class Commands { - for (CommandNode node : rootcommandnode.getChildren()) { - bukkit.add(node.getName()); - } -+ // Paper start - Async command map building -+ MinecraftServer.getServer().execute(() -> { -+ runSync(player, bukkit, rootcommandnode); -+ }); -+ } - -+ private void runSync(ServerPlayer player, Collection bukkit, RootCommandNode rootcommandnode) { -+ // Paper end - Async command map building - PlayerCommandSendEvent event = new PlayerCommandSendEvent(player.getBukkitEntity(), new LinkedHashSet<>(bukkit)); - event.getPlayer().getServer().getPluginManager().callEvent(event); - diff --git a/patches/server/0298-Implement-Brigadier-Mojang-API.patch b/patches/server/0297-Implement-Brigadier-Mojang-API.patch similarity index 60% rename from patches/server/0298-Implement-Brigadier-Mojang-API.patch rename to patches/server/0297-Implement-Brigadier-Mojang-API.patch index bd060fd3ac..df0d54f647 100644 --- a/patches/server/0298-Implement-Brigadier-Mojang-API.patch +++ b/patches/server/0297-Implement-Brigadier-Mojang-API.patch @@ -21,8 +21,20 @@ index 6dbac0f93481256dd57e76630ae9eea9d5c56849..e260462933a9f7065b2360e6bf9e4ee5 // Paper start implementation("org.jline:jline-terminal-jansi:3.21.0") implementation("net.minecrell:terminalconsoleappender:1.3.0") +diff --git a/src/main/java/com/mojang/brigadier/tree/CommandNode.java b/src/main/java/com/mojang/brigadier/tree/CommandNode.java +index da6250df1c5f3385b683cffde47754bca4606f5e..3384501f83d445f45aa8233e98c7597daa67b8ef 100644 +--- a/src/main/java/com/mojang/brigadier/tree/CommandNode.java ++++ b/src/main/java/com/mojang/brigadier/tree/CommandNode.java +@@ -34,6 +34,7 @@ public abstract class CommandNode implements Comparable> { + private final RedirectModifier modifier; + private final boolean forks; + private Command command; ++ public LiteralCommandNode clientNode = null; // Paper + // CraftBukkit start + public void removeCommand(String name) { + this.children.remove(name); diff --git a/src/main/java/net/minecraft/commands/CommandSourceStack.java b/src/main/java/net/minecraft/commands/CommandSourceStack.java -index a749ea8578fc8baeebd359e0275f1c3089beec13..981f08a537253516a6ce8b78f6cd04d7e5e1b546 100644 +index 3308d684fc6cd0a83e190a52693b29d30e0087cb..aadddbc16aa719677c3b6fc4969b6145b9b9ee0b 100644 --- a/src/main/java/net/minecraft/commands/CommandSourceStack.java +++ b/src/main/java/net/minecraft/commands/CommandSourceStack.java @@ -39,7 +39,7 @@ import net.minecraft.world.phys.Vec2; @@ -62,18 +74,18 @@ index a749ea8578fc8baeebd359e0275f1c3089beec13..981f08a537253516a6ce8b78f6cd04d7 public boolean hasPermission(int level) { // CraftBukkit start diff --git a/src/main/java/net/minecraft/commands/Commands.java b/src/main/java/net/minecraft/commands/Commands.java -index 685e04b1f17938d49cd126bcfe2f488f21afbea2..54bf5558c9048c215aee518874f3d96ab473beb6 100644 +index c4315531f93f4ed68b4621157b02572886e1ed30..b141d251eedd31bd115342b878afd68dc51a8518 100644 --- a/src/main/java/net/minecraft/commands/Commands.java +++ b/src/main/java/net/minecraft/commands/Commands.java -@@ -385,6 +385,7 @@ public class Commands { +@@ -396,6 +396,7 @@ public class Commands { bukkit.add(node.getName()); } // Paper start - Async command map building + new com.destroystokyo.paper.event.brigadier.AsyncPlayerSendCommandsEvent(player.getBukkitEntity(), (RootCommandNode) rootcommandnode, false).callEvent(); // Paper - MinecraftServer.getServer().execute(() -> { + net.minecraft.server.MinecraftServer.getServer().execute(() -> { runSync(player, bukkit, rootcommandnode); }); -@@ -392,6 +393,7 @@ public class Commands { +@@ -403,6 +404,7 @@ public class Commands { private void runSync(ServerPlayer player, Collection bukkit, RootCommandNode rootcommandnode) { // Paper end - Async command map building @@ -81,40 +93,54 @@ index 685e04b1f17938d49cd126bcfe2f488f21afbea2..54bf5558c9048c215aee518874f3d96a PlayerCommandSendEvent event = new PlayerCommandSendEvent(player.getBukkitEntity(), new LinkedHashSet<>(bukkit)); event.getPlayer().getServer().getPluginManager().callEvent(event); +@@ -421,6 +423,11 @@ public class Commands { + + while (iterator.hasNext()) { + CommandNode commandnode2 = (CommandNode) iterator.next(); ++ // Paper start ++ if (commandnode2.clientNode != null) { ++ commandnode2 = commandnode2.clientNode; ++ } ++ // Paper end + if ( !org.spigotmc.SpigotConfig.sendNamespaced && commandnode2.getName().contains( ":" ) ) continue; // Spigot + + if (commandnode2.canUse(source)) { diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -index 67399b8881ff24b3465ae23aa6008639abcb4d8e..ed272499b40a96efd83f1a09a063e4d65dbe48e8 100644 +index c1270536fc3566454c98419f4bddc0b3b684d63b..1454d5c070bb004d75523d69eaa3d0d382944198 100644 --- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -@@ -832,8 +832,12 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic - ParseResults parseresults = this.server.getCommands().getDispatcher().parse(stringreader, this.player.createCommandSourceStack()); +@@ -836,8 +836,12 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic + ParseResults parseresults = this.server.getCommands().getDispatcher().parse(stringreader, this.player.createCommandSourceStack()); - this.server.getCommands().getDispatcher().getCompletionSuggestions(parseresults).thenAccept((suggestions) -> { -- if (suggestions.isEmpty()) return; // CraftBukkit - don't send through empty suggestions - prevents [] from showing for plugins with nothing more to offer -- this.connection.send(new ClientboundCommandSuggestionsPacket(packet.getId(), suggestions)); -+ // Paper start -+ com.destroystokyo.paper.event.brigadier.AsyncPlayerSendSuggestionsEvent suggestEvent = new com.destroystokyo.paper.event.brigadier.AsyncPlayerSendSuggestionsEvent(this.getCraftPlayer(), suggestions, buffer); -+ suggestEvent.setCancelled(suggestions.isEmpty()); -+ if (!suggestEvent.callEvent()) return; -+ this.connection.send(new ClientboundCommandSuggestionsPacket(packet.getId(), (com.mojang.brigadier.suggestion.Suggestions) suggestEvent.getSuggestions())); // CraftBukkit - decompile error // Paper -+ // Paper end + this.server.getCommands().getDispatcher().getCompletionSuggestions(parseresults).thenAccept((suggestions) -> { +- if (suggestions.isEmpty()) return; // CraftBukkit - don't send through empty suggestions - prevents [] from showing for plugins with nothing more to offer +- this.connection.send(new ClientboundCommandSuggestionsPacket(packet.getId(), suggestions)); ++ // Paper start - Brigadier API ++ com.destroystokyo.paper.event.brigadier.AsyncPlayerSendSuggestionsEvent suggestEvent = new com.destroystokyo.paper.event.brigadier.AsyncPlayerSendSuggestionsEvent(this.getCraftPlayer(), suggestions, command); ++ suggestEvent.setCancelled(suggestions.isEmpty()); ++ if (!suggestEvent.callEvent()) return; ++ this.connection.send(new ClientboundCommandSuggestionsPacket(packet.getId(), suggestEvent.getSuggestions())); ++ // Paper end - Brigadier API + }); }); + } +@@ -852,7 +856,13 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic + builder.suggest(completion.suggestion(), PaperAdventure.asVanilla(completion.tooltip())); + } }); +- player.connection.send(new ClientboundCommandSuggestionsPacket(packet.getId(), builder.buildFuture().join())); ++ // Paper start - Brigadier API ++ com.mojang.brigadier.suggestion.Suggestions suggestions = builder.buildFuture().join(); ++ com.destroystokyo.paper.event.brigadier.AsyncPlayerSendSuggestionsEvent suggestEvent = new com.destroystokyo.paper.event.brigadier.AsyncPlayerSendSuggestionsEvent(this.getCraftPlayer(), suggestions, command); ++ suggestEvent.setCancelled(suggestions.isEmpty()); ++ if (!suggestEvent.callEvent()) return; ++ this.connection.send(new ClientboundCommandSuggestionsPacket(packet.getId(), suggestEvent.getSuggestions())); ++ // Paper end - Brigadier API } -@@ -842,7 +846,11 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic - - builder = builder.createOffset(builder.getInput().lastIndexOf(' ') + 1); - completions.forEach(builder::suggest); -- player.connection.send(new ClientboundCommandSuggestionsPacket(packet.getId(), builder.buildFuture().join())); -+ com.mojang.brigadier.suggestion.Suggestions suggestions = builder.buildFuture().join(); -+ com.destroystokyo.paper.event.brigadier.AsyncPlayerSendSuggestionsEvent suggestEvent = new com.destroystokyo.paper.event.brigadier.AsyncPlayerSendSuggestionsEvent(this.getCraftPlayer(), suggestions, buffer); -+ suggestEvent.setCancelled(suggestions.isEmpty()); -+ if (!suggestEvent.callEvent()) return; -+ this.connection.send(new ClientboundCommandSuggestionsPacket(packet.getId(), suggestEvent.getSuggestions())); - } + }); // Paper end - async tab completion - } diff --git a/src/main/java/org/bukkit/craftbukkit/command/BukkitCommandWrapper.java b/src/main/java/org/bukkit/craftbukkit/command/BukkitCommandWrapper.java -index 83d81b9371902b0302d13e53b31c15fac4e67966..9e4a660bdeaa70536bd8aeb90aa4a6a979f3f061 100644 +index 83d81b9371902b0302d13e53b31c15fac4e67966..d113e54a30db16e2ad955170df6030d15de530d6 100644 --- a/src/main/java/org/bukkit/craftbukkit/command/BukkitCommandWrapper.java +++ b/src/main/java/org/bukkit/craftbukkit/command/BukkitCommandWrapper.java @@ -20,7 +20,7 @@ import org.bukkit.command.CommandException; @@ -126,7 +152,7 @@ index 83d81b9371902b0302d13e53b31c15fac4e67966..9e4a660bdeaa70536bd8aeb90aa4a6a9 private final CraftServer server; private final Command command; -@@ -31,10 +31,19 @@ public class BukkitCommandWrapper implements com.mojang.brigadier.Command register(CommandDispatcher dispatcher, String label) { @@ -137,6 +163,7 @@ index 83d81b9371902b0302d13e53b31c15fac4e67966..9e4a660bdeaa70536bd8aeb90aa4a6a9 + // Paper start - Expose Brigadier to Paper-MojangAPI + com.mojang.brigadier.tree.RootCommandNode root = dispatcher.getRoot(); + LiteralCommandNode literal = LiteralArgumentBuilder.literal(label).requires(this).executes(this).build(); ++ LiteralCommandNode defaultNode = literal; + com.mojang.brigadier.tree.ArgumentCommandNode defaultArgs = RequiredArgumentBuilder.argument("args", StringArgumentType.greedyString()).suggests(this).executes(this).build(); + literal.addChild(defaultArgs); + com.destroystokyo.paper.event.brigadier.CommandRegisteredEvent event = new com.destroystokyo.paper.event.brigadier.CommandRegisteredEvent<>(label, this, this.command, root, literal, defaultArgs); @@ -144,6 +171,10 @@ index 83d81b9371902b0302d13e53b31c15fac4e67966..9e4a660bdeaa70536bd8aeb90aa4a6a9 + return null; + } + literal = event.getLiteral(); ++ if (event.isRawCommand()) { ++ defaultNode.clientNode = literal; ++ literal = defaultNode; ++ } + root.addChild(literal); + return literal; + // Paper end diff --git a/patches/server/0299-Fix-Custom-Shapeless-Custom-Crafting-Recipes.patch b/patches/server/0298-Fix-Custom-Shapeless-Custom-Crafting-Recipes.patch similarity index 100% rename from patches/server/0299-Fix-Custom-Shapeless-Custom-Crafting-Recipes.patch rename to patches/server/0298-Fix-Custom-Shapeless-Custom-Crafting-Recipes.patch diff --git a/patches/server/0300-Limit-Client-Sign-length-more.patch b/patches/server/0299-Limit-Client-Sign-length-more.patch similarity index 93% rename from patches/server/0300-Limit-Client-Sign-length-more.patch rename to patches/server/0299-Limit-Client-Sign-length-more.patch index 798d1e7df2..7444d0ad49 100644 --- a/patches/server/0300-Limit-Client-Sign-length-more.patch +++ b/patches/server/0299-Limit-Client-Sign-length-more.patch @@ -22,10 +22,10 @@ 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 1454d5c070bb004d75523d69eaa3d0d382944198..db3b208e560ae2c8a59bfb474f7b2266d108068f 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 +@@ -296,6 +296,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic private final LastSeenMessagesValidator lastSeenMessagesValidator; private final FutureChain chatMessageChain; private static final long KEEPALIVE_LIMIT = Long.getLong("paper.playerconnection.keepalive", 30) * 1000; // Paper - provide property to set keepalive limit @@ -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 +@@ -3294,7 +3295,19 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic @Override public void handleSignUpdate(ServerboundSignUpdatePacket packet) { diff --git a/patches/server/0301-Don-t-check-ConvertSigns-boolean-every-sign-save.patch b/patches/server/0300-Don-t-check-ConvertSigns-boolean-every-sign-save.patch similarity index 100% rename from patches/server/0301-Don-t-check-ConvertSigns-boolean-every-sign-save.patch rename to patches/server/0300-Don-t-check-ConvertSigns-boolean-every-sign-save.patch diff --git a/patches/server/0302-Optimize-Network-Manager-and-add-advanced-packet-sup.patch b/patches/server/0301-Optimize-Network-Manager-and-add-advanced-packet-sup.patch similarity index 97% rename from patches/server/0302-Optimize-Network-Manager-and-add-advanced-packet-sup.patch rename to patches/server/0301-Optimize-Network-Manager-and-add-advanced-packet-sup.patch index 214aac2f26..77e32e1bf6 100644 --- a/patches/server/0302-Optimize-Network-Manager-and-add-advanced-packet-sup.patch +++ b/patches/server/0301-Optimize-Network-Manager-and-add-advanced-packet-sup.patch @@ -28,7 +28,7 @@ and then catch exceptions and close if they fire. 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 -index f6162d65d341ef3df1a9b3f45d7d0c25d52f35cf..2d1db70456b746c8fab77893cb34240e573b92ca 100644 +index 527acbc15f3fe30541eef555480e158ab83a6130..31d35af5d0efbd0bd8528c3f05e660a203e67ac9 100644 --- a/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> { @@ -105,7 +105,7 @@ index f6162d65d341ef3df1a9b3f45d7d0c25d52f35cf..2d1db70456b746c8fab77893cb34240e this.send(packet, (PacketSendListener) null); } - public void send(Packet packet, @Nullable PacketSendListener packetsendlistener) { + public void send(Packet packet, @Nullable PacketSendListener callbacks) { - if (this.isConnected()) { - this.flushQueue(); + // Paper start - handle oversized packets better @@ -118,16 +118,16 @@ index f6162d65d341ef3df1a9b3f45d7d0c25d52f35cf..2d1db70456b746c8fab77893cb34240e + net.minecraft.server.MCUtil.isMainThread() && packet.isReady() && this.queue.isEmpty() && + (packet.getExtraPackets() == null || packet.getExtraPackets().isEmpty()) + ))) { - this.sendPacket(packet, packetsendlistener); + this.sendPacket(packet, callbacks); - } else { -- this.queue.add(new Connection.PacketHolder(packet, packetsendlistener)); +- this.queue.add(new Connection.PacketHolder(packet, callbacks)); + return; } + // write the packets to the queue, then flush - antixray hooks there already + java.util.List extraPackets = InnerUtil.buildExtraPackets(packet); + boolean hasExtraPackets = extraPackets != null && !extraPackets.isEmpty(); + if (!hasExtraPackets) { -+ this.queue.add(new Connection.PacketHolder(packet, packetsendlistener)); ++ this.queue.add(new Connection.PacketHolder(packet, callbacks)); + } else { + java.util.List 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 @@ -135,7 +135,7 @@ index f6162d65d341ef3df1a9b3f45d7d0c25d52f35cf..2d1db70456b746c8fab77893cb34240e + for (int i = 0, len = extraPackets.size(); i < len;) { + Packet extra = extraPackets.get(i); + 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 + } @@ -143,7 +143,7 @@ index f6162d65d341ef3df1a9b3f45d7d0c25d52f35cf..2d1db70456b746c8fab77893cb34240e + // 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> { this.setProtocol(packetState); } @@ -159,7 +159,7 @@ index f6162d65d341ef3df1a9b3f45d7d0c25d52f35cf..2d1db70456b746c8fab77893cb34240e + // Paper end ChannelFuture channelfuture = this.channel.writeAndFlush(packet); - if (packetsendlistener != null) { + if (callbacks != null) { @@ -252,28 +336,65 @@ public class Connection extends SimpleChannelInboundHandler> { }); diff --git a/patches/server/0303-Handle-Oversized-Tile-Entities-in-chunks.patch b/patches/server/0302-Handle-Oversized-Tile-Entities-in-chunks.patch similarity index 100% rename from patches/server/0303-Handle-Oversized-Tile-Entities-in-chunks.patch rename to patches/server/0302-Handle-Oversized-Tile-Entities-in-chunks.patch diff --git a/patches/server/0304-Set-Zombie-last-tick-at-start-of-drowning-process.patch b/patches/server/0303-Set-Zombie-last-tick-at-start-of-drowning-process.patch similarity index 100% rename from patches/server/0304-Set-Zombie-last-tick-at-start-of-drowning-process.patch rename to patches/server/0303-Set-Zombie-last-tick-at-start-of-drowning-process.patch diff --git a/patches/server/0305-Call-WhitelistToggleEvent-when-whitelist-is-toggled.patch b/patches/server/0304-Call-WhitelistToggleEvent-when-whitelist-is-toggled.patch similarity index 88% rename from patches/server/0305-Call-WhitelistToggleEvent-when-whitelist-is-toggled.patch rename to patches/server/0304-Call-WhitelistToggleEvent-when-whitelist-is-toggled.patch index 530d742275..5f8a94bdb6 100644 --- a/patches/server/0305-Call-WhitelistToggleEvent-when-whitelist-is-toggled.patch +++ b/patches/server/0304-Call-WhitelistToggleEvent-when-whitelist-is-toggled.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Call WhitelistToggleEvent when whitelist is toggled diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java -index f6f086d1e5f08e5beae142685cfb682b8e5683f1..cf344d87a31d03d87be1df38b772b5301f53e7e7 100644 +index bb0c40246f70deecf10b9540d6cba7f65cc91372..d20954b8d8683d6380ce9f4d87bd2e3a78f7488d 100644 --- a/src/main/java/net/minecraft/server/players/PlayerList.java +++ b/src/main/java/net/minecraft/server/players/PlayerList.java @@ -1128,6 +1128,7 @@ public abstract class PlayerList { diff --git a/patches/server/0306-Entity-getEntitySpawnReason.patch b/patches/server/0305-Entity-getEntitySpawnReason.patch similarity index 98% rename from patches/server/0306-Entity-getEntitySpawnReason.patch rename to patches/server/0305-Entity-getEntitySpawnReason.patch index 7fcb95db67..a02bd42870 100644 --- a/patches/server/0306-Entity-getEntitySpawnReason.patch +++ b/patches/server/0305-Entity-getEntitySpawnReason.patch @@ -22,7 +22,7 @@ index 293657617c32acfe70b0ab98939135e5ac6dae28..6ba45e1322b0d04433b2aac23413a9cd // Paper start if (DEBUG_ENTITIES) { diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java -index cf344d87a31d03d87be1df38b772b5301f53e7e7..9ef845190b47263da8e89c4269d613f6cbf74535 100644 +index d20954b8d8683d6380ce9f4d87bd2e3a78f7488d..7205f17da0383b22b6267843c92b31d8c0556caa 100644 --- a/src/main/java/net/minecraft/server/players/PlayerList.java +++ b/src/main/java/net/minecraft/server/players/PlayerList.java @@ -347,7 +347,7 @@ public abstract class PlayerList { diff --git a/patches/server/0307-Update-entity-Metadata-for-all-tracked-players.patch b/patches/server/0306-Update-entity-Metadata-for-all-tracked-players.patch similarity index 71% rename from patches/server/0307-Update-entity-Metadata-for-all-tracked-players.patch rename to patches/server/0306-Update-entity-Metadata-for-all-tracked-players.patch index 2558096b58..1ca13e50f5 100644 --- a/patches/server/0307-Update-entity-Metadata-for-all-tracked-players.patch +++ b/patches/server/0306-Update-entity-Metadata-for-all-tracked-players.patch @@ -22,22 +22,22 @@ 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 db3b208e560ae2c8a59bfb474f7b2266d108068f..75cd936e28c3c933c53513093634a9d071a7f94b 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 +@@ -2730,7 +2730,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 - ServerGamePacketListenerImpl.this.send(new ClientboundSetEntityDataPacket(entity.getId(), entity.getEntityData(), true)); + // Paper start - update entity for all players -+ ClientboundSetEntityDataPacket packet1 = new ClientboundSetEntityDataPacket(entity.getId(), entity.getEntityData(), true); ++ ClientboundSetEntityDataPacket entityDataPacket = new ClientboundSetEntityDataPacket(entity.getId(), entity.getEntityData(), true); + if (entity.tracker != null) { -+ entity.tracker.broadcast(packet1); ++ entity.tracker.broadcast(entityDataPacket); + } else { -+ ServerGamePacketListenerImpl.this.send(packet1); ++ ServerGamePacketListenerImpl.this.send(entityDataPacket); + } + // Paper end - } - - if (event.isCancelled()) { + // SPIGOT-7136 - Allays + if (entity instanceof Allay) { + ServerGamePacketListenerImpl.this.send(new ClientboundSetEquipmentPacket(entity.getId(), Arrays.stream(net.minecraft.world.entity.EquipmentSlot.values()).map((slot) -> Pair.of(slot, ((LivingEntity) entity).getItemBySlot(slot).copy())).collect(Collectors.toList()))); diff --git a/patches/server/0308-Fire-event-on-GS4-query.patch b/patches/server/0307-Fire-event-on-GS4-query.patch similarity index 100% rename from patches/server/0308-Fire-event-on-GS4-query.patch rename to patches/server/0307-Fire-event-on-GS4-query.patch diff --git a/patches/server/0309-Implement-PlayerPostRespawnEvent.patch b/patches/server/0308-Implement-PlayerPostRespawnEvent.patch similarity index 95% rename from patches/server/0309-Implement-PlayerPostRespawnEvent.patch rename to patches/server/0308-Implement-PlayerPostRespawnEvent.patch index 515beb0674..d5672fc9ce 100644 --- a/patches/server/0309-Implement-PlayerPostRespawnEvent.patch +++ b/patches/server/0308-Implement-PlayerPostRespawnEvent.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Implement PlayerPostRespawnEvent diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java -index 9ef845190b47263da8e89c4269d613f6cbf74535..8c7286176b96bcd6640a78255e0effc22ce06457 100644 +index 7205f17da0383b22b6267843c92b31d8c0556caa..ee4d2f625629cf74f923592f11ecdb312de0c3ff 100644 --- a/src/main/java/net/minecraft/server/players/PlayerList.java +++ b/src/main/java/net/minecraft/server/players/PlayerList.java @@ -727,9 +727,14 @@ public abstract class PlayerList { diff --git a/patches/server/0310-don-t-go-below-0-for-pickupDelay-breaks-picking-up-i.patch b/patches/server/0309-don-t-go-below-0-for-pickupDelay-breaks-picking-up-i.patch similarity index 100% rename from patches/server/0310-don-t-go-below-0-for-pickupDelay-breaks-picking-up-i.patch rename to patches/server/0309-don-t-go-below-0-for-pickupDelay-breaks-picking-up-i.patch diff --git a/patches/server/0311-Server-Tick-Events.patch b/patches/server/0310-Server-Tick-Events.patch similarity index 85% rename from patches/server/0311-Server-Tick-Events.patch rename to patches/server/0310-Server-Tick-Events.patch index 82c99a607c..a9e742012a 100644 --- a/patches/server/0311-Server-Tick-Events.patch +++ b/patches/server/0310-Server-Tick-Events.patch @@ -6,10 +6,10 @@ Subject: [PATCH] Server Tick Events Fires event at start and end of a server tick diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index 1a76a4239213c7b8dc40e656164427c1c4f7c2cf..cadf93de666d9db4b08710e36d4420de312c9e2e 100644 +index 6f6125c3896fb388e0840d3e224b826bfa10eec0..8c48544daae0f18a39511df12f7066fc0e383d2c 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java -@@ -1307,6 +1307,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop CompletableFuture filterTextPacket(T text, BiFunction> bifunction) { + private CompletableFuture filterTextPacket(T text, BiFunction> filterer) { diff --git a/patches/server/0317-Fix-sounds-when-item-frames-are-modified-MC-123450.patch b/patches/server/0316-Fix-sounds-when-item-frames-are-modified-MC-123450.patch similarity index 100% rename from patches/server/0317-Fix-sounds-when-item-frames-are-modified-MC-123450.patch rename to patches/server/0316-Fix-sounds-when-item-frames-are-modified-MC-123450.patch diff --git a/patches/server/0318-Fix-CraftServer-isPrimaryThread-and-MinecraftServer-.patch b/patches/server/0317-Fix-CraftServer-isPrimaryThread-and-MinecraftServer-.patch similarity index 86% rename from patches/server/0318-Fix-CraftServer-isPrimaryThread-and-MinecraftServer-.patch rename to patches/server/0317-Fix-CraftServer-isPrimaryThread-and-MinecraftServer-.patch index 6f41143597..c8325ee866 100644 --- a/patches/server/0318-Fix-CraftServer-isPrimaryThread-and-MinecraftServer-.patch +++ b/patches/server/0317-Fix-CraftServer-isPrimaryThread-and-MinecraftServer-.patch @@ -16,10 +16,10 @@ handling that should have been handled synchronously will be handled synchronously when the server gets shut down. diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index cadf93de666d9db4b08710e36d4420de312c9e2e..4a1a3fd8a6f5b9008cfdad6cb1b20393f8a20530 100644 +index 1d554a45097cdf0640788bb796b983f18af31a9f..f7d7e69e29f217c233869951d7d3188816f8216c 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java -@@ -2310,7 +2310,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop +From: Nassim Jahnke Date: Sat, 11 Sep 2021 11:56:51 +0200 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 0b31a2e2d3bde184c9e1ef9d4ff08e94da0a6960..9d3a88ed093c5eda7a11133ebc97226c544fbd18 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 +@@ -3339,6 +3339,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()); diff --git a/patches/server/0333-Add-option-to-disable-pillager-patrols.patch b/patches/server/0332-Add-option-to-disable-pillager-patrols.patch similarity index 100% rename from patches/server/0333-Add-option-to-disable-pillager-patrols.patch rename to patches/server/0332-Add-option-to-disable-pillager-patrols.patch diff --git a/patches/server/0334-Fix-AssertionError-when-player-hand-set-to-empty-typ.patch b/patches/server/0333-Fix-AssertionError-when-player-hand-set-to-empty-typ.patch similarity index 88% rename from patches/server/0334-Fix-AssertionError-when-player-hand-set-to-empty-typ.patch rename to patches/server/0333-Fix-AssertionError-when-player-hand-set-to-empty-typ.patch index 21fc7d9657..e1945e2b80 100644 --- a/patches/server/0334-Fix-AssertionError-when-player-hand-set-to-empty-typ.patch +++ b/patches/server/0333-Fix-AssertionError-when-player-hand-set-to-empty-typ.patch @@ -7,10 +7,10 @@ Fixes an AssertionError when setting the player's item in hand to null or a new Fixes GH-2718 diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -index e1c413ef1db2c8e3aa2303351ef97aa8deb3da11..97dc7785b50873ee132825bced24cdf2d8217a60 100644 +index 9d3a88ed093c5eda7a11133ebc97226c544fbd18..0df93b204ddf55a2a3b8af33d6a3273697eea91e 100644 --- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -@@ -1857,6 +1857,10 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic +@@ -1870,6 +1870,10 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic this.player.getBukkitEntity().updateInventory(); // SPIGOT-2524 return; } diff --git a/patches/server/0335-Flat-bedrock-generator-settings.patch b/patches/server/0334-Flat-bedrock-generator-settings.patch similarity index 100% rename from patches/server/0335-Flat-bedrock-generator-settings.patch rename to patches/server/0334-Flat-bedrock-generator-settings.patch diff --git a/patches/server/0336-Prevent-sync-chunk-loads-when-villagers-try-to-find-.patch b/patches/server/0335-Prevent-sync-chunk-loads-when-villagers-try-to-find-.patch similarity index 100% rename from patches/server/0336-Prevent-sync-chunk-loads-when-villagers-try-to-find-.patch rename to patches/server/0335-Prevent-sync-chunk-loads-when-villagers-try-to-find-.patch diff --git a/patches/server/0337-MC-145656-Fix-Follow-Range-Initial-Target.patch b/patches/server/0336-MC-145656-Fix-Follow-Range-Initial-Target.patch similarity index 100% rename from patches/server/0337-MC-145656-Fix-Follow-Range-Initial-Target.patch rename to patches/server/0336-MC-145656-Fix-Follow-Range-Initial-Target.patch diff --git a/patches/server/0338-Duplicate-UUID-Resolve-Option.patch b/patches/server/0337-Duplicate-UUID-Resolve-Option.patch similarity index 100% rename from patches/server/0338-Duplicate-UUID-Resolve-Option.patch rename to patches/server/0337-Duplicate-UUID-Resolve-Option.patch diff --git a/patches/server/0339-Optimize-Hoppers.patch b/patches/server/0338-Optimize-Hoppers.patch similarity index 99% rename from patches/server/0339-Optimize-Hoppers.patch rename to patches/server/0338-Optimize-Hoppers.patch index d491d945ce..d598c74d04 100644 --- a/patches/server/0339-Optimize-Hoppers.patch +++ b/patches/server/0338-Optimize-Hoppers.patch @@ -13,10 +13,10 @@ Subject: [PATCH] Optimize Hoppers * Remove Streams from Item Suck In and restore restore 1.12 AABB checks which is simpler and no voxel allocations (was doing TWO Item Suck ins) diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index c774a2e9b55ccb124e923102496af322a9fc1962..8be6de893f1df78afc0e2c023e548a50ff7c2629 100644 +index 5cab48d7db58446310226acfae0dc3fcc1dba920..a02b674a925f2e070ed1bd203de262b513aae0a5 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java -@@ -1410,6 +1410,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop 0; // Paper diff --git a/patches/server/0340-PlayerDeathEvent-shouldDropExperience.patch b/patches/server/0339-PlayerDeathEvent-shouldDropExperience.patch similarity index 91% rename from patches/server/0340-PlayerDeathEvent-shouldDropExperience.patch rename to patches/server/0339-PlayerDeathEvent-shouldDropExperience.patch index e8093541d9..96bde9d37a 100644 --- a/patches/server/0340-PlayerDeathEvent-shouldDropExperience.patch +++ b/patches/server/0339-PlayerDeathEvent-shouldDropExperience.patch @@ -5,7 +5,7 @@ Subject: [PATCH] PlayerDeathEvent#shouldDropExperience diff --git a/src/main/java/net/minecraft/server/level/ServerPlayer.java b/src/main/java/net/minecraft/server/level/ServerPlayer.java -index 78603883ca3246fa411b37fb84497dbb08d9adf0..628ef18b5043504f206c6b60b7805892870e5736 100644 +index 02e81ba08b84f845b57a5148825ceb63313213a6..5dea577aeb4fa627e4c207b8a84933c1f2b63516 100644 --- a/src/main/java/net/minecraft/server/level/ServerPlayer.java +++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java @@ -895,7 +895,7 @@ public class ServerPlayer extends Player { diff --git a/patches/server/0341-Prevent-bees-loading-chunks-checking-hive-position.patch b/patches/server/0340-Prevent-bees-loading-chunks-checking-hive-position.patch similarity index 100% rename from patches/server/0341-Prevent-bees-loading-chunks-checking-hive-position.patch rename to patches/server/0340-Prevent-bees-loading-chunks-checking-hive-position.patch diff --git a/patches/server/0342-Don-t-load-Chunks-from-Hoppers-and-other-things.patch b/patches/server/0341-Don-t-load-Chunks-from-Hoppers-and-other-things.patch similarity index 100% rename from patches/server/0342-Don-t-load-Chunks-from-Hoppers-and-other-things.patch rename to patches/server/0341-Don-t-load-Chunks-from-Hoppers-and-other-things.patch diff --git a/patches/server/0343-Guard-against-serializing-mismatching-chunk-coordina.patch b/patches/server/0342-Guard-against-serializing-mismatching-chunk-coordina.patch similarity index 100% rename from patches/server/0343-Guard-against-serializing-mismatching-chunk-coordina.patch rename to patches/server/0342-Guard-against-serializing-mismatching-chunk-coordina.patch diff --git a/patches/server/0344-Optimise-IEntityAccess-getPlayerByUUID.patch b/patches/server/0343-Optimise-IEntityAccess-getPlayerByUUID.patch similarity index 100% rename from patches/server/0344-Optimise-IEntityAccess-getPlayerByUUID.patch rename to patches/server/0343-Optimise-IEntityAccess-getPlayerByUUID.patch diff --git a/patches/server/0345-Fix-items-not-falling-correctly.patch b/patches/server/0344-Fix-items-not-falling-correctly.patch similarity index 100% rename from patches/server/0345-Fix-items-not-falling-correctly.patch rename to patches/server/0344-Fix-items-not-falling-correctly.patch diff --git a/patches/server/0346-Lag-compensate-eating.patch b/patches/server/0345-Lag-compensate-eating.patch similarity index 100% rename from patches/server/0346-Lag-compensate-eating.patch rename to patches/server/0345-Lag-compensate-eating.patch diff --git a/patches/server/0347-Optimize-call-to-getFluid-for-explosions.patch b/patches/server/0346-Optimize-call-to-getFluid-for-explosions.patch similarity index 100% rename from patches/server/0347-Optimize-call-to-getFluid-for-explosions.patch rename to patches/server/0346-Optimize-call-to-getFluid-for-explosions.patch diff --git a/patches/server/0348-Fix-last-firework-in-stack-not-having-effects-when-d.patch b/patches/server/0347-Fix-last-firework-in-stack-not-having-effects-when-d.patch similarity index 100% rename from patches/server/0348-Fix-last-firework-in-stack-not-having-effects-when-d.patch rename to patches/server/0347-Fix-last-firework-in-stack-not-having-effects-when-d.patch diff --git a/patches/server/0349-Add-effect-to-block-break-naturally.patch b/patches/server/0348-Add-effect-to-block-break-naturally.patch similarity index 100% rename from patches/server/0349-Add-effect-to-block-break-naturally.patch rename to patches/server/0348-Add-effect-to-block-break-naturally.patch diff --git a/patches/server/0350-Entity-Activation-Range-2.0.patch b/patches/server/0349-Entity-Activation-Range-2.0.patch similarity index 92% rename from patches/server/0350-Entity-Activation-Range-2.0.patch rename to patches/server/0349-Entity-Activation-Range-2.0.patch index 0db0537bd0..42ba15ee2c 100644 --- a/patches/server/0350-Entity-Activation-Range-2.0.patch +++ b/patches/server/0349-Entity-Activation-Range-2.0.patch @@ -302,6 +302,44 @@ index f957c0aca36b7228ac3a33ca04c948b1d10642d1..39fc94b1e1555fd6706391223dd27831 super.customServerAiStep(); } +diff --git a/src/main/java/net/minecraft/world/entity/vehicle/MinecartHopper.java b/src/main/java/net/minecraft/world/entity/vehicle/MinecartHopper.java +index 540c23f6297c34cf8e7bf8312ceaa5fc868f414c..2866385a64b22b7dc82b6122c62bcea6b0908a60 100644 +--- a/src/main/java/net/minecraft/world/entity/vehicle/MinecartHopper.java ++++ b/src/main/java/net/minecraft/world/entity/vehicle/MinecartHopper.java +@@ -57,6 +57,7 @@ public class MinecartHopper extends AbstractMinecartContainer implements Hopper + if (bl != this.isEnabled()) { + this.setEnabled(bl); + } ++ this.immunize(); // Paper + + } + +@@ -107,11 +108,13 @@ public class MinecartHopper extends AbstractMinecartContainer implements Hopper + + public boolean suckInItems() { + if (HopperBlockEntity.suckInItems(this.level, this)) { ++ this.immunize(); // Paper + return true; + } else { + List list = this.level.getEntitiesOfClass(ItemEntity.class, this.getBoundingBox().inflate(0.25D, 0.0D, 0.25D), EntitySelector.ENTITY_STILL_ALIVE); + if (!list.isEmpty()) { + HopperBlockEntity.addItem(this, list.get(0)); ++ this.immunize(); // Paper + } + + return false; +@@ -149,4 +152,11 @@ public class MinecartHopper extends AbstractMinecartContainer implements Hopper + public AbstractContainerMenu createMenu(int syncId, Inventory playerInventory) { + return new HopperMenu(syncId, playerInventory, this); + } ++ ++ // Paper start ++ public void immunize() { ++ this.activatedImmunityTick = Math.max(this.activatedImmunityTick, net.minecraft.server.MinecraftServer.currentTick + 20); ++ } ++ // Paper end ++ + } diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java index e6bfc9cdf116b2233a638eec369a80eb8536aa18..4c1d34bd274d8e2a4003a286536652367da9488a 100644 --- a/src/main/java/net/minecraft/world/level/Level.java @@ -335,7 +373,7 @@ index 4b55b667eebfe50dfeda89015112e275e71b9777..dda0b32a4989bbead35a2219a969a30b } } diff --git a/src/main/java/org/spigotmc/ActivationRange.java b/src/main/java/org/spigotmc/ActivationRange.java -index 7bae24598218dcf0012dd21e619e6f5f984bd6f0..c9a032c5331a918453de5e8c6a6d13f5c9f415ee 100644 +index 7bae24598218dcf0012dd21e619e6f5f984bd6f0..0508f43ad396679d3372ae4caf029086a1524109 100644 --- a/src/main/java/org/spigotmc/ActivationRange.java +++ b/src/main/java/org/spigotmc/ActivationRange.java @@ -1,39 +1,52 @@ @@ -498,19 +536,30 @@ index 7bae24598218dcf0012dd21e619e6f5f984bd6f0..c9a032c5331a918453de5e8c6a6d13f5 maxRange = Math.min( ( world.spigotConfig.simulationDistance << 4 ) - 8, maxRange ); for ( Player player : world.players() ) -@@ -132,6 +204,11 @@ public class ActivationRange - ActivationType.RAIDER.boundingBox = player.getBoundingBox().inflate( raiderActivationRange, 256, raiderActivationRange ); - ActivationType.ANIMAL.boundingBox = player.getBoundingBox().inflate( animalActivationRange, 256, animalActivationRange ); - ActivationType.MONSTER.boundingBox = player.getBoundingBox().inflate( monsterActivationRange, 256, monsterActivationRange ); +@@ -127,11 +199,17 @@ public class ActivationRange + continue; + } + +- ActivationRange.maxBB = player.getBoundingBox().inflate( maxRange, 256, maxRange ); +- ActivationType.MISC.boundingBox = player.getBoundingBox().inflate( miscActivationRange, 256, miscActivationRange ); +- ActivationType.RAIDER.boundingBox = player.getBoundingBox().inflate( raiderActivationRange, 256, raiderActivationRange ); +- ActivationType.ANIMAL.boundingBox = player.getBoundingBox().inflate( animalActivationRange, 256, animalActivationRange ); +- ActivationType.MONSTER.boundingBox = player.getBoundingBox().inflate( monsterActivationRange, 256, monsterActivationRange ); + // Paper start -+ ActivationType.WATER.boundingBox = player.getBoundingBox().inflate( waterActivationRange, 256, waterActivationRange ); -+ ActivationType.FLYING_MONSTER.boundingBox = player.getBoundingBox().inflate( flyingActivationRange, 256, flyingActivationRange ); -+ ActivationType.VILLAGER.boundingBox = player.getBoundingBox().inflate( villagerActivationRange, 256, villagerActivationRange ); ++ int worldHeight = world.getHeight(); ++ ActivationRange.maxBB = player.getBoundingBox().inflate( maxRange, worldHeight, maxRange ); ++ ActivationType.MISC.boundingBox = player.getBoundingBox().inflate( miscActivationRange, worldHeight, miscActivationRange ); ++ ActivationType.RAIDER.boundingBox = player.getBoundingBox().inflate( raiderActivationRange, worldHeight, raiderActivationRange ); ++ ActivationType.ANIMAL.boundingBox = player.getBoundingBox().inflate( animalActivationRange, worldHeight, animalActivationRange ); ++ ActivationType.MONSTER.boundingBox = player.getBoundingBox().inflate( monsterActivationRange, worldHeight, monsterActivationRange ); ++ ActivationType.WATER.boundingBox = player.getBoundingBox().inflate( waterActivationRange, worldHeight, waterActivationRange ); ++ ActivationType.FLYING_MONSTER.boundingBox = player.getBoundingBox().inflate( flyingActivationRange, worldHeight, flyingActivationRange ); ++ ActivationType.VILLAGER.boundingBox = player.getBoundingBox().inflate( villagerActivationRange, worldHeight, villagerActivationRange ); + // Paper end world.getEntities().get(maxBB, ActivationRange::activateEntity); } -@@ -166,60 +243,118 @@ public class ActivationRange +@@ -166,60 +244,118 @@ public class ActivationRange * @param entity * @return */ @@ -646,7 +695,7 @@ index 7bae24598218dcf0012dd21e619e6f5f984bd6f0..c9a032c5331a918453de5e8c6a6d13f5 } /** -@@ -234,8 +369,19 @@ public class ActivationRange +@@ -234,8 +370,19 @@ public class ActivationRange if ( entity instanceof FireworkRocketEntity ) { return true; } @@ -667,7 +716,7 @@ index 7bae24598218dcf0012dd21e619e6f5f984bd6f0..c9a032c5331a918453de5e8c6a6d13f5 // Should this entity tick? if ( !isActive ) -@@ -243,15 +389,19 @@ public class ActivationRange +@@ -243,15 +390,19 @@ public class ActivationRange if ( ( MinecraftServer.currentTick - entity.activatedTick - 1 ) % 20 == 0 ) { // Check immunities every 20 ticks. diff --git a/patches/server/0351-Increase-Light-Queue-Size.patch b/patches/server/0350-Increase-Light-Queue-Size.patch similarity index 93% rename from patches/server/0351-Increase-Light-Queue-Size.patch rename to patches/server/0350-Increase-Light-Queue-Size.patch index e60d563086..5545385865 100644 --- a/patches/server/0351-Increase-Light-Queue-Size.patch +++ b/patches/server/0350-Increase-Light-Queue-Size.patch @@ -14,7 +14,7 @@ light engine on shutdown... The queue size only puts a cap on max loss, doesn't solve that problem. diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index 8be6de893f1df78afc0e2c023e548a50ff7c2629..b04c5433a1e2cdfe69c5b5cbe77b867ebd55c126 100644 +index a02b674a925f2e070ed1bd203de262b513aae0a5..181e35da5919ba3b91246b427f2c5773acf1dd12 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java @@ -780,7 +780,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop implements PaletteResize, PalettedContainer @@ -1551,10 +1551,10 @@ index cf48c93d89da53e0ec771e5c2c8582e30b35e3f5..518dfbb7dbd4221937636cf46d27109d } diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -index 97a0bb12b1158618e86bb0fbab64985faa3d1cec..08dad640ae4315d0746587d91deb4709231c2bcc 100644 +index c125f4ba687d7622290da3f0e0fef5a8a859b4d2..3a183c9c85439d9595cc5667743cd7f41cc8c727 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -@@ -2228,7 +2228,7 @@ public final class CraftServer implements Server { +@@ -2235,7 +2235,7 @@ public final class CraftServer implements Server { public ChunkGenerator.ChunkData createChunkData(World world) { Validate.notNull(world, "World cannot be null"); ServerLevel handle = ((CraftWorld) world).getHandle(); diff --git a/patches/server/0354-Implement-alternative-item-despawn-rate.patch b/patches/server/0353-Implement-alternative-item-despawn-rate.patch similarity index 100% rename from patches/server/0354-Implement-alternative-item-despawn-rate.patch rename to patches/server/0353-Implement-alternative-item-despawn-rate.patch diff --git a/patches/server/0355-Tracking-Range-Improvements.patch b/patches/server/0354-Tracking-Range-Improvements.patch similarity index 100% rename from patches/server/0355-Tracking-Range-Improvements.patch rename to patches/server/0354-Tracking-Range-Improvements.patch diff --git a/patches/server/0356-Fix-items-vanishing-through-end-portal.patch b/patches/server/0355-Fix-items-vanishing-through-end-portal.patch similarity index 100% rename from patches/server/0356-Fix-items-vanishing-through-end-portal.patch rename to patches/server/0355-Fix-items-vanishing-through-end-portal.patch diff --git a/patches/server/0357-implement-optional-per-player-mob-spawns.patch b/patches/server/0356-implement-optional-per-player-mob-spawns.patch similarity index 99% rename from patches/server/0357-implement-optional-per-player-mob-spawns.patch rename to patches/server/0356-implement-optional-per-player-mob-spawns.patch index 2bc510b602..64254218d1 100644 --- a/patches/server/0357-implement-optional-per-player-mob-spawns.patch +++ b/patches/server/0356-implement-optional-per-player-mob-spawns.patch @@ -377,7 +377,7 @@ index d66ec02b09bb7ae46aae8e55f00626139f074ae3..de5b80fce9757517e51f2ef55340e884 this.lastSpawnState = spawnercreature_d; diff --git a/src/main/java/net/minecraft/server/level/ServerPlayer.java b/src/main/java/net/minecraft/server/level/ServerPlayer.java -index 628ef18b5043504f206c6b60b7805892870e5736..75bcab623004159f36a5a976c7b6f69873a108dd 100644 +index 5dea577aeb4fa627e4c207b8a84933c1f2b63516..1796e81889d62b691b7a709616ce08f155733597 100644 --- a/src/main/java/net/minecraft/server/level/ServerPlayer.java +++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java @@ -235,6 +235,11 @@ public class ServerPlayer extends Player { diff --git a/patches/server/0358-Avoid-hopper-searches-if-there-are-no-items.patch b/patches/server/0357-Avoid-hopper-searches-if-there-are-no-items.patch similarity index 100% rename from patches/server/0358-Avoid-hopper-searches-if-there-are-no-items.patch rename to patches/server/0357-Avoid-hopper-searches-if-there-are-no-items.patch diff --git a/patches/server/0359-Bees-get-gravity-in-void.-Fixes-MC-167279.patch b/patches/server/0358-Bees-get-gravity-in-void.-Fixes-MC-167279.patch similarity index 100% rename from patches/server/0359-Bees-get-gravity-in-void.-Fixes-MC-167279.patch rename to patches/server/0358-Bees-get-gravity-in-void.-Fixes-MC-167279.patch diff --git a/patches/server/0360-Optimise-getChunkAt-calls-for-loaded-chunks.patch b/patches/server/0359-Optimise-getChunkAt-calls-for-loaded-chunks.patch similarity index 100% rename from patches/server/0360-Optimise-getChunkAt-calls-for-loaded-chunks.patch rename to patches/server/0359-Optimise-getChunkAt-calls-for-loaded-chunks.patch diff --git a/patches/server/0361-Add-debug-for-sync-chunk-loads.patch b/patches/server/0360-Add-debug-for-sync-chunk-loads.patch similarity index 100% rename from patches/server/0361-Add-debug-for-sync-chunk-loads.patch rename to patches/server/0360-Add-debug-for-sync-chunk-loads.patch diff --git a/patches/server/0362-Remove-garbage-Java-version-check.patch b/patches/server/0361-Remove-garbage-Java-version-check.patch similarity index 86% rename from patches/server/0362-Remove-garbage-Java-version-check.patch rename to patches/server/0361-Remove-garbage-Java-version-check.patch index d13eb8982a..c878e14d14 100644 --- a/patches/server/0362-Remove-garbage-Java-version-check.patch +++ b/patches/server/0361-Remove-garbage-Java-version-check.patch @@ -1,11 +1,11 @@ From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: Nassim Jahnke +From: Nassim Jahnke Date: Wed, 16 Mar 2022 13:58:16 +0100 Subject: [PATCH] Remove garbage Java version check diff --git a/src/main/java/org/bukkit/craftbukkit/Main.java b/src/main/java/org/bukkit/craftbukkit/Main.java -index beb12dcc620d902594dbe6ba2893062fadb97dc5..9a5373304b445408244fe9850c10526d1df21855 100644 +index 2febe4c031cbd03a9d61dae64fbfa9312e5b752c..3472114c373d7b884d8ae24906e30daa039d0742 100644 --- a/src/main/java/org/bukkit/craftbukkit/Main.java +++ b/src/main/java/org/bukkit/craftbukkit/Main.java @@ -194,10 +194,6 @@ public class Main { diff --git a/patches/server/0363-Add-ThrownEggHatchEvent.patch b/patches/server/0362-Add-ThrownEggHatchEvent.patch similarity index 100% rename from patches/server/0363-Add-ThrownEggHatchEvent.patch rename to patches/server/0362-Add-ThrownEggHatchEvent.patch diff --git a/patches/server/0364-Entity-Jump-API.patch b/patches/server/0363-Entity-Jump-API.patch similarity index 100% rename from patches/server/0364-Entity-Jump-API.patch rename to patches/server/0363-Entity-Jump-API.patch diff --git a/patches/server/0365-Add-option-to-nerf-pigmen-from-nether-portals.patch b/patches/server/0364-Add-option-to-nerf-pigmen-from-nether-portals.patch similarity index 100% rename from patches/server/0365-Add-option-to-nerf-pigmen-from-nether-portals.patch rename to patches/server/0364-Add-option-to-nerf-pigmen-from-nether-portals.patch diff --git a/patches/server/0366-Make-the-GUI-graph-fancier.patch b/patches/server/0365-Make-the-GUI-graph-fancier.patch similarity index 100% rename from patches/server/0366-Make-the-GUI-graph-fancier.patch rename to patches/server/0365-Make-the-GUI-graph-fancier.patch diff --git a/patches/server/0367-add-hand-to-BlockMultiPlaceEvent.patch b/patches/server/0366-add-hand-to-BlockMultiPlaceEvent.patch similarity index 100% rename from patches/server/0367-add-hand-to-BlockMultiPlaceEvent.patch rename to patches/server/0366-add-hand-to-BlockMultiPlaceEvent.patch diff --git a/patches/server/0368-Validate-tripwire-hook-placement-before-update.patch b/patches/server/0367-Validate-tripwire-hook-placement-before-update.patch similarity index 100% rename from patches/server/0368-Validate-tripwire-hook-placement-before-update.patch rename to patches/server/0367-Validate-tripwire-hook-placement-before-update.patch diff --git a/patches/server/0369-Add-option-to-allow-iron-golems-to-spawn-in-air.patch b/patches/server/0368-Add-option-to-allow-iron-golems-to-spawn-in-air.patch similarity index 100% rename from patches/server/0369-Add-option-to-allow-iron-golems-to-spawn-in-air.patch rename to patches/server/0368-Add-option-to-allow-iron-golems-to-spawn-in-air.patch diff --git a/patches/server/0370-Configurable-chance-of-villager-zombie-infection.patch b/patches/server/0369-Configurable-chance-of-villager-zombie-infection.patch similarity index 100% rename from patches/server/0370-Configurable-chance-of-villager-zombie-infection.patch rename to patches/server/0369-Configurable-chance-of-villager-zombie-infection.patch diff --git a/patches/server/0371-Optimise-Chunk-getFluid.patch b/patches/server/0370-Optimise-Chunk-getFluid.patch similarity index 100% rename from patches/server/0371-Optimise-Chunk-getFluid.patch rename to patches/server/0370-Optimise-Chunk-getFluid.patch diff --git a/patches/server/0372-Set-spigots-verbose-world-setting-to-false-by-def.patch b/patches/server/0371-Set-spigots-verbose-world-setting-to-false-by-def.patch similarity index 100% rename from patches/server/0372-Set-spigots-verbose-world-setting-to-false-by-def.patch rename to patches/server/0371-Set-spigots-verbose-world-setting-to-false-by-def.patch diff --git a/patches/server/0373-Add-tick-times-API-and-mspt-command.patch b/patches/server/0372-Add-tick-times-API-and-mspt-command.patch similarity index 95% rename from patches/server/0373-Add-tick-times-API-and-mspt-command.patch rename to patches/server/0372-Add-tick-times-API-and-mspt-command.patch index 812faa072a..b45a036e40 100644 --- a/patches/server/0373-Add-tick-times-API-and-mspt-command.patch +++ b/patches/server/0372-Add-tick-times-API-and-mspt-command.patch @@ -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 b04c5433a1e2cdfe69c5b5cbe77b867ebd55c126..d8166025ddd229c065e8c4c3082549f1716c0384 100644 +index 27f19abc22e295a5480dbed5df86f5d885ad3b73..12ca13f5b0556c53fd36d638ee4fa854b89ee8ec 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 { CompletableFuture completablefuture; diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java -index d67362983816db2b264d30b59423b05843cded16..f5f536549d7daf14ed5f678a55969c540a5dc48d 100644 +index 27dd95242c80d875de8f07e111f06e383eeec0d9..97c670508df6e5ee2a05a4765aafbeb23949b647 100644 --- a/src/main/java/net/minecraft/server/players/PlayerList.java +++ b/src/main/java/net/minecraft/server/players/PlayerList.java @@ -517,7 +517,7 @@ public abstract class PlayerList { @@ -330,10 +330,10 @@ index 5f65aa89dfb21fced457a3a9fef6ba05385b6b76..291bcca206722c86bca6d13058d18c41 final String msg = String.format("BlockEntity threw exception at %s:%s,%s,%s", LevelChunk.this.getLevel().getWorld().getName(), this.getPos().getX(), this.getPos().getY(), this.getPos().getZ()); net.minecraft.server.MinecraftServer.LOGGER.error(msg, throwable); diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -index 4b3a431701fa1e1e1595301291baccd5bafa52f6..b5ed78fa95349974c71ac7113e5f6533bec9385e 100644 +index a35501ea43bf3589b346b1e684c318b44ca57977..4016b31bd020e00c0e79328646f9b5411b312e88 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -@@ -2073,7 +2073,7 @@ public final class CraftServer implements Server { +@@ -2075,7 +2075,7 @@ public final class CraftServer implements Server { @Override public boolean isPrimaryThread() { @@ -343,7 +343,7 @@ index 4b3a431701fa1e1e1595301291baccd5bafa52f6..b5ed78fa95349974c71ac7113e5f6533 // Paper start diff --git a/src/main/java/org/bukkit/craftbukkit/Main.java b/src/main/java/org/bukkit/craftbukkit/Main.java -index 9a5373304b445408244fe9850c10526d1df21855..0c76f2e8038bf0bc3edf464295c606acf03a8337 100644 +index 3472114c373d7b884d8ae24906e30daa039d0742..987bc4577190d827718b5144656aaddf22599cab 100644 --- a/src/main/java/org/bukkit/craftbukkit/Main.java +++ b/src/main/java/org/bukkit/craftbukkit/Main.java @@ -12,6 +12,8 @@ import java.util.logging.Level; diff --git a/patches/server/0386-Optimize-Pathfinding.patch b/patches/server/0385-Optimize-Pathfinding.patch similarity index 100% rename from patches/server/0386-Optimize-Pathfinding.patch rename to patches/server/0385-Optimize-Pathfinding.patch diff --git a/patches/server/0387-Reduce-Either-Optional-allocation.patch b/patches/server/0386-Reduce-Either-Optional-allocation.patch similarity index 100% rename from patches/server/0387-Reduce-Either-Optional-allocation.patch rename to patches/server/0386-Reduce-Either-Optional-allocation.patch diff --git a/patches/server/0388-Reduce-memory-footprint-of-NBTTagCompound.patch b/patches/server/0387-Reduce-memory-footprint-of-NBTTagCompound.patch similarity index 100% rename from patches/server/0388-Reduce-memory-footprint-of-NBTTagCompound.patch rename to patches/server/0387-Reduce-memory-footprint-of-NBTTagCompound.patch diff --git a/patches/server/0389-Prevent-opening-inventories-when-frozen.patch b/patches/server/0388-Prevent-opening-inventories-when-frozen.patch similarity index 97% rename from patches/server/0389-Prevent-opening-inventories-when-frozen.patch rename to patches/server/0388-Prevent-opening-inventories-when-frozen.patch index 0d1a9b5a4f..80482901c6 100644 --- a/patches/server/0389-Prevent-opening-inventories-when-frozen.patch +++ b/patches/server/0388-Prevent-opening-inventories-when-frozen.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Prevent opening inventories when frozen diff --git a/src/main/java/net/minecraft/server/level/ServerPlayer.java b/src/main/java/net/minecraft/server/level/ServerPlayer.java -index 104d8dd2941da8153fdeb799c48f884c33e3e585..0b173c66aaab86ca33eb32ac912543ebcb7c380d 100644 +index c2f9933796904628a55476eb9be1204b766893cf..5e1bb276d61ed72027f94defc3f192756af5808f 100644 --- a/src/main/java/net/minecraft/server/level/ServerPlayer.java +++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java @@ -621,7 +621,7 @@ public class ServerPlayer extends Player { diff --git a/patches/server/0390-Optimise-ArraySetSorted-removeIf.patch b/patches/server/0389-Optimise-ArraySetSorted-removeIf.patch similarity index 100% rename from patches/server/0390-Optimise-ArraySetSorted-removeIf.patch rename to patches/server/0389-Optimise-ArraySetSorted-removeIf.patch diff --git a/patches/server/0391-Don-t-run-entity-collision-code-if-not-needed.patch b/patches/server/0390-Don-t-run-entity-collision-code-if-not-needed.patch similarity index 100% rename from patches/server/0391-Don-t-run-entity-collision-code-if-not-needed.patch rename to patches/server/0390-Don-t-run-entity-collision-code-if-not-needed.patch diff --git a/patches/server/0392-Implement-Player-Client-Options-API.patch b/patches/server/0391-Implement-Player-Client-Options-API.patch similarity index 96% rename from patches/server/0392-Implement-Player-Client-Options-API.patch rename to patches/server/0391-Implement-Player-Client-Options-API.patch index b5d5a0ca99..9b8bf897e3 100644 --- a/patches/server/0392-Implement-Player-Client-Options-API.patch +++ b/patches/server/0391-Implement-Player-Client-Options-API.patch @@ -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 5e1bb276d61ed72027f94defc3f192756af5808f..2a18a60fdb71f1c665bda4a6c04a1fa1ff47a83b 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 8a349c179e9abcda140546c56ea884422b409b5d..71b96630dd6543d8a4d8df5165d7182fb0f35067 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 { diff --git a/patches/server/0393-Don-t-crash-if-player-is-attempted-to-be-removed-fro.patch b/patches/server/0392-Don-t-crash-if-player-is-attempted-to-be-removed-fro.patch similarity index 100% rename from patches/server/0393-Don-t-crash-if-player-is-attempted-to-be-removed-fro.patch rename to patches/server/0392-Don-t-crash-if-player-is-attempted-to-be-removed-fro.patch diff --git a/patches/server/0394-Fix-Chunk-Post-Processing-deadlock-risk.patch b/patches/server/0393-Fix-Chunk-Post-Processing-deadlock-risk.patch similarity index 100% rename from patches/server/0394-Fix-Chunk-Post-Processing-deadlock-risk.patch rename to patches/server/0393-Fix-Chunk-Post-Processing-deadlock-risk.patch diff --git a/patches/server/0395-Fix-Longstanding-Broken-behavior-of-PlayerJoinEvent.patch b/patches/server/0394-Fix-Longstanding-Broken-behavior-of-PlayerJoinEvent.patch similarity index 96% rename from patches/server/0395-Fix-Longstanding-Broken-behavior-of-PlayerJoinEvent.patch rename to patches/server/0394-Fix-Longstanding-Broken-behavior-of-PlayerJoinEvent.patch index 0cb0f66de7..1ba8c296be 100644 --- a/patches/server/0395-Fix-Longstanding-Broken-behavior-of-PlayerJoinEvent.patch +++ b/patches/server/0394-Fix-Longstanding-Broken-behavior-of-PlayerJoinEvent.patch @@ -40,7 +40,7 @@ index 0fdf33bfab3191dbb582bc401f6f0b62aadacb4e..5187988a22b55ac783147afe455a1396 if (!(entity instanceof EnderDragonPart)) { EntityType entitytypes = entity.getType(); diff --git a/src/main/java/net/minecraft/server/level/ServerPlayer.java b/src/main/java/net/minecraft/server/level/ServerPlayer.java -index db8400c7ca9aad9aeee192427661c76778bf9e47..3a40d6fe9edbd997dc9a6b8ac009c3f621ecfe51 100644 +index 2a18a60fdb71f1c665bda4a6c04a1fa1ff47a83b..084521ed853fc2b15be355a17da8421c54716815 100644 --- a/src/main/java/net/minecraft/server/level/ServerPlayer.java +++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java @@ -254,6 +254,7 @@ public class ServerPlayer extends Player { @@ -52,7 +52,7 @@ index db8400c7ca9aad9aeee192427661c76778bf9e47..3a40d6fe9edbd997dc9a6b8ac009c3f6 public String kickLeaveMessage = null; // SPIGOT-3034: Forward leave message to PlayerQuitEvent // CraftBukkit end diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java -index f5f536549d7daf14ed5f678a55969c540a5dc48d..1f32ba033eedcb69b02c29da8594be9edf958f43 100644 +index 97c670508df6e5ee2a05a4765aafbeb23949b647..b48641bbe371ffacbbd659a0ee1783437267a4dc 100644 --- a/src/main/java/net/minecraft/server/players/PlayerList.java +++ b/src/main/java/net/minecraft/server/players/PlayerList.java @@ -281,6 +281,12 @@ public abstract class PlayerList { diff --git a/patches/server/0396-Load-Chunks-for-Login-Asynchronously.patch b/patches/server/0395-Load-Chunks-for-Login-Asynchronously.patch similarity index 95% rename from patches/server/0396-Load-Chunks-for-Login-Asynchronously.patch rename to patches/server/0395-Load-Chunks-for-Login-Asynchronously.patch index 10b8a465a9..95c4327444 100644 --- a/patches/server/0396-Load-Chunks-for-Login-Asynchronously.patch +++ b/patches/server/0395-Load-Chunks-for-Login-Asynchronously.patch @@ -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 -index 3a40d6fe9edbd997dc9a6b8ac009c3f621ecfe51..8dc31f65126db6b2527d4106a885cb9b6dbc7a75 100644 +index 084521ed853fc2b15be355a17da8421c54716815..acc64abd9420b81ed4c8c17cf6a9f5bc5d35f116 100644 --- a/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 { @@ -37,10 +37,10 @@ index be677d437d17b74c6188ce1bd5fc6fdc228fd92f..78fbb4c3e52e900956ae0811aaf934c8 public static final TicketType UNKNOWN = TicketType.create("unknown", Comparator.comparingLong(ChunkPos::toLong), 1); public static final TicketType 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 -index e1e35bd6fb827149b23da4d19876a9a6989dde7e..4408c30532119277abb1027cd5a08e4cb9ebe587 100644 +index 0df93b204ddf55a2a3b8af33d6a3273697eea91e..cadc14777f6a978d4a58bbaf1b606a53c28b2c08 100644 --- a/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 +@@ -254,6 +254,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic private static final int PENDING_MESSAGE_DISCONNECT_THRESHOLD = 4096; public final Connection connection; private final MinecraftServer server; @@ -48,7 +48,7 @@ index e1e35bd6fb827149b23da4d19876a9a6989dde7e..4408c30532119277abb1027cd5a08e4c public ServerPlayer player; private int tickCount; private int ackBlockChangesUpTo = -1; -@@ -343,6 +344,15 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic +@@ -346,6 +347,15 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic @Override public void tick() { @@ -64,7 +64,7 @@ index e1e35bd6fb827149b23da4d19876a9a6989dde7e..4408c30532119277abb1027cd5a08e4c if (this.ackBlockChangesUpTo > -1) { this.send(new ClientboundBlockChangedAckPacket(this.ackBlockChangesUpTo)); this.ackBlockChangesUpTo = -1; -@@ -389,7 +399,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic +@@ -392,7 +402,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic this.lastVehicle = null; this.clientVehicleIsFloating = false; this.aboveGroundVehicleTickCount = 0; @@ -74,10 +74,10 @@ index e1e35bd6fb827149b23da4d19876a9a6989dde7e..4408c30532119277abb1027cd5a08e4c this.server.getProfiler().push("keepAlive"); // 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 -index 63abdc84bbd8d3ef78e18ffe792f2f1e5035e2ff..11a7b79b25f3ad83687f6f9076231e227ebea165 100644 +index c83395364edb4f2ba8515326b19c4f1a436a0502..c99266d4782c5d58339e63f7564c28b4b5b7ac1d 100644 --- a/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 +@@ -90,7 +90,7 @@ public class ServerLoginPacketListenerImpl implements TickablePacketListener, Se } // Paper end } else if (this.state == ServerLoginPacketListenerImpl.State.DELAY_ACCEPT) { @@ -86,7 +86,7 @@ index 63abdc84bbd8d3ef78e18ffe792f2f1e5035e2ff..11a7b79b25f3ad83687f6f9076231e22 if (entityplayer == null) { this.state = ServerLoginPacketListenerImpl.State.READY_TO_ACCEPT; -@@ -204,7 +204,7 @@ public class ServerLoginPacketListenerImpl implements TickablePacketListener, Se +@@ -199,7 +199,7 @@ public class ServerLoginPacketListenerImpl implements TickablePacketListener, Se } this.connection.send(new ClientboundGameProfilePacket(this.gameProfile)); @@ -96,7 +96,7 @@ index 63abdc84bbd8d3ef78e18ffe792f2f1e5035e2ff..11a7b79b25f3ad83687f6f9076231e22 try { 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 -index 1f32ba033eedcb69b02c29da8594be9edf958f43..4173c9c364be3a266a8ba43b384ee230e6f98f62 100644 +index b48641bbe371ffacbbd659a0ee1783437267a4dc..0d86536696657ba6eee5f12d3d3afa8e5a167060 100644 --- a/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 { diff --git a/patches/server/0397-Move-player-to-spawn-point-if-spawn-in-unloaded-worl.patch b/patches/server/0396-Move-player-to-spawn-point-if-spawn-in-unloaded-worl.patch similarity index 100% rename from patches/server/0397-Move-player-to-spawn-point-if-spawn-in-unloaded-worl.patch rename to patches/server/0396-Move-player-to-spawn-point-if-spawn-in-unloaded-worl.patch diff --git a/patches/server/0398-Add-PlayerAttackEntityCooldownResetEvent.patch b/patches/server/0397-Add-PlayerAttackEntityCooldownResetEvent.patch similarity index 100% rename from patches/server/0398-Add-PlayerAttackEntityCooldownResetEvent.patch rename to patches/server/0397-Add-PlayerAttackEntityCooldownResetEvent.patch diff --git a/patches/server/0399-Don-t-fire-BlockFade-on-worldgen-threads.patch b/patches/server/0398-Don-t-fire-BlockFade-on-worldgen-threads.patch similarity index 100% rename from patches/server/0399-Don-t-fire-BlockFade-on-worldgen-threads.patch rename to patches/server/0398-Don-t-fire-BlockFade-on-worldgen-threads.patch diff --git a/patches/server/0400-Add-phantom-creative-and-insomniac-controls.patch b/patches/server/0399-Add-phantom-creative-and-insomniac-controls.patch similarity index 100% rename from patches/server/0400-Add-phantom-creative-and-insomniac-controls.patch rename to patches/server/0399-Add-phantom-creative-and-insomniac-controls.patch diff --git a/patches/server/0401-Fix-numerous-item-duplication-issues-and-teleport-is.patch b/patches/server/0400-Fix-numerous-item-duplication-issues-and-teleport-is.patch similarity index 100% rename from patches/server/0401-Fix-numerous-item-duplication-issues-and-teleport-is.patch rename to patches/server/0400-Fix-numerous-item-duplication-issues-and-teleport-is.patch diff --git a/patches/server/0402-Villager-Restocks-API.patch b/patches/server/0401-Villager-Restocks-API.patch similarity index 100% rename from patches/server/0402-Villager-Restocks-API.patch rename to patches/server/0401-Villager-Restocks-API.patch diff --git a/patches/server/0403-Validate-PickItem-Packet-and-kick-for-invalid.patch b/patches/server/0402-Validate-PickItem-Packet-and-kick-for-invalid.patch similarity index 91% rename from patches/server/0403-Validate-PickItem-Packet-and-kick-for-invalid.patch rename to patches/server/0402-Validate-PickItem-Packet-and-kick-for-invalid.patch index 7a5ea4882c..93013fac5b 100644 --- a/patches/server/0403-Validate-PickItem-Packet-and-kick-for-invalid.patch +++ b/patches/server/0402-Validate-PickItem-Packet-and-kick-for-invalid.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Validate PickItem Packet and kick for invalid diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -index bb870abae77d8fbf107bc9596637d4fac204c501..569a8b6889e7085e3e408ebd47a71e8b5af8ca5e 100644 +index cadc14777f6a978d4a58bbaf1b606a53c28b2c08..7b6dedcf405e3f9ff85ebe8702ab6459385c5ff9 100644 --- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -@@ -960,7 +960,14 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic +@@ -973,7 +973,14 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic @Override public void handlePickItem(ServerboundPickItemPacket packet) { PacketUtils.ensureRunningOnSameThread(packet, this, this.player.getLevel()); diff --git a/patches/server/0404-Expose-game-version.patch b/patches/server/0403-Expose-game-version.patch similarity index 82% rename from patches/server/0404-Expose-game-version.patch rename to patches/server/0403-Expose-game-version.patch index 566af6eac3..82cea73f25 100644 --- a/patches/server/0404-Expose-game-version.patch +++ b/patches/server/0403-Expose-game-version.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Expose game version diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -index b5ed78fa95349974c71ac7113e5f6533bec9385e..d45d1ec667fba102a20f62df1b207a95b06318b7 100644 +index bfd785af2d459061054a101def1a6c6bfd9cdda1..ed74a0295d3ade16cd3120ef6abc391f662b1263 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -@@ -577,6 +577,13 @@ public final class CraftServer implements Server { +@@ -579,6 +579,13 @@ public final class CraftServer implements Server { return this.bukkitVersion; } diff --git a/patches/server/0405-Optimize-Voxel-Shape-Merging.patch b/patches/server/0404-Optimize-Voxel-Shape-Merging.patch similarity index 100% rename from patches/server/0405-Optimize-Voxel-Shape-Merging.patch rename to patches/server/0404-Optimize-Voxel-Shape-Merging.patch diff --git a/patches/server/0406-Set-cap-on-JDK-per-thread-native-byte-buffer-cache.patch b/patches/server/0405-Set-cap-on-JDK-per-thread-native-byte-buffer-cache.patch similarity index 93% rename from patches/server/0406-Set-cap-on-JDK-per-thread-native-byte-buffer-cache.patch rename to patches/server/0405-Set-cap-on-JDK-per-thread-native-byte-buffer-cache.patch index 51d1a58f90..6c54f83680 100644 --- a/patches/server/0406-Set-cap-on-JDK-per-thread-native-byte-buffer-cache.patch +++ b/patches/server/0405-Set-cap-on-JDK-per-thread-native-byte-buffer-cache.patch @@ -17,7 +17,7 @@ keeping long lived large direct buffers in cache. Set system properly at server startup if not set already to help protect from this. diff --git a/src/main/java/org/bukkit/craftbukkit/Main.java b/src/main/java/org/bukkit/craftbukkit/Main.java -index 0c76f2e8038bf0bc3edf464295c606acf03a8337..c55ae77807e0ec3698f0d0443caaf18928b41017 100644 +index 987bc4577190d827718b5144656aaddf22599cab..5b48047242e20c216b110502935763ea433c55cd 100644 --- a/src/main/java/org/bukkit/craftbukkit/Main.java +++ b/src/main/java/org/bukkit/craftbukkit/Main.java @@ -28,6 +28,7 @@ public class Main { diff --git a/patches/server/0407-misc-debugging-dumps.patch b/patches/server/0406-misc-debugging-dumps.patch similarity index 90% rename from patches/server/0407-misc-debugging-dumps.patch rename to patches/server/0406-misc-debugging-dumps.patch index 159e6cfb11..1471756c75 100644 --- a/patches/server/0407-misc-debugging-dumps.patch +++ b/patches/server/0406-misc-debugging-dumps.patch @@ -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 -index e25451056b6eedde2c5ffc281918ca13967e0a67..af2d703fe3cb74ced502ca89c5bf6ca1f47474bb 100644 +index 40945909bbefa59da6be784bcf440dfb2075b670..b1f8374253d04d1468f5d57792b30f91a274b97f 100644 --- a/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 set, boolean flag) { diff --git a/patches/server/0409-Deobfuscate-stacktraces-in-log-messages-crash-report.patch b/patches/server/0408-Deobfuscate-stacktraces-in-log-messages-crash-report.patch similarity index 96% rename from patches/server/0409-Deobfuscate-stacktraces-in-log-messages-crash-report.patch rename to patches/server/0408-Deobfuscate-stacktraces-in-log-messages-crash-report.patch index d7720a7c27..3f3a055bc6 100644 --- a/patches/server/0409-Deobfuscate-stacktraces-in-log-messages-crash-report.patch +++ b/patches/server/0408-Deobfuscate-stacktraces-in-log-messages-crash-report.patch @@ -502,7 +502,7 @@ index f114d5dab86aa2cdd59c78406c9d82f9caededca..99fa9f1952ee7ed79b223ff210a658e4 } } diff --git a/src/main/java/net/minecraft/network/Connection.java b/src/main/java/net/minecraft/network/Connection.java -index 2d1db70456b746c8fab77893cb34240e573b92ca..7e11d760f84d2cda85e686c5eca764e666e9389f 100644 +index 31d35af5d0efbd0bd8528c3f05e660a203e67ac9..7f0bcb69a1a14a01bd80ffcba1afb25ceeab19b8 100644 --- a/src/main/java/net/minecraft/network/Connection.java +++ b/src/main/java/net/minecraft/network/Connection.java @@ -62,13 +62,13 @@ public class Connection extends SimpleChannelInboundHandler> { @@ -522,19 +522,6 @@ index 2d1db70456b746c8fab77893cb34240e573b92ca..7e11d760f84d2cda85e686c5eca764e6 }); private final PacketFlow receiving; private final Queue 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 { 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 diff --git a/patches/server/0410-Implement-Mob-Goal-API.patch b/patches/server/0409-Implement-Mob-Goal-API.patch similarity index 99% rename from patches/server/0410-Implement-Mob-Goal-API.patch rename to patches/server/0409-Implement-Mob-Goal-API.patch index e0089a0954..954ff6a36b 100644 --- a/patches/server/0410-Implement-Mob-Goal-API.patch +++ b/patches/server/0409-Implement-Mob-Goal-API.patch @@ -789,10 +789,10 @@ index 4379b9948f1eecfe6fd7dea98e298ad5f761019a..3f081183521603824430709886a9cc31 LOOK, JUMP, diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -index 96e4ba547472cbb29009574458865090d63464e3..9933bd2998e2b3723ee87e4f6710f74758bd8107 100644 +index 8d0a4c3e7fc49bac8af97e8a086f7c12ce874f86..5ac4ff48b631649eac804553faf67330e9827806 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -@@ -2684,5 +2684,11 @@ public final class CraftServer implements Server { +@@ -2691,5 +2691,11 @@ public final class CraftServer implements Server { public boolean isStopping() { return net.minecraft.server.MinecraftServer.getServer().hasStopped(); } diff --git a/patches/server/0411-Add-villager-reputation-API.patch b/patches/server/0410-Add-villager-reputation-API.patch similarity index 100% rename from patches/server/0411-Add-villager-reputation-API.patch rename to patches/server/0410-Add-villager-reputation-API.patch diff --git a/patches/server/0412-Option-for-maximum-exp-value-when-merging-orbs.patch b/patches/server/0411-Option-for-maximum-exp-value-when-merging-orbs.patch similarity index 100% rename from patches/server/0412-Option-for-maximum-exp-value-when-merging-orbs.patch rename to patches/server/0411-Option-for-maximum-exp-value-when-merging-orbs.patch diff --git a/patches/server/0413-ExperienceOrbMergeEvent.patch b/patches/server/0412-ExperienceOrbMergeEvent.patch similarity index 100% rename from patches/server/0413-ExperienceOrbMergeEvent.patch rename to patches/server/0412-ExperienceOrbMergeEvent.patch diff --git a/patches/server/0414-Fix-PotionEffect-ignores-icon-flag.patch b/patches/server/0413-Fix-PotionEffect-ignores-icon-flag.patch similarity index 100% rename from patches/server/0414-Fix-PotionEffect-ignores-icon-flag.patch rename to patches/server/0413-Fix-PotionEffect-ignores-icon-flag.patch diff --git a/patches/server/0415-Optimize-brigadier-child-sorting-performance.patch b/patches/server/0414-Optimize-brigadier-child-sorting-performance.patch similarity index 89% rename from patches/server/0415-Optimize-brigadier-child-sorting-performance.patch rename to patches/server/0414-Optimize-brigadier-child-sorting-performance.patch index 2d398241d6..3651f34b15 100644 --- a/patches/server/0415-Optimize-brigadier-child-sorting-performance.patch +++ b/patches/server/0414-Optimize-brigadier-child-sorting-performance.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Optimize brigadier child sorting performance diff --git a/src/main/java/com/mojang/brigadier/tree/CommandNode.java b/src/main/java/com/mojang/brigadier/tree/CommandNode.java -index da6250df1c5f3385b683cffde47754bca4606f5e..a4f97c1df86c574af9b9824a38034a3d76d6e357 100644 +index 3384501f83d445f45aa8233e98c7597daa67b8ef..20a7cdf87f307878d66922aaac0c60cff218e46c 100644 --- a/src/main/java/com/mojang/brigadier/tree/CommandNode.java +++ b/src/main/java/com/mojang/brigadier/tree/CommandNode.java @@ -26,7 +26,7 @@ import java.util.function.Predicate; @@ -17,7 +17,7 @@ index da6250df1c5f3385b683cffde47754bca4606f5e..a4f97c1df86c574af9b9824a38034a3d private final Map> literals = new LinkedHashMap<>(); private final Map> arguments = new LinkedHashMap<>(); public Predicate requirement; -@@ -106,6 +106,8 @@ public abstract class CommandNode implements Comparable> { +@@ -107,6 +107,8 @@ public abstract class CommandNode implements Comparable> { this.arguments.put(node.getName(), (ArgumentCommandNode) node); } } diff --git a/patches/server/0416-Potential-bed-API.patch b/patches/server/0415-Potential-bed-API.patch similarity index 100% rename from patches/server/0416-Potential-bed-API.patch rename to patches/server/0415-Potential-bed-API.patch diff --git a/patches/server/0417-Wait-for-Async-Tasks-during-shutdown.patch b/patches/server/0416-Wait-for-Async-Tasks-during-shutdown.patch similarity index 89% rename from patches/server/0417-Wait-for-Async-Tasks-during-shutdown.patch rename to patches/server/0416-Wait-for-Async-Tasks-during-shutdown.patch index dea6993d32..f30ef49645 100644 --- a/patches/server/0417-Wait-for-Async-Tasks-during-shutdown.patch +++ b/patches/server/0416-Wait-for-Async-Tasks-during-shutdown.patch @@ -10,10 +10,10 @@ Adds a 5 second grace period for any async tasks to finish and warns if any are still running after that delay just as reload does. diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index af2d703fe3cb74ced502ca89c5bf6ca1f47474bb..8e74c4b6b5186663537be304cfe462bb462e92f9 100644 +index b1f8374253d04d1468f5d57792b30f91a274b97f..b6a05542a42b1f44b3a43fbcd333003e864e44ea 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java -@@ -910,6 +910,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop comparator; diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java -index 1d5a8cf65b5eb4aa9b2e316d23cf9e9d13500fed..6e433410e5d26627b553c0aabd965da10da9307f 100644 +index 559db90e1ba3d636ea080f47cdf274d11a1bcb89..de84400b0565843a7314a7c8032d14cdadccdb73 100644 --- a/src/main/java/net/minecraft/server/players/PlayerList.java +++ b/src/main/java/net/minecraft/server/players/PlayerList.java @@ -179,6 +179,7 @@ public abstract class PlayerList { @@ -1194,7 +1194,7 @@ index b234ba968e82ddf1e8f7c84d3a17659e3beda2b3..af22fa8aa8ddef4d592564b14d0114cc net.minecraft.world.level.chunk.LevelChunk chunk = (net.minecraft.world.level.chunk.LevelChunk) either.left().orElse(null); if (chunk != null) addTicket(x, z); // Paper diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -index 5f50296f2f2b1c5a68309de9687d7c7c6a2ede3b..593925b1f20f94d7cd25492e0a70b9558c8b63c6 100644 +index 71b96630dd6543d8a4d8df5165d7182fb0f35067..ac232efad56fd69577de8fa4ed47cb852c9a429e 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java @@ -1047,6 +1047,16 @@ public class CraftPlayer extends CraftHumanEntity implements Player { diff --git a/patches/server/0463-Optimize-NetworkManager-Exception-Handling.patch b/patches/server/0462-Optimize-NetworkManager-Exception-Handling.patch similarity index 100% rename from patches/server/0463-Optimize-NetworkManager-Exception-Handling.patch rename to patches/server/0462-Optimize-NetworkManager-Exception-Handling.patch diff --git a/patches/server/0464-Optimize-the-advancement-data-player-iteration-to-be.patch b/patches/server/0463-Optimize-the-advancement-data-player-iteration-to-be.patch similarity index 100% rename from patches/server/0464-Optimize-the-advancement-data-player-iteration-to-be.patch rename to patches/server/0463-Optimize-the-advancement-data-player-iteration-to-be.patch diff --git a/patches/server/0465-Fix-arrows-never-despawning-MC-125757.patch b/patches/server/0464-Fix-arrows-never-despawning-MC-125757.patch similarity index 100% rename from patches/server/0465-Fix-arrows-never-despawning-MC-125757.patch rename to patches/server/0464-Fix-arrows-never-despawning-MC-125757.patch diff --git a/patches/server/0466-Thread-Safe-Vanilla-Command-permission-checking.patch b/patches/server/0465-Thread-Safe-Vanilla-Command-permission-checking.patch similarity index 91% rename from patches/server/0466-Thread-Safe-Vanilla-Command-permission-checking.patch rename to patches/server/0465-Thread-Safe-Vanilla-Command-permission-checking.patch index 8d25b8b504..09b482e662 100644 --- a/patches/server/0466-Thread-Safe-Vanilla-Command-permission-checking.patch +++ b/patches/server/0465-Thread-Safe-Vanilla-Command-permission-checking.patch @@ -9,10 +9,10 @@ to race conditions. Plus, .canUse we want to be safe for async anyways. diff --git a/src/main/java/com/mojang/brigadier/tree/CommandNode.java b/src/main/java/com/mojang/brigadier/tree/CommandNode.java -index a4f97c1df86c574af9b9824a38034a3d76d6e357..d65defd5fc54086a969c568b93dfb05f40dd5a44 100644 +index 20a7cdf87f307878d66922aaac0c60cff218e46c..39844531b03eb8a6c70700b4ecbf0ff1a557424d 100644 --- a/src/main/java/com/mojang/brigadier/tree/CommandNode.java +++ b/src/main/java/com/mojang/brigadier/tree/CommandNode.java -@@ -74,10 +74,10 @@ public abstract class CommandNode implements Comparable> { +@@ -75,10 +75,10 @@ public abstract class CommandNode implements Comparable> { public synchronized boolean canUse(final S source) { if (source instanceof CommandSourceStack) { try { @@ -26,7 +26,7 @@ index a4f97c1df86c574af9b9824a38034a3d76d6e357..d65defd5fc54086a969c568b93dfb05f } // CraftBukkit end diff --git a/src/main/java/net/minecraft/commands/CommandSourceStack.java b/src/main/java/net/minecraft/commands/CommandSourceStack.java -index 981f08a537253516a6ce8b78f6cd04d7e5e1b546..b14773074fc4b10ef427eb0ad9e21601a7287901 100644 +index aadddbc16aa719677c3b6fc4969b6145b9b9ee0b..6fdbe747645eb83f31b56bca77a9d7962237aed8 100644 --- a/src/main/java/net/minecraft/commands/CommandSourceStack.java +++ b/src/main/java/net/minecraft/commands/CommandSourceStack.java @@ -59,7 +59,7 @@ public class CommandSourceStack implements SharedSuggestionProvider, com.destroy diff --git a/patches/server/0467-Fix-SPIGOT-5989.patch b/patches/server/0466-Fix-SPIGOT-5989.patch similarity index 97% rename from patches/server/0467-Fix-SPIGOT-5989.patch rename to patches/server/0466-Fix-SPIGOT-5989.patch index 63815ae54f..a968772ada 100644 --- a/patches/server/0467-Fix-SPIGOT-5989.patch +++ b/patches/server/0466-Fix-SPIGOT-5989.patch @@ -10,7 +10,7 @@ This fixes that by checking if the modified spawn location is still at a respawn anchor. diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java -index e6bc6c1d9dae3e20d3cb937f06f935e22df55200..0b39ddc1bbf4cc20cd3867e57a983678a5cf0568 100644 +index de84400b0565843a7314a7c8032d14cdadccdb73..8c1b6aa3957a988656eeb2ad6323fdbd2f67cd19 100644 --- a/src/main/java/net/minecraft/server/players/PlayerList.java +++ b/src/main/java/net/minecraft/server/players/PlayerList.java @@ -836,6 +836,7 @@ public abstract class PlayerList { diff --git a/patches/server/0468-Fix-SPIGOT-5824-Bukkit-world-container-is-not-used.patch b/patches/server/0467-Fix-SPIGOT-5824-Bukkit-world-container-is-not-used.patch similarity index 100% rename from patches/server/0468-Fix-SPIGOT-5824-Bukkit-world-container-is-not-used.patch rename to patches/server/0467-Fix-SPIGOT-5824-Bukkit-world-container-is-not-used.patch diff --git a/patches/server/0469-Fix-SPIGOT-5885-Unable-to-disable-advancements.patch b/patches/server/0468-Fix-SPIGOT-5885-Unable-to-disable-advancements.patch similarity index 100% rename from patches/server/0469-Fix-SPIGOT-5885-Unable-to-disable-advancements.patch rename to patches/server/0468-Fix-SPIGOT-5885-Unable-to-disable-advancements.patch diff --git a/patches/server/0470-Fix-AdvancementDataPlayer-leak-due-from-quitting-ear.patch b/patches/server/0469-Fix-AdvancementDataPlayer-leak-due-from-quitting-ear.patch similarity index 100% rename from patches/server/0470-Fix-AdvancementDataPlayer-leak-due-from-quitting-ear.patch rename to patches/server/0469-Fix-AdvancementDataPlayer-leak-due-from-quitting-ear.patch diff --git a/patches/server/0471-Add-missing-strikeLighting-call-to-World-spigot-stri.patch b/patches/server/0470-Add-missing-strikeLighting-call-to-World-spigot-stri.patch similarity index 100% rename from patches/server/0471-Add-missing-strikeLighting-call-to-World-spigot-stri.patch rename to patches/server/0470-Add-missing-strikeLighting-call-to-World-spigot-stri.patch diff --git a/patches/server/0472-Fix-some-rails-connecting-improperly.patch b/patches/server/0471-Fix-some-rails-connecting-improperly.patch similarity index 100% rename from patches/server/0472-Fix-some-rails-connecting-improperly.patch rename to patches/server/0471-Fix-some-rails-connecting-improperly.patch diff --git a/patches/server/0473-Fix-regex-mistake-in-CB-NBT-int-deserialization.patch b/patches/server/0472-Fix-regex-mistake-in-CB-NBT-int-deserialization.patch similarity index 100% rename from patches/server/0473-Fix-regex-mistake-in-CB-NBT-int-deserialization.patch rename to patches/server/0472-Fix-regex-mistake-in-CB-NBT-int-deserialization.patch diff --git a/patches/server/0474-Do-not-let-the-server-load-chunks-from-newer-version.patch b/patches/server/0473-Do-not-let-the-server-load-chunks-from-newer-version.patch similarity index 100% rename from patches/server/0474-Do-not-let-the-server-load-chunks-from-newer-version.patch rename to patches/server/0473-Do-not-let-the-server-load-chunks-from-newer-version.patch diff --git a/patches/server/0475-Brand-support.patch b/patches/server/0474-Brand-support.patch similarity index 89% rename from patches/server/0475-Brand-support.patch rename to patches/server/0474-Brand-support.patch index 9163787c48..37cf273f1b 100644 --- a/patches/server/0475-Brand-support.patch +++ b/patches/server/0474-Brand-support.patch @@ -5,10 +5,10 @@ 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 4e8977ab293816fa5dee530eea63193dcc9162b9..40487804d50798a5bfd05754fb882d82a7b7a693 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 +@@ -299,6 +299,8 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic private static final long KEEPALIVE_LIMIT = Long.getLong("paper.playerconnection.keepalive", 30) * 1000; // Paper - provide property to set keepalive limit private static final int MAX_SIGN_LINE_LENGTH = Integer.getInteger("Paper.maxSignLength", 80); // Paper @@ -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 +@@ -3461,6 +3463,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 +@@ -3488,6 +3492,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 +@@ -3497,6 +3510,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 8db930d54ad97435e367aa670466d8a072ca0b23..1ab74f26cf47372b89b74a077fe06e48f08581a7 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 { diff --git a/patches/server/0476-Add-setMaxPlayers-API.patch b/patches/server/0475-Add-setMaxPlayers-API.patch similarity index 86% rename from patches/server/0476-Add-setMaxPlayers-API.patch rename to patches/server/0475-Add-setMaxPlayers-API.patch index dc1fa81eb8..d0c4c40d25 100644 --- a/patches/server/0476-Add-setMaxPlayers-API.patch +++ b/patches/server/0475-Add-setMaxPlayers-API.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Add #setMaxPlayers API diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java -index ec0ceaac85b5868849b6399cdf8eb2b4447508e3..32f8a030abb81aa29cab9432b72f9b522f1f6aa6 100644 +index 8c1b6aa3957a988656eeb2ad6323fdbd2f67cd19..67c50a329e7bdf4056a1217963e29e8ceb99b20f 100644 --- a/src/main/java/net/minecraft/server/players/PlayerList.java +++ b/src/main/java/net/minecraft/server/players/PlayerList.java @@ -147,7 +147,7 @@ public abstract class PlayerList { @@ -18,10 +18,10 @@ index ec0ceaac85b5868849b6399cdf8eb2b4447508e3..32f8a030abb81aa29cab9432b72f9b52 private int simulationDistance; private boolean allowCheatsForAllPlayers; diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -index 2d7de60d7e663b91f0a72241f24913338bd725dd..57c4871b977a31f55e5c39aba4159b39b1ac325d 100644 +index c7a6143ebb2ed0a0977e1d38c8adcccf09800638..72e545e9aa01ad7ae4180d5421e16e330b4c9934 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -@@ -672,6 +672,13 @@ public final class CraftServer implements Server { +@@ -674,6 +674,13 @@ public final class CraftServer implements Server { return this.playerList.getMaxPlayers(); } diff --git a/patches/server/0477-Add-playPickupItemAnimation-to-LivingEntity.patch b/patches/server/0476-Add-playPickupItemAnimation-to-LivingEntity.patch similarity index 100% rename from patches/server/0477-Add-playPickupItemAnimation-to-LivingEntity.patch rename to patches/server/0476-Add-playPickupItemAnimation-to-LivingEntity.patch diff --git a/patches/server/0478-Don-t-require-FACING-data.patch b/patches/server/0477-Don-t-require-FACING-data.patch similarity index 100% rename from patches/server/0478-Don-t-require-FACING-data.patch rename to patches/server/0477-Don-t-require-FACING-data.patch diff --git a/patches/server/0479-Fix-SpawnChangeEvent-not-firing-for-all-use-cases.patch b/patches/server/0478-Fix-SpawnChangeEvent-not-firing-for-all-use-cases.patch similarity index 100% rename from patches/server/0479-Fix-SpawnChangeEvent-not-firing-for-all-use-cases.patch rename to patches/server/0478-Fix-SpawnChangeEvent-not-firing-for-all-use-cases.patch diff --git a/patches/server/0480-Add-moon-phase-API.patch b/patches/server/0479-Add-moon-phase-API.patch similarity index 100% rename from patches/server/0480-Add-moon-phase-API.patch rename to patches/server/0479-Add-moon-phase-API.patch diff --git a/patches/server/0481-Improve-Chunk-Status-Transition-Speed.patch b/patches/server/0480-Improve-Chunk-Status-Transition-Speed.patch similarity index 100% rename from patches/server/0481-Improve-Chunk-Status-Transition-Speed.patch rename to patches/server/0480-Improve-Chunk-Status-Transition-Speed.patch diff --git a/patches/server/0482-Prevent-headless-pistons-from-being-created.patch b/patches/server/0481-Prevent-headless-pistons-from-being-created.patch similarity index 100% rename from patches/server/0482-Prevent-headless-pistons-from-being-created.patch rename to patches/server/0481-Prevent-headless-pistons-from-being-created.patch diff --git a/patches/server/0483-Add-BellRingEvent.patch b/patches/server/0482-Add-BellRingEvent.patch similarity index 100% rename from patches/server/0483-Add-BellRingEvent.patch rename to patches/server/0482-Add-BellRingEvent.patch diff --git a/patches/server/0484-Add-zombie-targets-turtle-egg-config.patch b/patches/server/0483-Add-zombie-targets-turtle-egg-config.patch similarity index 100% rename from patches/server/0484-Add-zombie-targets-turtle-egg-config.patch rename to patches/server/0483-Add-zombie-targets-turtle-egg-config.patch diff --git a/patches/server/0485-Buffer-joins-to-world.patch b/patches/server/0484-Buffer-joins-to-world.patch similarity index 95% rename from patches/server/0485-Buffer-joins-to-world.patch rename to patches/server/0484-Buffer-joins-to-world.patch index ddbece7c78..f21684f9df 100644 --- a/patches/server/0485-Buffer-joins-to-world.patch +++ b/patches/server/0484-Buffer-joins-to-world.patch @@ -8,7 +8,7 @@ the world per tick, this attempts to reduce the impact that join floods has on the server diff --git a/src/main/java/net/minecraft/network/Connection.java b/src/main/java/net/minecraft/network/Connection.java -index 7e11d760f84d2cda85e686c5eca764e666e9389f..65c2263f8872fba4f68779e0e90ea5f96aefdfbd 100644 +index 7f0bcb69a1a14a01bd80ffcba1afb25ceeab19b8..4d2b26fb1ac5663b667ffd16eed379f4a3311677 100644 --- a/src/main/java/net/minecraft/network/Connection.java +++ b/src/main/java/net/minecraft/network/Connection.java @@ -396,8 +396,23 @@ public class Connection extends SimpleChannelInboundHandler> { diff --git a/patches/server/0486-Eigencraft-redstone-implementation.patch b/patches/server/0485-Eigencraft-redstone-implementation.patch similarity index 100% rename from patches/server/0486-Eigencraft-redstone-implementation.patch rename to patches/server/0485-Eigencraft-redstone-implementation.patch diff --git a/patches/server/0487-Fix-hex-colors-not-working-in-some-kick-messages.patch b/patches/server/0486-Fix-hex-colors-not-working-in-some-kick-messages.patch similarity index 95% rename from patches/server/0487-Fix-hex-colors-not-working-in-some-kick-messages.patch rename to patches/server/0486-Fix-hex-colors-not-working-in-some-kick-messages.patch index f4a48df6f5..c4f76a0ad7 100644 --- a/patches/server/0487-Fix-hex-colors-not-working-in-some-kick-messages.patch +++ b/patches/server/0486-Fix-hex-colors-not-working-in-some-kick-messages.patch @@ -25,10 +25,10 @@ index 43759cdf3da0796d7969c6504ac9a6986c0f0518..750fef0f5b908b776a7306e54653eba4 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 -index 40b27dbdc15e07a6a9d63d41babe5ed0245c0e0b..0ad129adf726049c62f8d5c816cc32b3b6b9b2eb 100644 +index d477e9fbe6ffb600d08f8ba49741067d14348968..2f0a70bc9cc8cda9e9beef00421078c036d6287c 100644 --- a/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 +@@ -108,7 +108,7 @@ public class ServerLoginPacketListenerImpl implements TickablePacketListener, Se // CraftBukkit start @Deprecated public void disconnect(String s) { diff --git a/patches/server/0488-PortalCreateEvent-needs-to-know-its-entity.patch b/patches/server/0487-PortalCreateEvent-needs-to-know-its-entity.patch similarity index 100% rename from patches/server/0488-PortalCreateEvent-needs-to-know-its-entity.patch rename to patches/server/0487-PortalCreateEvent-needs-to-know-its-entity.patch diff --git a/patches/server/0489-Fix-CraftTeam-null-check.patch b/patches/server/0488-Fix-CraftTeam-null-check.patch similarity index 100% rename from patches/server/0489-Fix-CraftTeam-null-check.patch rename to patches/server/0488-Fix-CraftTeam-null-check.patch diff --git a/patches/server/0490-Add-more-Evoker-API.patch b/patches/server/0489-Add-more-Evoker-API.patch similarity index 100% rename from patches/server/0490-Add-more-Evoker-API.patch rename to patches/server/0489-Add-more-Evoker-API.patch diff --git a/patches/server/0491-Add-methods-to-get-translation-keys.patch b/patches/server/0490-Add-methods-to-get-translation-keys.patch similarity index 98% rename from patches/server/0491-Add-methods-to-get-translation-keys.patch rename to patches/server/0490-Add-methods-to-get-translation-keys.patch index 3085ca118e..5a5b0a4cd6 100644 --- a/patches/server/0491-Add-methods-to-get-translation-keys.patch +++ b/patches/server/0490-Add-methods-to-get-translation-keys.patch @@ -42,7 +42,7 @@ index a859a675b4bc543e139358223cc92ad5eee3ddb5..31a22f26070059e5379730c1940ff1c5 public net.minecraft.world.item.enchantment.Enchantment getHandle() { diff --git a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java -index 61668447c4314562109e31bd5ca48da181e98529..79bd1a6d4003f990e667e9d66605e6cc74e05eee 100644 +index 6fefc65c6f9364d71e4e410972dfd79d97fdae3e..c65cc24fbd8b6cb9828fbc978c21c3f7ef9171a3 100644 --- a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java +++ b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java @@ -478,6 +478,30 @@ public final class CraftMagicNumbers implements UnsafeValues { diff --git a/patches/server/0492-Create-HoverEvent-from-ItemStack-Entity.patch b/patches/server/0491-Create-HoverEvent-from-ItemStack-Entity.patch similarity index 100% rename from patches/server/0492-Create-HoverEvent-from-ItemStack-Entity.patch rename to patches/server/0491-Create-HoverEvent-from-ItemStack-Entity.patch diff --git a/patches/server/0493-Cache-block-data-strings.patch b/patches/server/0492-Cache-block-data-strings.patch similarity index 95% rename from patches/server/0493-Cache-block-data-strings.patch rename to patches/server/0492-Cache-block-data-strings.patch index 7453cf6b1e..6258b9db9a 100644 --- a/patches/server/0493-Cache-block-data-strings.patch +++ b/patches/server/0492-Cache-block-data-strings.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Cache block data strings diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index b8b82e9fe3273e3b53c4877e47b74f0db4dd8630..ff2d51aa788d8605f901fa592491b5d2d0da27d1 100644 +index 48650bc1c09b18f1b57d9828dfe27f51c74c4a75..dbe70160ac703e74613ac65bd62950a5cc951d4c 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java -@@ -2015,6 +2015,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop 1.0D) { -@@ -1401,9 +1423,9 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic +@@ -1414,9 +1436,9 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic AABB axisalignedbb = this.player.getBoundingBox(); diff --git a/patches/server/0506-Optimise-getType-calls.patch b/patches/server/0505-Optimise-getType-calls.patch similarity index 100% rename from patches/server/0506-Optimise-getType-calls.patch rename to patches/server/0505-Optimise-getType-calls.patch diff --git a/patches/server/0507-Villager-resetOffers.patch b/patches/server/0506-Villager-resetOffers.patch similarity index 100% rename from patches/server/0507-Villager-resetOffers.patch rename to patches/server/0506-Villager-resetOffers.patch diff --git a/patches/server/0508-Improve-inlinig-for-some-hot-IBlockData-methods.patch b/patches/server/0507-Improve-inlinig-for-some-hot-IBlockData-methods.patch similarity index 100% rename from patches/server/0508-Improve-inlinig-for-some-hot-IBlockData-methods.patch rename to patches/server/0507-Improve-inlinig-for-some-hot-IBlockData-methods.patch diff --git a/patches/server/0509-Retain-block-place-order-when-capturing-blockstates.patch b/patches/server/0508-Retain-block-place-order-when-capturing-blockstates.patch similarity index 100% rename from patches/server/0509-Retain-block-place-order-when-capturing-blockstates.patch rename to patches/server/0508-Retain-block-place-order-when-capturing-blockstates.patch diff --git a/patches/server/0510-Reduce-blockpos-allocation-from-pathfinding.patch b/patches/server/0509-Reduce-blockpos-allocation-from-pathfinding.patch similarity index 100% rename from patches/server/0510-Reduce-blockpos-allocation-from-pathfinding.patch rename to patches/server/0509-Reduce-blockpos-allocation-from-pathfinding.patch diff --git a/patches/server/0511-Fix-item-locations-dropped-from-campfires.patch b/patches/server/0510-Fix-item-locations-dropped-from-campfires.patch similarity index 100% rename from patches/server/0511-Fix-item-locations-dropped-from-campfires.patch rename to patches/server/0510-Fix-item-locations-dropped-from-campfires.patch diff --git a/patches/server/0512-Player-elytra-boost-API.patch b/patches/server/0511-Player-elytra-boost-API.patch similarity index 94% rename from patches/server/0512-Player-elytra-boost-API.patch rename to patches/server/0511-Player-elytra-boost-API.patch index 050ed8a8a7..54561c48a1 100644 --- a/patches/server/0512-Player-elytra-boost-API.patch +++ b/patches/server/0511-Player-elytra-boost-API.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Player elytra boost API diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -index d70be6515dbf00ab6fe5b3c05d208a5686ce0209..a2a227f24855c89a1a8c45507f8ab0bd750638c4 100644 +index 03d43fdc119dc526928abf7b0f1b38d35e985ffc..fb4f868457ebf06b26ddc60f5ffc5a1d5273a1bc 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java @@ -592,6 +592,20 @@ public class CraftPlayer extends CraftHumanEntity implements Player { diff --git a/patches/server/0513-Fixed-TileEntityBell-memory-leak.patch b/patches/server/0512-Fixed-TileEntityBell-memory-leak.patch similarity index 100% rename from patches/server/0513-Fixed-TileEntityBell-memory-leak.patch rename to patches/server/0512-Fixed-TileEntityBell-memory-leak.patch diff --git a/patches/server/0514-Avoid-error-bubbling-up-when-item-stack-is-empty-in-.patch b/patches/server/0513-Avoid-error-bubbling-up-when-item-stack-is-empty-in-.patch similarity index 100% rename from patches/server/0514-Avoid-error-bubbling-up-when-item-stack-is-empty-in-.patch rename to patches/server/0513-Avoid-error-bubbling-up-when-item-stack-is-empty-in-.patch diff --git a/patches/server/0515-Add-getOfflinePlayerIfCached-String.patch b/patches/server/0514-Add-getOfflinePlayerIfCached-String.patch similarity index 88% rename from patches/server/0515-Add-getOfflinePlayerIfCached-String.patch rename to patches/server/0514-Add-getOfflinePlayerIfCached-String.patch index e82189979d..683ca40784 100644 --- a/patches/server/0515-Add-getOfflinePlayerIfCached-String.patch +++ b/patches/server/0514-Add-getOfflinePlayerIfCached-String.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Add getOfflinePlayerIfCached(String) diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -index 57c4871b977a31f55e5c39aba4159b39b1ac325d..da3ca296a4bcc0c6d303df9de5370a89a5ae0d67 100644 +index 72e545e9aa01ad7ae4180d5421e16e330b4c9934..f5ed17af815f2e7da523e80319dc4021556376b2 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -@@ -1801,6 +1801,28 @@ public final class CraftServer implements Server { +@@ -1803,6 +1803,28 @@ public final class CraftServer implements Server { return result; } diff --git a/patches/server/0516-Add-ignore-discounts-API.patch b/patches/server/0515-Add-ignore-discounts-API.patch similarity index 100% rename from patches/server/0516-Add-ignore-discounts-API.patch rename to patches/server/0515-Add-ignore-discounts-API.patch diff --git a/patches/server/0517-Toggle-for-removing-existing-dragon.patch b/patches/server/0516-Toggle-for-removing-existing-dragon.patch similarity index 100% rename from patches/server/0517-Toggle-for-removing-existing-dragon.patch rename to patches/server/0516-Toggle-for-removing-existing-dragon.patch diff --git a/patches/server/0518-Fix-client-lag-on-advancement-loading.patch b/patches/server/0517-Fix-client-lag-on-advancement-loading.patch similarity index 95% rename from patches/server/0518-Fix-client-lag-on-advancement-loading.patch rename to patches/server/0517-Fix-client-lag-on-advancement-loading.patch index b4148f901c..3c62dff076 100644 --- a/patches/server/0518-Fix-client-lag-on-advancement-loading.patch +++ b/patches/server/0517-Fix-client-lag-on-advancement-loading.patch @@ -15,7 +15,7 @@ manually reload the advancement data for all players, which normally takes place as a part of the datapack reloading. diff --git a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java -index 04b3608424e482daaae7b399e61cf0d5f8e03729..9f08928bdfc1644b7f902c1685c3324d6ee896c1 100644 +index 346f5f4b2afec3127c5d1b8e054eaacb1cb756e4..3f45ebeb31264f5f9a99123894fe07bd8e4c65d8 100644 --- a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java +++ b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java @@ -340,7 +340,13 @@ public final class CraftMagicNumbers implements UnsafeValues { diff --git a/patches/server/0519-Item-no-age-no-player-pickup.patch b/patches/server/0518-Item-no-age-no-player-pickup.patch similarity index 100% rename from patches/server/0519-Item-no-age-no-player-pickup.patch rename to patches/server/0518-Item-no-age-no-player-pickup.patch diff --git a/patches/server/0520-Optimize-Pathfinder-Remove-Streams-Optimized-collect.patch b/patches/server/0519-Optimize-Pathfinder-Remove-Streams-Optimized-collect.patch similarity index 100% rename from patches/server/0520-Optimize-Pathfinder-Remove-Streams-Optimized-collect.patch rename to patches/server/0519-Optimize-Pathfinder-Remove-Streams-Optimized-collect.patch diff --git a/patches/server/0521-Beacon-API-custom-effect-ranges.patch b/patches/server/0520-Beacon-API-custom-effect-ranges.patch similarity index 100% rename from patches/server/0521-Beacon-API-custom-effect-ranges.patch rename to patches/server/0520-Beacon-API-custom-effect-ranges.patch diff --git a/patches/server/0522-Add-API-for-quit-reason.patch b/patches/server/0521-Add-API-for-quit-reason.patch similarity index 91% rename from patches/server/0522-Add-API-for-quit-reason.patch rename to patches/server/0521-Add-API-for-quit-reason.patch index 0ae2db6b97..069a5da482 100644 --- a/patches/server/0522-Add-API-for-quit-reason.patch +++ b/patches/server/0521-Add-API-for-quit-reason.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Add API for quit reason diff --git a/src/main/java/net/minecraft/network/Connection.java b/src/main/java/net/minecraft/network/Connection.java -index 65c2263f8872fba4f68779e0e90ea5f96aefdfbd..523e5a01c55d3a2e192d86e70ac751e3eb622aea 100644 +index 4d2b26fb1ac5663b667ffd16eed379f4a3311677..dd81751f64695180331b82225ac878913afe4513 100644 --- a/src/main/java/net/minecraft/network/Connection.java +++ b/src/main/java/net/minecraft/network/Connection.java @@ -147,12 +147,15 @@ public class Connection extends SimpleChannelInboundHandler> { @@ -25,7 +25,7 @@ index 65c2263f8872fba4f68779e0e90ea5f96aefdfbd..523e5a01c55d3a2e192d86e70ac751e3 Connection.LOGGER.debug("Failed to sent packet", throwable); ConnectionProtocol enumprotocol = this.getCurrentProtocol(); diff --git a/src/main/java/net/minecraft/server/level/ServerPlayer.java b/src/main/java/net/minecraft/server/level/ServerPlayer.java -index 514d2d69980f843b5bc9339e63c48ba0e1176df5..8c6f55efb555c9ca7253ccc1cd9ba615cfb1171c 100644 +index 6f2b52165c1935511790a429792d3754251537c8..9b4436bdb697d8350eac57282f8fad8140029d8f 100644 --- a/src/main/java/net/minecraft/server/level/ServerPlayer.java +++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java @@ -266,6 +266,7 @@ public class ServerPlayer extends Player { @@ -37,10 +37,10 @@ index 514d2d69980f843b5bc9339e63c48ba0e1176df5..8c6f55efb555c9ca7253ccc1cd9ba615 public ServerPlayer(MinecraftServer server, ServerLevel world, GameProfile profile, @Nullable ProfilePublicKey publicKey) { super(world, world.getSharedSpawnPos(), world.getSharedSpawnAngle(), profile, publicKey); diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -index b91b9d2d26ef44ae59645699b82fba7a90e7b25f..81e0dc794ba43a498cb49ed47e03db3f9dc5377e 100644 +index a33334b45493c714b48439986b484256c03bdf8e..cf490d9f622e7300c36aa4776987e328d151097d 100644 --- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -@@ -518,6 +518,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic +@@ -521,6 +521,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic final Component ichatbasecomponent = PaperAdventure.asVanilla(event.reason()); // Paper - Adventure // CraftBukkit end @@ -49,7 +49,7 @@ index b91b9d2d26ef44ae59645699b82fba7a90e7b25f..81e0dc794ba43a498cb49ed47e03db3f this.connection.disconnect(ichatbasecomponent); })); diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java -index aadf37f5005d78db9b87f42b1c2646d614116c97..70d6a3d4901cb39294bef47f42d0d49aea34867a 100644 +index 67c50a329e7bdf4056a1217963e29e8ceb99b20f..1979e8634829f949b7ed80b231b36d5a5e29c717 100644 --- a/src/main/java/net/minecraft/server/players/PlayerList.java +++ b/src/main/java/net/minecraft/server/players/PlayerList.java @@ -601,7 +601,7 @@ public abstract class PlayerList { diff --git a/patches/server/0523-Add-Wandering-Trader-spawn-rate-config-options.patch b/patches/server/0522-Add-Wandering-Trader-spawn-rate-config-options.patch similarity index 100% rename from patches/server/0523-Add-Wandering-Trader-spawn-rate-config-options.patch rename to patches/server/0522-Add-Wandering-Trader-spawn-rate-config-options.patch diff --git a/patches/server/0524-Expose-world-spawn-angle.patch b/patches/server/0523-Expose-world-spawn-angle.patch similarity index 93% rename from patches/server/0524-Expose-world-spawn-angle.patch rename to patches/server/0523-Expose-world-spawn-angle.patch index 16a268eb92..32865caa23 100644 --- a/patches/server/0524-Expose-world-spawn-angle.patch +++ b/patches/server/0523-Expose-world-spawn-angle.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Expose world spawn angle diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java -index 70d6a3d4901cb39294bef47f42d0d49aea34867a..8ca55b57b94bd264951d0b7725bd384ff7764ba6 100644 +index 1979e8634829f949b7ed80b231b36d5a5e29c717..1b188bdf5597b81661ca1cc7acef1a9e93a54967 100644 --- a/src/main/java/net/minecraft/server/players/PlayerList.java +++ b/src/main/java/net/minecraft/server/players/PlayerList.java @@ -879,7 +879,7 @@ public abstract class PlayerList { diff --git a/patches/server/0525-Add-Destroy-Speed-API.patch b/patches/server/0524-Add-Destroy-Speed-API.patch similarity index 100% rename from patches/server/0525-Add-Destroy-Speed-API.patch rename to patches/server/0524-Add-Destroy-Speed-API.patch diff --git a/patches/server/0526-Fix-Player-spawnParticle-x-y-z-precision-loss.patch b/patches/server/0525-Fix-Player-spawnParticle-x-y-z-precision-loss.patch similarity index 93% rename from patches/server/0526-Fix-Player-spawnParticle-x-y-z-precision-loss.patch rename to patches/server/0525-Fix-Player-spawnParticle-x-y-z-precision-loss.patch index 9755ee5de0..f5ae3e4907 100644 --- a/patches/server/0526-Fix-Player-spawnParticle-x-y-z-precision-loss.patch +++ b/patches/server/0525-Fix-Player-spawnParticle-x-y-z-precision-loss.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Fix Player spawnParticle x/y/z precision loss diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -index 4e687f502ef8e0cb11400fb4254e1a1b4640dc1b..61a7f08a78381ee4e3fbec53dc1374ce04ec90ee 100644 +index fb4f868457ebf06b26ddc60f5ffc5a1d5273a1bc..4c7d84a8f0f186dba18dba528ed324a0808605e3 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java @@ -2273,7 +2273,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player { diff --git a/patches/server/0527-Add-LivingEntity-clearActiveItem.patch b/patches/server/0526-Add-LivingEntity-clearActiveItem.patch similarity index 100% rename from patches/server/0527-Add-LivingEntity-clearActiveItem.patch rename to patches/server/0526-Add-LivingEntity-clearActiveItem.patch diff --git a/patches/server/0528-Add-PlayerItemCooldownEvent.patch b/patches/server/0527-Add-PlayerItemCooldownEvent.patch similarity index 96% rename from patches/server/0528-Add-PlayerItemCooldownEvent.patch rename to patches/server/0527-Add-PlayerItemCooldownEvent.patch index 584621c1af..751841d117 100644 --- a/patches/server/0528-Add-PlayerItemCooldownEvent.patch +++ b/patches/server/0527-Add-PlayerItemCooldownEvent.patch @@ -1,5 +1,5 @@ From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: Nassim Jahnke +From: Nassim Jahnke Date: Tue, 25 Aug 2020 13:48:33 +0200 Subject: [PATCH] Add PlayerItemCooldownEvent diff --git a/patches/server/0529-Significantly-improve-performance-of-the-end-generat.patch b/patches/server/0528-Significantly-improve-performance-of-the-end-generat.patch similarity index 100% rename from patches/server/0529-Significantly-improve-performance-of-the-end-generat.patch rename to patches/server/0528-Significantly-improve-performance-of-the-end-generat.patch diff --git a/patches/server/0530-More-lightning-API.patch b/patches/server/0529-More-lightning-API.patch similarity index 97% rename from patches/server/0530-More-lightning-API.patch rename to patches/server/0529-More-lightning-API.patch index 5b18a81437..142479579e 100644 --- a/patches/server/0530-More-lightning-API.patch +++ b/patches/server/0529-More-lightning-API.patch @@ -1,5 +1,5 @@ From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: Nassim Jahnke +From: Nassim Jahnke Date: Sun, 26 Jul 2020 14:44:09 +0200 Subject: [PATCH] More lightning API diff --git a/patches/server/0531-Climbing-should-not-bypass-cramming-gamerule.patch b/patches/server/0530-Climbing-should-not-bypass-cramming-gamerule.patch similarity index 100% rename from patches/server/0531-Climbing-should-not-bypass-cramming-gamerule.patch rename to patches/server/0530-Climbing-should-not-bypass-cramming-gamerule.patch diff --git a/patches/server/0532-Added-missing-default-perms-for-commands.patch b/patches/server/0531-Added-missing-default-perms-for-commands.patch similarity index 100% rename from patches/server/0532-Added-missing-default-perms-for-commands.patch rename to patches/server/0531-Added-missing-default-perms-for-commands.patch diff --git a/patches/server/0533-Add-PlayerShearBlockEvent.patch b/patches/server/0532-Add-PlayerShearBlockEvent.patch similarity index 100% rename from patches/server/0533-Add-PlayerShearBlockEvent.patch rename to patches/server/0532-Add-PlayerShearBlockEvent.patch diff --git a/patches/server/0534-Fix-curing-zombie-villager-discount-exploit.patch b/patches/server/0533-Fix-curing-zombie-villager-discount-exploit.patch similarity index 100% rename from patches/server/0534-Fix-curing-zombie-villager-discount-exploit.patch rename to patches/server/0533-Fix-curing-zombie-villager-discount-exploit.patch diff --git a/patches/server/0535-Limit-recipe-packets.patch b/patches/server/0534-Limit-recipe-packets.patch similarity index 90% rename from patches/server/0535-Limit-recipe-packets.patch rename to patches/server/0534-Limit-recipe-packets.patch index 4880ed3afc..4bf6259d42 100644 --- a/patches/server/0535-Limit-recipe-packets.patch +++ b/patches/server/0534-Limit-recipe-packets.patch @@ -5,10 +5,10 @@ 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 cf490d9f622e7300c36aa4776987e328d151097d..8edaa8bcf250b9d363fe03e2c50b04f34dde8ea0 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 +@@ -264,6 +264,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic // CraftBukkit start - multithreaded fields private final AtomicInteger chatSpamTickCount = new AtomicInteger(); private final java.util.concurrent.atomic.AtomicInteger tabSpamLimiter = new java.util.concurrent.atomic.AtomicInteger(); // Paper - configurable tab spam limits @@ -16,7 +16,7 @@ index 0ddc1d16255d0c4a4bbfaccc9e167a83fc221485..7f91a1129a7702a4cff001de791514a3 // CraftBukkit end private int dropSpamTickCount; private double firstGoodX; -@@ -428,6 +429,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic +@@ -431,6 +432,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic // CraftBukkit start for (int spam; (spam = this.chatSpamTickCount.get()) > 0 && !this.chatSpamTickCount.compareAndSet(spam, spam - 1); ) ; if (tabSpamLimiter.get() > 0) tabSpamLimiter.getAndDecrement(); // Paper - split to seperate variable @@ -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 +@@ -3255,6 +3257,14 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic @Override public void handlePlaceRecipe(ServerboundPlaceRecipePacket packet) { diff --git a/patches/server/0536-Fix-CraftSound-backwards-compatibility.patch b/patches/server/0535-Fix-CraftSound-backwards-compatibility.patch similarity index 100% rename from patches/server/0536-Fix-CraftSound-backwards-compatibility.patch rename to patches/server/0535-Fix-CraftSound-backwards-compatibility.patch diff --git a/patches/server/0537-Player-Chunk-Load-Unload-Events.patch b/patches/server/0536-Player-Chunk-Load-Unload-Events.patch similarity index 90% rename from patches/server/0537-Player-Chunk-Load-Unload-Events.patch rename to patches/server/0536-Player-Chunk-Load-Unload-Events.patch index fcd60beef6..04505672a2 100644 --- a/patches/server/0537-Player-Chunk-Load-Unload-Events.patch +++ b/patches/server/0536-Player-Chunk-Load-Unload-Events.patch @@ -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 9b4436bdb697d8350eac57282f8fad8140029d8f..a802529b6f1adfd358295811c4e329e6fe82009b 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); diff --git a/patches/server/0538-Optimize-Dynamic-get-Missing-Keys.patch b/patches/server/0537-Optimize-Dynamic-get-Missing-Keys.patch similarity index 100% rename from patches/server/0538-Optimize-Dynamic-get-Missing-Keys.patch rename to patches/server/0537-Optimize-Dynamic-get-Missing-Keys.patch diff --git a/patches/server/0539-Expose-LivingEntity-hurt-direction.patch b/patches/server/0538-Expose-LivingEntity-hurt-direction.patch similarity index 100% rename from patches/server/0539-Expose-LivingEntity-hurt-direction.patch rename to patches/server/0538-Expose-LivingEntity-hurt-direction.patch diff --git a/patches/server/0540-Add-OBSTRUCTED-reason-to-BedEnterResult.patch b/patches/server/0539-Add-OBSTRUCTED-reason-to-BedEnterResult.patch similarity index 100% rename from patches/server/0540-Add-OBSTRUCTED-reason-to-BedEnterResult.patch rename to patches/server/0539-Add-OBSTRUCTED-reason-to-BedEnterResult.patch diff --git a/patches/server/0541-Do-not-crash-from-invalid-ingredient-lists-in-Villag.patch b/patches/server/0540-Do-not-crash-from-invalid-ingredient-lists-in-Villag.patch similarity index 100% rename from patches/server/0541-Do-not-crash-from-invalid-ingredient-lists-in-Villag.patch rename to patches/server/0540-Do-not-crash-from-invalid-ingredient-lists-in-Villag.patch diff --git a/patches/server/0542-Add-PlayerTradeEvent-and-PlayerPurchaseEvent.patch b/patches/server/0541-Add-PlayerTradeEvent-and-PlayerPurchaseEvent.patch similarity index 100% rename from patches/server/0542-Add-PlayerTradeEvent-and-PlayerPurchaseEvent.patch rename to patches/server/0541-Add-PlayerTradeEvent-and-PlayerPurchaseEvent.patch diff --git a/patches/server/0543-Implement-TargetHitEvent.patch b/patches/server/0542-Implement-TargetHitEvent.patch similarity index 100% rename from patches/server/0543-Implement-TargetHitEvent.patch rename to patches/server/0542-Implement-TargetHitEvent.patch diff --git a/patches/server/0544-MC-4-Fix-item-position-desync.patch b/patches/server/0543-MC-4-Fix-item-position-desync.patch similarity index 100% rename from patches/server/0544-MC-4-Fix-item-position-desync.patch rename to patches/server/0543-MC-4-Fix-item-position-desync.patch diff --git a/patches/server/0545-Additional-Block-Material-API-s.patch b/patches/server/0544-Additional-Block-Material-API-s.patch similarity index 100% rename from patches/server/0545-Additional-Block-Material-API-s.patch rename to patches/server/0544-Additional-Block-Material-API-s.patch diff --git a/patches/server/0546-Fix-harming-potion-dupe.patch b/patches/server/0545-Fix-harming-potion-dupe.patch similarity index 100% rename from patches/server/0546-Fix-harming-potion-dupe.patch rename to patches/server/0545-Fix-harming-potion-dupe.patch diff --git a/patches/server/0547-Implement-API-to-get-Material-from-Boats-and-Minecar.patch b/patches/server/0546-Implement-API-to-get-Material-from-Boats-and-Minecar.patch similarity index 92% rename from patches/server/0547-Implement-API-to-get-Material-from-Boats-and-Minecar.patch rename to patches/server/0546-Implement-API-to-get-Material-from-Boats-and-Minecar.patch index 33941db038..b68431ed82 100644 --- a/patches/server/0547-Implement-API-to-get-Material-from-Boats-and-Minecar.patch +++ b/patches/server/0546-Implement-API-to-get-Material-from-Boats-and-Minecar.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Implement API to get Material from Boats and Minecarts diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftBoat.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftBoat.java -index 5871cd149fe07e97c5d68ffd83dae4d3fc6bcf03..40debf1130a8e6cc9510061976a01050cd8ddc05 100644 +index 5871cd149fe07e97c5d68ffd83dae4d3fc6bcf03..f2896aa6fa5a5282b4be106320c0dad9dd6036c5 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftBoat.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftBoat.java @@ -80,6 +80,13 @@ public class CraftBoat extends CraftVehicle implements Boat { @@ -15,7 +15,7 @@ index 5871cd149fe07e97c5d68ffd83dae4d3fc6bcf03..40debf1130a8e6cc9510061976a01050 + // Paper start + @Override + public org.bukkit.Material getBoatMaterial() { -+ return this.getBoatType().getMaterial(); ++ return org.bukkit.craftbukkit.util.CraftMagicNumbers.getMaterial(this.getHandle().getDropItem()); + } + // Paper end + diff --git a/patches/server/0548-Cache-burn-durations.patch b/patches/server/0547-Cache-burn-durations.patch similarity index 100% rename from patches/server/0548-Cache-burn-durations.patch rename to patches/server/0547-Cache-burn-durations.patch diff --git a/patches/server/0549-Allow-disabling-mob-spawner-spawn-egg-transformation.patch b/patches/server/0548-Allow-disabling-mob-spawner-spawn-egg-transformation.patch similarity index 100% rename from patches/server/0549-Allow-disabling-mob-spawner-spawn-egg-transformation.patch rename to patches/server/0548-Allow-disabling-mob-spawner-spawn-egg-transformation.patch diff --git a/patches/server/0550-Fix-Not-a-string-Map-Conversion-spam.patch b/patches/server/0549-Fix-Not-a-string-Map-Conversion-spam.patch similarity index 100% rename from patches/server/0550-Fix-Not-a-string-Map-Conversion-spam.patch rename to patches/server/0549-Fix-Not-a-string-Map-Conversion-spam.patch diff --git a/patches/server/0551-Implement-PlayerFlowerPotManipulateEvent.patch b/patches/server/0550-Implement-PlayerFlowerPotManipulateEvent.patch similarity index 100% rename from patches/server/0551-Implement-PlayerFlowerPotManipulateEvent.patch rename to patches/server/0550-Implement-PlayerFlowerPotManipulateEvent.patch diff --git a/patches/server/0552-Fix-interact-event-not-being-called-in-adventure.patch b/patches/server/0551-Fix-interact-event-not-being-called-in-adventure.patch similarity index 90% rename from patches/server/0552-Fix-interact-event-not-being-called-in-adventure.patch rename to patches/server/0551-Fix-interact-event-not-being-called-in-adventure.patch index 81fb0381c6..b7969d61ab 100644 --- a/patches/server/0552-Fix-interact-event-not-being-called-in-adventure.patch +++ b/patches/server/0551-Fix-interact-event-not-being-called-in-adventure.patch @@ -6,10 +6,10 @@ 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 8edaa8bcf250b9d363fe03e2c50b04f34dde8ea0..9da69a6e4d20e6b5f702f3a307239d789654de60 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 +@@ -1858,7 +1858,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic MutableComponent ichatmutablecomponent = Component.translatable("build.tooHigh", i - 1).withStyle(ChatFormatting.RED); this.player.sendSystemMessage(ichatmutablecomponent, true); @@ -18,7 +18,7 @@ index 7f91a1129a7702a4cff001de791514a37f9def09..6525d8cee86928158dfd121ff11d18b0 this.player.swing(enumhand, true); } } -@@ -2591,7 +2591,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic +@@ -2618,7 +2618,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)); diff --git a/patches/server/0553-Zombie-API-breaking-doors.patch b/patches/server/0552-Zombie-API-breaking-doors.patch similarity index 100% rename from patches/server/0553-Zombie-API-breaking-doors.patch rename to patches/server/0552-Zombie-API-breaking-doors.patch diff --git a/patches/server/0554-Fix-nerfed-slime-when-splitting.patch b/patches/server/0553-Fix-nerfed-slime-when-splitting.patch similarity index 100% rename from patches/server/0554-Fix-nerfed-slime-when-splitting.patch rename to patches/server/0553-Fix-nerfed-slime-when-splitting.patch diff --git a/patches/server/0555-Add-EntityLoadCrossbowEvent.patch b/patches/server/0554-Add-EntityLoadCrossbowEvent.patch similarity index 100% rename from patches/server/0555-Add-EntityLoadCrossbowEvent.patch rename to patches/server/0554-Add-EntityLoadCrossbowEvent.patch diff --git a/patches/server/0556-Guardian-beam-workaround.patch b/patches/server/0555-Guardian-beam-workaround.patch similarity index 100% rename from patches/server/0556-Guardian-beam-workaround.patch rename to patches/server/0555-Guardian-beam-workaround.patch diff --git a/patches/server/0557-Added-WorldGameRuleChangeEvent.patch b/patches/server/0556-Added-WorldGameRuleChangeEvent.patch similarity index 100% rename from patches/server/0557-Added-WorldGameRuleChangeEvent.patch rename to patches/server/0556-Added-WorldGameRuleChangeEvent.patch diff --git a/patches/server/0558-Added-ServerResourcesReloadedEvent.patch b/patches/server/0557-Added-ServerResourcesReloadedEvent.patch similarity index 93% rename from patches/server/0558-Added-ServerResourcesReloadedEvent.patch rename to patches/server/0557-Added-ServerResourcesReloadedEvent.patch index 447484eb5a..d030c34c58 100644 --- a/patches/server/0558-Added-ServerResourcesReloadedEvent.patch +++ b/patches/server/0557-Added-ServerResourcesReloadedEvent.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Added ServerResourcesReloadedEvent diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index 6fd6d2a4faf8e72511170fb3c3aa80733ed0e8d9..04be281c3862707055b143267186169205720ab2 100644 +index f02fc7d6d8d0aba84be5e85c8de0ccc0e5a01c78..5c3b5cb0ffc3920da82b525bbc7a8963c981c595 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java -@@ -1977,7 +1977,13 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop completablefuture = CompletableFuture.supplyAsync(() -> { Stream stream = dataPacks.stream(); // CraftBukkit - decompile error -@@ -2003,6 +2009,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop(Class apiClass, ResourceKey> resourceKey) { +} diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index 04be281c3862707055b143267186169205720ab2..ea98c98e4449451895c6d91481ace6908c206f45 100644 +index 5c3b5cb0ffc3920da82b525bbc7a8963c981c595..d60439d49de781b12af6fbe4ff89b7270f57cbeb 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java -@@ -2009,6 +2009,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop +From: Nassim Jahnke Date: Fri, 29 Jan 2021 15:13:11 +0100 Subject: [PATCH] Add dropLeash variable to EntityUnleashEvent diff --git a/patches/server/0581-Reset-shield-blocking-on-dimension-change.patch b/patches/server/0580-Reset-shield-blocking-on-dimension-change.patch similarity index 89% rename from patches/server/0581-Reset-shield-blocking-on-dimension-change.patch rename to patches/server/0580-Reset-shield-blocking-on-dimension-change.patch index 4d6e6a5830..d418f0bca8 100644 --- a/patches/server/0581-Reset-shield-blocking-on-dimension-change.patch +++ b/patches/server/0580-Reset-shield-blocking-on-dimension-change.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Reset shield blocking on dimension change diff --git a/src/main/java/net/minecraft/server/level/ServerPlayer.java b/src/main/java/net/minecraft/server/level/ServerPlayer.java -index 345091d6ba617c26ac7acfd88eb023f2ec8fae11..6b6e0c408d22994a29bc562da523e0dc0575639f 100644 +index a802529b6f1adfd358295811c4e329e6fe82009b..d8ba103fd52c3c540fe386c9ff8264fcb3dbc136 100644 --- a/src/main/java/net/minecraft/server/level/ServerPlayer.java +++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java @@ -1181,6 +1181,11 @@ public class ServerPlayer extends Player { diff --git a/patches/server/0582-add-DragonEggFormEvent.patch b/patches/server/0581-add-DragonEggFormEvent.patch similarity index 100% rename from patches/server/0582-add-DragonEggFormEvent.patch rename to patches/server/0581-add-DragonEggFormEvent.patch diff --git a/patches/server/0583-EntityMoveEvent.patch b/patches/server/0582-EntityMoveEvent.patch similarity index 95% rename from patches/server/0583-EntityMoveEvent.patch rename to patches/server/0582-EntityMoveEvent.patch index b27f8840e1..163492fc35 100644 --- a/patches/server/0583-EntityMoveEvent.patch +++ b/patches/server/0582-EntityMoveEvent.patch @@ -5,10 +5,10 @@ Subject: [PATCH] EntityMoveEvent diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index ea98c98e4449451895c6d91481ace6908c206f45..e4f1ceb934917804fc415d3d06ebf9d093a44f7d 100644 +index 9484e447959a9c25ac6ef318be1569d236b5915d..75cd5667eb0f047cdec56b4131dcd1c4f22d4067 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java -@@ -1494,6 +1494,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop 0; // Paper diff --git a/patches/server/0584-added-option-to-disable-pathfinding-updates-on-block.patch b/patches/server/0583-added-option-to-disable-pathfinding-updates-on-block.patch similarity index 100% rename from patches/server/0584-added-option-to-disable-pathfinding-updates-on-block.patch rename to patches/server/0583-added-option-to-disable-pathfinding-updates-on-block.patch diff --git a/patches/server/0585-Inline-shift-direction-fields.patch b/patches/server/0584-Inline-shift-direction-fields.patch similarity index 100% rename from patches/server/0585-Inline-shift-direction-fields.patch rename to patches/server/0584-Inline-shift-direction-fields.patch diff --git a/patches/server/0586-Allow-adding-items-to-BlockDropItemEvent.patch b/patches/server/0585-Allow-adding-items-to-BlockDropItemEvent.patch similarity index 100% rename from patches/server/0586-Allow-adding-items-to-BlockDropItemEvent.patch rename to patches/server/0585-Allow-adding-items-to-BlockDropItemEvent.patch diff --git a/patches/server/0587-Add-getMainThreadExecutor-to-BukkitScheduler.patch b/patches/server/0586-Add-getMainThreadExecutor-to-BukkitScheduler.patch similarity index 100% rename from patches/server/0587-Add-getMainThreadExecutor-to-BukkitScheduler.patch rename to patches/server/0586-Add-getMainThreadExecutor-to-BukkitScheduler.patch diff --git a/patches/server/0588-living-entity-allow-attribute-registration.patch b/patches/server/0587-living-entity-allow-attribute-registration.patch similarity index 100% rename from patches/server/0588-living-entity-allow-attribute-registration.patch rename to patches/server/0587-living-entity-allow-attribute-registration.patch diff --git a/patches/server/0589-fix-dead-slime-setSize-invincibility.patch b/patches/server/0588-fix-dead-slime-setSize-invincibility.patch similarity index 100% rename from patches/server/0589-fix-dead-slime-setSize-invincibility.patch rename to patches/server/0588-fix-dead-slime-setSize-invincibility.patch diff --git a/patches/server/0590-Merchant-getRecipes-should-return-an-immutable-list.patch b/patches/server/0589-Merchant-getRecipes-should-return-an-immutable-list.patch similarity index 100% rename from patches/server/0590-Merchant-getRecipes-should-return-an-immutable-list.patch rename to patches/server/0589-Merchant-getRecipes-should-return-an-immutable-list.patch diff --git a/patches/server/0591-Add-support-for-hex-color-codes-in-console.patch b/patches/server/0590-Add-support-for-hex-color-codes-in-console.patch similarity index 99% rename from patches/server/0591-Add-support-for-hex-color-codes-in-console.patch rename to patches/server/0590-Add-support-for-hex-color-codes-in-console.patch index dfcbb6395d..64b7398ff4 100644 --- a/patches/server/0591-Add-support-for-hex-color-codes-in-console.patch +++ b/patches/server/0590-Add-support-for-hex-color-codes-in-console.patch @@ -282,10 +282,10 @@ index 0000000000000000000000000000000000000000..b4d0b7ecd56ab952319946854168c129 + +} diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index e4f1ceb934917804fc415d3d06ebf9d093a44f7d..1387ed71ff09b834361e415e5fc78786f68dd371 100644 +index abd1935ebc12f963b563023eb5279ad16ed1d8df..df570a64f1a8378f24977f0aa1e1f9b7191f0955 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java -@@ -1671,7 +1671,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop +From: Nassim Jahnke Date: Fri, 26 Mar 2021 11:23:17 +0100 Subject: [PATCH] Expose protocol version diff --git a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java -index 7f47922bc72392f40b1b32e69cd8da7ae3049ec6..56e50bdb8116f934fd65212f13601b8c9d76c749 100644 +index 9e27257265dab677175b9b3d921e1fc3f3cb7817..7f747fbaa1da49ab930d2a9ff60200a445ca477c 100644 --- a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java +++ b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java @@ -536,6 +536,11 @@ public final class CraftMagicNumbers implements UnsafeValues { diff --git a/patches/server/0615-Enhance-console-tab-completions-for-brigadier-comman.patch b/patches/server/0613-Enhance-console-tab-completions-for-brigadier-comman.patch similarity index 100% rename from patches/server/0615-Enhance-console-tab-completions-for-brigadier-comman.patch rename to patches/server/0613-Enhance-console-tab-completions-for-brigadier-comman.patch diff --git a/patches/server/0614-Allow-for-Component-suggestion-tooltips-in-AsyncTabC.patch b/patches/server/0614-Allow-for-Component-suggestion-tooltips-in-AsyncTabC.patch deleted file mode 100644 index 594b771610..0000000000 --- a/patches/server/0614-Allow-for-Component-suggestion-tooltips-in-AsyncTabC.patch +++ /dev/null @@ -1,133 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: Jason Penilla <11360596+jpenilla@users.noreply.github.com> -Date: Thu, 1 Apr 2021 00:34:02 -0700 -Subject: [PATCH] Allow for Component suggestion tooltips in - AsyncTabCompleteEvent - - -diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -index 5620f1184c612001e637a95b08fe2eff6ac475d9..848a881de252fba2f7c1223c59619c282db1e54d 100644 ---- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -@@ -845,12 +845,11 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic - - // Paper start - async tab completion - com.destroystokyo.paper.event.server.AsyncTabCompleteEvent event; -- java.util.List completions = new java.util.ArrayList<>(); - String buffer = packet.getCommand(); -- event = new com.destroystokyo.paper.event.server.AsyncTabCompleteEvent(this.getCraftPlayer(), completions, -+ event = new com.destroystokyo.paper.event.server.AsyncTabCompleteEvent(this.getCraftPlayer(), - buffer, true, null); - event.callEvent(); -- completions = event.isCancelled() ? com.google.common.collect.ImmutableList.of() : event.getCompletions(); -+ java.util.List completions = event.isCancelled() ? com.google.common.collect.ImmutableList.of() : event.completions(); - // If the event isn't handled, we can assume that we have no completions, and so we'll ask the server - if (!event.isHandled()) { - if (!event.isCancelled()) { -@@ -869,10 +868,17 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic - }); - } - } else if (!completions.isEmpty()) { -- com.mojang.brigadier.suggestion.SuggestionsBuilder builder = new com.mojang.brigadier.suggestion.SuggestionsBuilder(packet.getCommand(), stringreader.getTotalLength()); -+ com.mojang.brigadier.suggestion.SuggestionsBuilder builder0 = new com.mojang.brigadier.suggestion.SuggestionsBuilder(packet.getCommand(), stringreader.getTotalLength()); - -- builder = builder.createOffset(builder.getInput().lastIndexOf(' ') + 1); -- completions.forEach(builder::suggest); -+ final com.mojang.brigadier.suggestion.SuggestionsBuilder builder = builder0.createOffset(builder0.getInput().lastIndexOf(' ') + 1); -+ completions.forEach(completion -> { -+ final Integer intSuggestion = com.google.common.primitives.Ints.tryParse(completion.suggestion()); -+ if (intSuggestion != null) { -+ builder.suggest(intSuggestion, PaperAdventure.asVanilla(completion.tooltip())); -+ } else { -+ builder.suggest(completion.suggestion(), PaperAdventure.asVanilla(completion.tooltip())); -+ } -+ }); - com.mojang.brigadier.suggestion.Suggestions suggestions = builder.buildFuture().join(); - com.destroystokyo.paper.event.brigadier.AsyncPlayerSendSuggestionsEvent suggestEvent = new com.destroystokyo.paper.event.brigadier.AsyncPlayerSendSuggestionsEvent(this.getCraftPlayer(), suggestions, buffer); - suggestEvent.setCancelled(suggestions.isEmpty()); -diff --git a/src/main/java/org/bukkit/craftbukkit/command/ConsoleCommandCompleter.java b/src/main/java/org/bukkit/craftbukkit/command/ConsoleCommandCompleter.java -index e5af155d75f717d33c23e22ff8b96bb3ff87844d..14cd8ae69d9b25dc5edad4ff96ff4a9acb1f22cb 100644 ---- a/src/main/java/org/bukkit/craftbukkit/command/ConsoleCommandCompleter.java -+++ b/src/main/java/org/bukkit/craftbukkit/command/ConsoleCommandCompleter.java -@@ -29,34 +29,56 @@ public class ConsoleCommandCompleter implements Completer { - final CraftServer server = this.server.server; - final String buffer = line.line(); - // Async Tab Complete -- com.destroystokyo.paper.event.server.AsyncTabCompleteEvent event; -- java.util.List completions = new java.util.ArrayList<>(); -- event = new com.destroystokyo.paper.event.server.AsyncTabCompleteEvent(server.getConsoleSender(), completions, -- buffer, true, null); -+ final com.destroystokyo.paper.event.server.AsyncTabCompleteEvent event = -+ new com.destroystokyo.paper.event.server.AsyncTabCompleteEvent(server.getConsoleSender(), buffer, true, null); - event.callEvent(); -- completions = event.isCancelled() ? com.google.common.collect.ImmutableList.of() : event.getCompletions(); -+ final List completions = event.isCancelled() ? com.google.common.collect.ImmutableList.of() : event.completions(); - - if (event.isCancelled() || event.isHandled()) { - // Still fire sync event with the provided completions, if someone is listening - if (!event.isCancelled() && TabCompleteEvent.getHandlerList().getRegisteredListeners().length > 0) { -- List finalCompletions = completions; -+ List finalCompletions = new java.util.ArrayList<>(completions); - Waitable> syncCompletions = new Waitable>() { - @Override - protected List evaluate() { -- org.bukkit.event.server.TabCompleteEvent syncEvent = new org.bukkit.event.server.TabCompleteEvent(server.getConsoleSender(), buffer, finalCompletions); -+ org.bukkit.event.server.TabCompleteEvent syncEvent = new org.bukkit.event.server.TabCompleteEvent(server.getConsoleSender(), buffer, -+ finalCompletions.stream() -+ .map(com.destroystokyo.paper.event.server.AsyncTabCompleteEvent.Completion::suggestion) -+ .collect(java.util.stream.Collectors.toList())); - return syncEvent.callEvent() ? syncEvent.getCompletions() : com.google.common.collect.ImmutableList.of(); - } - }; - server.getServer().processQueue.add(syncCompletions); - try { -- completions = syncCompletions.get(); -+ final List legacyCompletions = syncCompletions.get(); -+ completions.removeIf(it -> !legacyCompletions.contains(it.suggestion())); // remove any suggestions that were removed -+ // add any new suggestions -+ for (final String completion : legacyCompletions) { -+ if (notNewSuggestion(completions, completion)) { -+ continue; -+ } -+ completions.add(com.destroystokyo.paper.event.server.AsyncTabCompleteEvent.Completion.completion(completion)); -+ } - } catch (InterruptedException | ExecutionException e1) { - e1.printStackTrace(); - } - } - - if (!completions.isEmpty()) { -- candidates.addAll(completions.stream().map(Candidate::new).collect(java.util.stream.Collectors.toList())); -+ for (final com.destroystokyo.paper.event.server.AsyncTabCompleteEvent.Completion completion : completions) { -+ if (completion.suggestion().isEmpty()) { -+ continue; -+ } -+ candidates.add(new Candidate( -+ completion.suggestion(), -+ completion.suggestion(), -+ null, -+ io.papermc.paper.adventure.PaperAdventure.PLAIN.serializeOr(completion.tooltip(), null), -+ null, -+ null, -+ false -+ )); -+ } - } - return; - } -@@ -106,4 +128,15 @@ public class ConsoleCommandCompleter implements Completer { - Thread.currentThread().interrupt(); - } - } -+ -+ // Paper start -+ private boolean notNewSuggestion(final List completions, final String completion) { -+ for (final com.destroystokyo.paper.event.server.AsyncTabCompleteEvent.Completion it : completions) { -+ if (it.suggestion().equals(completion)) { -+ return true; -+ } -+ } -+ return false; -+ } -+ // Paper end - } diff --git a/patches/server/0616-Fix-PlayerItemConsumeEvent-cancelling-properly.patch b/patches/server/0614-Fix-PlayerItemConsumeEvent-cancelling-properly.patch similarity index 100% rename from patches/server/0616-Fix-PlayerItemConsumeEvent-cancelling-properly.patch rename to patches/server/0614-Fix-PlayerItemConsumeEvent-cancelling-properly.patch diff --git a/patches/server/0617-Add-bypass-host-check.patch b/patches/server/0615-Add-bypass-host-check.patch similarity index 100% rename from patches/server/0617-Add-bypass-host-check.patch rename to patches/server/0615-Add-bypass-host-check.patch diff --git a/patches/server/0618-Set-area-affect-cloud-rotation.patch b/patches/server/0616-Set-area-affect-cloud-rotation.patch similarity index 100% rename from patches/server/0618-Set-area-affect-cloud-rotation.patch rename to patches/server/0616-Set-area-affect-cloud-rotation.patch diff --git a/patches/server/0619-add-isDeeplySleeping-to-HumanEntity.patch b/patches/server/0617-add-isDeeplySleeping-to-HumanEntity.patch similarity index 100% rename from patches/server/0619-add-isDeeplySleeping-to-HumanEntity.patch rename to patches/server/0617-add-isDeeplySleeping-to-HumanEntity.patch diff --git a/patches/server/0620-add-consumeFuel-to-FurnaceBurnEvent.patch b/patches/server/0618-add-consumeFuel-to-FurnaceBurnEvent.patch similarity index 100% rename from patches/server/0620-add-consumeFuel-to-FurnaceBurnEvent.patch rename to patches/server/0618-add-consumeFuel-to-FurnaceBurnEvent.patch diff --git a/patches/server/0621-add-get-set-drop-chance-to-EntityEquipment.patch b/patches/server/0619-add-get-set-drop-chance-to-EntityEquipment.patch similarity index 100% rename from patches/server/0621-add-get-set-drop-chance-to-EntityEquipment.patch rename to patches/server/0619-add-get-set-drop-chance-to-EntityEquipment.patch diff --git a/patches/server/0622-fix-PigZombieAngerEvent-cancellation.patch b/patches/server/0620-fix-PigZombieAngerEvent-cancellation.patch similarity index 100% rename from patches/server/0622-fix-PigZombieAngerEvent-cancellation.patch rename to patches/server/0620-fix-PigZombieAngerEvent-cancellation.patch diff --git a/patches/server/0623-Fix-checkReach-check-for-Shulker-boxes.patch b/patches/server/0621-Fix-checkReach-check-for-Shulker-boxes.patch similarity index 100% rename from patches/server/0623-Fix-checkReach-check-for-Shulker-boxes.patch rename to patches/server/0621-Fix-checkReach-check-for-Shulker-boxes.patch diff --git a/patches/server/0624-fix-PlayerItemHeldEvent-firing-twice.patch b/patches/server/0622-fix-PlayerItemHeldEvent-firing-twice.patch similarity index 88% rename from patches/server/0624-fix-PlayerItemHeldEvent-firing-twice.patch rename to patches/server/0622-fix-PlayerItemHeldEvent-firing-twice.patch index 79913bd751..b5844f82d0 100644 --- a/patches/server/0624-fix-PlayerItemHeldEvent-firing-twice.patch +++ b/patches/server/0622-fix-PlayerItemHeldEvent-firing-twice.patch @@ -5,10 +5,10 @@ Subject: [PATCH] fix PlayerItemHeldEvent firing twice diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -index 848a881de252fba2f7c1223c59619c282db1e54d..8b52453f67347625e68ff0c439fb65820dbcf959 100644 +index 3e32419d7038b2f87d81a1075039437f43b219c4..2723bb42f3618fa57f3996b7880484d88afb552d 100644 --- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -@@ -2052,6 +2052,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic +@@ -2059,6 +2059,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic PacketUtils.ensureRunningOnSameThread(packet, this, this.player.getLevel()); if (this.player.isImmobile()) return; // CraftBukkit if (packet.getSlot() >= 0 && packet.getSlot() < Inventory.getSelectionSize()) { diff --git a/patches/server/0625-Added-PlayerDeepSleepEvent.patch b/patches/server/0623-Added-PlayerDeepSleepEvent.patch similarity index 100% rename from patches/server/0625-Added-PlayerDeepSleepEvent.patch rename to patches/server/0623-Added-PlayerDeepSleepEvent.patch diff --git a/patches/server/0626-More-World-API.patch b/patches/server/0624-More-World-API.patch similarity index 100% rename from patches/server/0626-More-World-API.patch rename to patches/server/0624-More-World-API.patch diff --git a/patches/server/0627-Added-PlayerBedFailEnterEvent.patch b/patches/server/0625-Added-PlayerBedFailEnterEvent.patch similarity index 100% rename from patches/server/0627-Added-PlayerBedFailEnterEvent.patch rename to patches/server/0625-Added-PlayerBedFailEnterEvent.patch diff --git a/patches/server/0628-Implement-methods-to-convert-between-Component-and-B.patch b/patches/server/0626-Implement-methods-to-convert-between-Component-and-B.patch similarity index 100% rename from patches/server/0628-Implement-methods-to-convert-between-Component-and-B.patch rename to patches/server/0626-Implement-methods-to-convert-between-Component-and-B.patch diff --git a/patches/server/0629-Fix-anchor-respawn-acting-as-a-bed-respawn-from-the-.patch b/patches/server/0627-Fix-anchor-respawn-acting-as-a-bed-respawn-from-the-.patch similarity index 95% rename from patches/server/0629-Fix-anchor-respawn-acting-as-a-bed-respawn-from-the-.patch rename to patches/server/0627-Fix-anchor-respawn-acting-as-a-bed-respawn-from-the-.patch index 6803319427..61338a1393 100644 --- a/patches/server/0629-Fix-anchor-respawn-acting-as-a-bed-respawn-from-the-.patch +++ b/patches/server/0627-Fix-anchor-respawn-acting-as-a-bed-respawn-from-the-.patch @@ -6,7 +6,7 @@ Subject: [PATCH] Fix anchor respawn acting as a bed respawn from the end diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java -index 538d7bcebf55af189d31dc64fe12ef5d5adb4cd3..788a6dae744fd95d11d4f97a2fb0a7f53eed5884 100644 +index 304fb7b7255379d1be31ccf86ce04c377ef1d247..10b615ad0a038c7237f4664431996774b4e55e2f 100644 --- a/src/main/java/net/minecraft/server/players/PlayerList.java +++ b/src/main/java/net/minecraft/server/players/PlayerList.java @@ -852,6 +852,7 @@ public abstract class PlayerList { diff --git a/patches/server/0630-Introduce-beacon-activation-deactivation-events.patch b/patches/server/0628-Introduce-beacon-activation-deactivation-events.patch similarity index 100% rename from patches/server/0630-Introduce-beacon-activation-deactivation-events.patch rename to patches/server/0628-Introduce-beacon-activation-deactivation-events.patch diff --git a/patches/server/0631-add-RespawnFlags-to-PlayerRespawnEvent.patch b/patches/server/0629-add-RespawnFlags-to-PlayerRespawnEvent.patch similarity index 92% rename from patches/server/0631-add-RespawnFlags-to-PlayerRespawnEvent.patch rename to patches/server/0629-add-RespawnFlags-to-PlayerRespawnEvent.patch index b31b543aa1..9e6260fe4c 100644 --- a/patches/server/0631-add-RespawnFlags-to-PlayerRespawnEvent.patch +++ b/patches/server/0629-add-RespawnFlags-to-PlayerRespawnEvent.patch @@ -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 2723bb42f3618fa57f3996b7880484d88afb552d..8dc4eac46bb7f127cb23d3994308d6ceb5dfedf5 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 +@@ -2902,7 +2902,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 10b615ad0a038c7237f4664431996774b4e55e2f..63f92d68b91f1049802a1541c7ec4efaa324ac11 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 { diff --git a/patches/server/0632-Add-Channel-initialization-listeners.patch b/patches/server/0630-Add-Channel-initialization-listeners.patch similarity index 97% rename from patches/server/0632-Add-Channel-initialization-listeners.patch rename to patches/server/0630-Add-Channel-initialization-listeners.patch index e68cdca327..fbea93e057 100644 --- a/patches/server/0632-Add-Channel-initialization-listeners.patch +++ b/patches/server/0630-Add-Channel-initialization-listeners.patch @@ -1,5 +1,5 @@ From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: Nassim Jahnke +From: Nassim Jahnke Date: Thu, 29 Apr 2021 21:19:33 +0200 Subject: [PATCH] Add Channel initialization listeners @@ -122,7 +122,7 @@ index 0000000000000000000000000000000000000000..0d7e7db9e37ef0183c32b217bd944fb4 + COMPRESSION_DISABLED +} diff --git a/src/main/java/net/minecraft/network/Connection.java b/src/main/java/net/minecraft/network/Connection.java -index cc1aa02fdf214b63aa105f3b0b12723dc359d287..023c564248adb2c5c4b679be9075ca88cb2d5b62 100644 +index dd81751f64695180331b82225ac878913afe4513..86cc291b5b14523d57c84f8ebd6ba9b9c3b0d1a6 100644 --- a/src/main/java/net/minecraft/network/Connection.java +++ b/src/main/java/net/minecraft/network/Connection.java @@ -567,6 +567,7 @@ public class Connection extends SimpleChannelInboundHandler> { diff --git a/patches/server/0633-Send-empty-commands-if-tab-completion-is-disabled.patch b/patches/server/0631-Send-empty-commands-if-tab-completion-is-disabled.patch similarity index 88% rename from patches/server/0633-Send-empty-commands-if-tab-completion-is-disabled.patch rename to patches/server/0631-Send-empty-commands-if-tab-completion-is-disabled.patch index 8750ad5033..c8fb05fbfb 100644 --- a/patches/server/0633-Send-empty-commands-if-tab-completion-is-disabled.patch +++ b/patches/server/0631-Send-empty-commands-if-tab-completion-is-disabled.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Send empty commands if tab completion is disabled diff --git a/src/main/java/net/minecraft/commands/Commands.java b/src/main/java/net/minecraft/commands/Commands.java -index d6da53fffd7c0a5a971e4510b7d433ea2cca06d2..edf980cf8992ddfe003ced279fe1324fc2364e5a 100644 +index 52d2c8d451dce33a5a62f3ec3c5add65a80ce9ca..884a7c3a082140d2e1d154851c534ab09f5da4ce 100644 --- a/src/main/java/net/minecraft/commands/Commands.java +++ b/src/main/java/net/minecraft/commands/Commands.java -@@ -359,7 +359,12 @@ public class Commands { +@@ -358,7 +358,12 @@ public class Commands { } public void sendCommands(ServerPlayer player) { diff --git a/patches/server/0634-Add-more-WanderingTrader-API.patch b/patches/server/0632-Add-more-WanderingTrader-API.patch similarity index 100% rename from patches/server/0634-Add-more-WanderingTrader-API.patch rename to patches/server/0632-Add-more-WanderingTrader-API.patch diff --git a/patches/server/0635-Add-EntityBlockStorage-clearEntities.patch b/patches/server/0633-Add-EntityBlockStorage-clearEntities.patch similarity index 100% rename from patches/server/0635-Add-EntityBlockStorage-clearEntities.patch rename to patches/server/0633-Add-EntityBlockStorage-clearEntities.patch diff --git a/patches/server/0636-Add-Adventure-message-to-PlayerAdvancementDoneEvent.patch b/patches/server/0634-Add-Adventure-message-to-PlayerAdvancementDoneEvent.patch similarity index 100% rename from patches/server/0636-Add-Adventure-message-to-PlayerAdvancementDoneEvent.patch rename to patches/server/0634-Add-Adventure-message-to-PlayerAdvancementDoneEvent.patch diff --git a/patches/server/0637-Add-raw-address-to-AsyncPlayerPreLoginEvent.patch b/patches/server/0635-Add-raw-address-to-AsyncPlayerPreLoginEvent.patch similarity index 90% rename from patches/server/0637-Add-raw-address-to-AsyncPlayerPreLoginEvent.patch rename to patches/server/0635-Add-raw-address-to-AsyncPlayerPreLoginEvent.patch index 8d8be29732..8402d0763d 100644 --- a/patches/server/0637-Add-raw-address-to-AsyncPlayerPreLoginEvent.patch +++ b/patches/server/0635-Add-raw-address-to-AsyncPlayerPreLoginEvent.patch @@ -5,11 +5,11 @@ 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 -index 0ad129adf726049c62f8d5c816cc32b3b6b9b2eb..c8a29ec3eac3ae61731cdc4f142578d98ec993ff 100644 +index 2f0a70bc9cc8cda9e9beef00421078c036d6287c..f6efd220d7f78f3f763bf1983d20c636eb4923b6 100644 --- a/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 - // Paper end +@@ -381,12 +381,13 @@ public class ServerLoginPacketListenerImpl implements TickablePacketListener, Se + public void fireEvents() throws Exception { String playerName = ServerLoginPacketListenerImpl.this.gameProfile.getName(); java.net.InetAddress address = ((java.net.InetSocketAddress) ServerLoginPacketListenerImpl.this.connection.getRemoteAddress()).getAddress(); + java.net.InetAddress rawAddress = ((java.net.InetSocketAddress) connection.getRawAddress()).getAddress(); // Paper diff --git a/patches/server/0638-Inventory-close.patch b/patches/server/0636-Inventory-close.patch similarity index 100% rename from patches/server/0638-Inventory-close.patch rename to patches/server/0636-Inventory-close.patch diff --git a/patches/server/0639-call-PortalCreateEvent-players-and-end-platform.patch b/patches/server/0637-call-PortalCreateEvent-players-and-end-platform.patch similarity index 94% rename from patches/server/0639-call-PortalCreateEvent-players-and-end-platform.patch rename to patches/server/0637-call-PortalCreateEvent-players-and-end-platform.patch index d31d46dd94..11bc717f06 100644 --- a/patches/server/0639-call-PortalCreateEvent-players-and-end-platform.patch +++ b/patches/server/0637-call-PortalCreateEvent-players-and-end-platform.patch @@ -5,7 +5,7 @@ Subject: [PATCH] call PortalCreateEvent players and end platform diff --git a/src/main/java/net/minecraft/server/level/ServerPlayer.java b/src/main/java/net/minecraft/server/level/ServerPlayer.java -index 6b6e0c408d22994a29bc562da523e0dc0575639f..d8bbab6af9625cdb411df0099261f97f59daacb4 100644 +index d8ba103fd52c3c540fe386c9ff8264fcb3dbc136..66a3148985f864c2e4238cd3b27469d59ab3f354 100644 --- a/src/main/java/net/minecraft/server/level/ServerPlayer.java +++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java @@ -1208,15 +1208,21 @@ public class ServerPlayer extends Player { diff --git a/patches/server/0640-Add-a-should-burn-in-sunlight-API-for-Phantoms-and-S.patch b/patches/server/0638-Add-a-should-burn-in-sunlight-API-for-Phantoms-and-S.patch similarity index 100% rename from patches/server/0640-Add-a-should-burn-in-sunlight-API-for-Phantoms-and-S.patch rename to patches/server/0638-Add-a-should-burn-in-sunlight-API-for-Phantoms-and-S.patch diff --git a/patches/server/0641-Fix-CraftPotionBrewer-cache.patch b/patches/server/0639-Fix-CraftPotionBrewer-cache.patch similarity index 100% rename from patches/server/0641-Fix-CraftPotionBrewer-cache.patch rename to patches/server/0639-Fix-CraftPotionBrewer-cache.patch diff --git a/patches/server/0642-Add-basic-Datapack-API.patch b/patches/server/0640-Add-basic-Datapack-API.patch similarity index 94% rename from patches/server/0642-Add-basic-Datapack-API.patch rename to patches/server/0640-Add-basic-Datapack-API.patch index 1a66d7bc0d..07268ceca0 100644 --- a/patches/server/0642-Add-basic-Datapack-API.patch +++ b/patches/server/0640-Add-basic-Datapack-API.patch @@ -92,10 +92,10 @@ index 0000000000000000000000000000000000000000..cf4374493c11057451a62a655514415c + } +} diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -index 65fb1db4dd7078cfc6c0cb9ed5f0fe267e067249..5196eef152a64269f460b3631aba455b0b434246 100644 +index 4a59e48f67a4ebd44562915ee866276c1270604b..7490d6cd392defa93d64fd20cd47caf9b62ddd9b 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -@@ -280,6 +280,7 @@ public final class CraftServer implements Server { +@@ -282,6 +282,7 @@ public final class CraftServer implements Server { public boolean ignoreVanillaPermissions = false; private final List playerView; public int reloadCount; @@ -103,7 +103,7 @@ index 65fb1db4dd7078cfc6c0cb9ed5f0fe267e067249..5196eef152a64269f460b3631aba455b public static Exception excessiveVelEx; // Paper - Velocity warnings static { -@@ -366,6 +367,7 @@ public final class CraftServer implements Server { +@@ -368,6 +369,7 @@ public final class CraftServer implements Server { if (this.configuration.getBoolean("settings.use-map-color-cache")) { MapPalette.setMapColorCache(new CraftMapColorCache(this.logger)); } @@ -111,7 +111,7 @@ index 65fb1db4dd7078cfc6c0cb9ed5f0fe267e067249..5196eef152a64269f460b3631aba455b } public boolean getCommandBlockOverride(String command) { -@@ -2763,5 +2765,11 @@ public final class CraftServer implements Server { +@@ -2770,5 +2772,11 @@ public final class CraftServer implements Server { public com.destroystokyo.paper.entity.ai.MobGoals getMobGoals() { return mobGoals; } diff --git a/patches/server/0643-Add-environment-variable-to-disable-server-gui.patch b/patches/server/0641-Add-environment-variable-to-disable-server-gui.patch similarity index 100% rename from patches/server/0643-Add-environment-variable-to-disable-server-gui.patch rename to patches/server/0641-Add-environment-variable-to-disable-server-gui.patch diff --git a/patches/server/0644-additions-to-PlayerGameModeChangeEvent.patch b/patches/server/0642-additions-to-PlayerGameModeChangeEvent.patch similarity index 95% rename from patches/server/0644-additions-to-PlayerGameModeChangeEvent.patch rename to patches/server/0642-additions-to-PlayerGameModeChangeEvent.patch index a08c959134..38bab498e0 100644 --- a/patches/server/0644-additions-to-PlayerGameModeChangeEvent.patch +++ b/patches/server/0642-additions-to-PlayerGameModeChangeEvent.patch @@ -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 66a3148985f864c2e4238cd3b27469d59ab3f354..4a35720430990b358ea5d7f2b6293e27e8d9f7ac 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 8dc4eac46bb7f127cb23d3994308d6ceb5dfedf5..1b6cad1fda904a1c76af508325c21c1db642e8ff 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 +@@ -2911,7 +2911,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 8608fbd5484498f0e478d857ea1dd548ad6a93e0..0004b78b63a2bf4b34467f9a550f6f0807e4dfb4 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 { diff --git a/patches/server/0645-ItemStack-repair-check-API.patch b/patches/server/0643-ItemStack-repair-check-API.patch similarity index 97% rename from patches/server/0645-ItemStack-repair-check-API.patch rename to patches/server/0643-ItemStack-repair-check-API.patch index 6a48f8e5e8..136bbcb302 100644 --- a/patches/server/0645-ItemStack-repair-check-API.patch +++ b/patches/server/0643-ItemStack-repair-check-API.patch @@ -5,7 +5,7 @@ Subject: [PATCH] ItemStack repair check API diff --git a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java -index 56e50bdb8116f934fd65212f13601b8c9d76c749..44b922c9e6f022c1a9282c0cb686bbd8a8d1c675 100644 +index 7f747fbaa1da49ab930d2a9ff60200a445ca477c..0ebcadd6daf244cd9b6c943ca0a2baaafb3eba50 100644 --- a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java +++ b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java @@ -537,6 +537,14 @@ public final class CraftMagicNumbers implements UnsafeValues { diff --git a/patches/server/0646-More-Enchantment-API.patch b/patches/server/0644-More-Enchantment-API.patch similarity index 100% rename from patches/server/0646-More-Enchantment-API.patch rename to patches/server/0644-More-Enchantment-API.patch diff --git a/patches/server/0647-Move-range-check-for-block-placing-up.patch b/patches/server/0645-Move-range-check-for-block-placing-up.patch similarity index 83% rename from patches/server/0647-Move-range-check-for-block-placing-up.patch rename to patches/server/0645-Move-range-check-for-block-placing-up.patch index 44c4bc7329..911af5fa06 100644 --- a/patches/server/0647-Move-range-check-for-block-placing-up.patch +++ b/patches/server/0645-Move-range-check-for-block-placing-up.patch @@ -1,14 +1,14 @@ From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: Nassim Jahnke +From: Nassim Jahnke Date: Wed, 8 Jun 2022 10:52:18 +0200 Subject: [PATCH] Move range check for block placing up diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -index acb7c80fa01689098962d170df91aa79c2472dd1..cc1225f7c1e4d47f509c55609066fba084331a4d 100644 +index 1b6cad1fda904a1c76af508325c21c1db642e8ff..2da9dd2b5cc0f9e74976e4c927ebf3130aaa1b26 100644 --- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -@@ -1829,6 +1829,11 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic +@@ -1836,6 +1836,11 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic ItemStack itemstack = this.player.getItemInHand(enumhand); BlockHitResult movingobjectpositionblock = packet.getHitResult(); Vec3 vec3d = movingobjectpositionblock.getLocation(); diff --git a/patches/server/0648-Fix-and-optimise-world-force-upgrading.patch b/patches/server/0646-Fix-and-optimise-world-force-upgrading.patch similarity index 98% rename from patches/server/0648-Fix-and-optimise-world-force-upgrading.patch rename to patches/server/0646-Fix-and-optimise-world-force-upgrading.patch index 579501f1b0..cb25250fdc 100644 --- a/patches/server/0648-Fix-and-optimise-world-force-upgrading.patch +++ b/patches/server/0646-Fix-and-optimise-world-force-upgrading.patch @@ -272,7 +272,7 @@ index ce4aed84d751a48dcd2a8409190db4a22d78f77b..0a843e0afbcb1af8e2641515eb244b79 Main.LOGGER.info("Forcing world upgrade! {}", session.getLevelId()); // CraftBukkit WorldUpgrader worldupgrader = new WorldUpgrader(session, dataFixer, generatorOptions, eraseCache); diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index cefa833408ff95890dc5c831276f259022bd95a3..fdf08831a9d1b27c8050432e958f7133f3d10e1e 100644 +index 486acce909cdd2cacc5f2bb9eab1a600152f9971..749421b638bbb5868a426888e42edc461ad0edf3 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java @@ -545,11 +545,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop list = ImmutableList.of(new PhantomSpawner(), new PatrolSpawner(), new CatSpawner(), new VillageSiege(), new WanderingTraderSpawner(worlddata)); -@@ -1219,6 +1214,13 @@ public final class CraftServer implements Server { +@@ -1221,6 +1216,13 @@ public final class CraftServer implements Server { biomeProvider = generator.getDefaultBiomeProvider(worldInfo); } diff --git a/patches/server/0649-Add-Mob-lookAt-API.patch b/patches/server/0647-Add-Mob-lookAt-API.patch similarity index 100% rename from patches/server/0649-Add-Mob-lookAt-API.patch rename to patches/server/0647-Add-Mob-lookAt-API.patch diff --git a/patches/server/0650-Add-Unix-domain-socket-support.patch b/patches/server/0648-Add-Unix-domain-socket-support.patch similarity index 98% rename from patches/server/0650-Add-Unix-domain-socket-support.patch rename to patches/server/0648-Add-Unix-domain-socket-support.patch index f375f81d6b..7873f07d98 100644 --- a/patches/server/0650-Add-Unix-domain-socket-support.patch +++ b/patches/server/0648-Add-Unix-domain-socket-support.patch @@ -11,7 +11,7 @@ Tested-by: Mariell Hoversholm Reviewed-by: Mariell Hoversholm diff --git a/src/main/java/net/minecraft/network/Connection.java b/src/main/java/net/minecraft/network/Connection.java -index 0b62d34d8db4331365f1fc0c703bb8af05d5d12a..ec1fa6b6cb386542d9c83f5c49c1e8e98c87d417 100644 +index 86cc291b5b14523d57c84f8ebd6ba9b9c3b0d1a6..b5f884d6671823085a2ab0e8da2d30afd2928f32 100644 --- a/src/main/java/net/minecraft/network/Connection.java +++ b/src/main/java/net/minecraft/network/Connection.java @@ -641,6 +641,11 @@ public class Connection extends SimpleChannelInboundHandler> { diff --git a/patches/server/0651-Add-EntityInsideBlockEvent.patch b/patches/server/0649-Add-EntityInsideBlockEvent.patch similarity index 100% rename from patches/server/0651-Add-EntityInsideBlockEvent.patch rename to patches/server/0649-Add-EntityInsideBlockEvent.patch diff --git a/patches/server/0652-Attributes-API-for-item-defaults.patch b/patches/server/0650-Attributes-API-for-item-defaults.patch similarity index 94% rename from patches/server/0652-Attributes-API-for-item-defaults.patch rename to patches/server/0650-Attributes-API-for-item-defaults.patch index e9852950a1..882921f7c0 100644 --- a/patches/server/0652-Attributes-API-for-item-defaults.patch +++ b/patches/server/0650-Attributes-API-for-item-defaults.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Attributes API for item defaults diff --git a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java -index 44b922c9e6f022c1a9282c0cb686bbd8a8d1c675..c98c5e070349e5c9356a3dec2344a135ad8f0b56 100644 +index 0ebcadd6daf244cd9b6c943ca0a2baaafb3eba50..6fd3bbc36cb6e270a10f778fe2764823f90cca9c 100644 --- a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java +++ b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java @@ -545,6 +545,19 @@ public final class CraftMagicNumbers implements UnsafeValues { diff --git a/patches/server/0653-Add-cause-to-Weather-ThunderChangeEvents.patch b/patches/server/0651-Add-cause-to-Weather-ThunderChangeEvents.patch similarity index 100% rename from patches/server/0653-Add-cause-to-Weather-ThunderChangeEvents.patch rename to patches/server/0651-Add-cause-to-Weather-ThunderChangeEvents.patch diff --git a/patches/server/0654-More-Lidded-Block-API.patch b/patches/server/0652-More-Lidded-Block-API.patch similarity index 100% rename from patches/server/0654-More-Lidded-Block-API.patch rename to patches/server/0652-More-Lidded-Block-API.patch diff --git a/patches/server/0655-Limit-item-frame-cursors-on-maps.patch b/patches/server/0653-Limit-item-frame-cursors-on-maps.patch similarity index 100% rename from patches/server/0655-Limit-item-frame-cursors-on-maps.patch rename to patches/server/0653-Limit-item-frame-cursors-on-maps.patch diff --git a/patches/server/0656-Add-PlayerKickEvent-causes.patch b/patches/server/0654-Add-PlayerKickEvent-causes.patch similarity index 91% rename from patches/server/0656-Add-PlayerKickEvent-causes.patch rename to patches/server/0654-Add-PlayerKickEvent-causes.patch index f19ccd3c47..23347e20cb 100644 --- a/patches/server/0656-Add-PlayerKickEvent-causes.patch +++ b/patches/server/0654-Add-PlayerKickEvent-causes.patch @@ -5,10 +5,10 @@ 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 84e76fbe3eca77b112c9dff936e21cba1c83e5aa..98fe4165d291b47a39ce741884353c87dd0a4789 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 80) { ServerGamePacketListenerImpl.LOGGER.warn("{} was kicked for floating too long!", this.player.getName().getString()); @@ -69,7 +69,7 @@ index 2217d9b3bb589278da5b421ffce9e00261d08469..26b0bc810b4b09df9c910e3b8b49c18d return; } } else { -@@ -391,7 +391,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic +@@ -394,7 +394,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic if (this.clientVehicleIsFloating && this.player.getRootVehicle().getControllingPassenger() == this.player) { if (++this.aboveGroundVehicleTickCount > 80) { ServerGamePacketListenerImpl.LOGGER.warn("{} was kicked for floating a vehicle too long!", this.player.getName().getString()); @@ -78,7 +78,7 @@ index 2217d9b3bb589278da5b421ffce9e00261d08469..26b0bc810b4b09df9c910e3b8b49c18d return; } } else { -@@ -413,7 +413,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic +@@ -416,7 +416,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic if (this.keepAlivePending) { if (!this.processedDisconnect && elapsedTime >= KEEPALIVE_LIMIT) { // check keepalive limit, don't fire if already disconnected ServerGamePacketListenerImpl.LOGGER.warn("{} was kicked due to keepalive timeout!", this.player.getScoreboardName()); // more info @@ -87,7 +87,7 @@ index 2217d9b3bb589278da5b421ffce9e00261d08469..26b0bc810b4b09df9c910e3b8b49c18d } } else { if (elapsedTime >= 15000L) { // 15 seconds -@@ -443,7 +443,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic +@@ -446,7 +446,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic if (this.player.getLastActionTime() > 0L && this.server.getPlayerIdleTimeout() > 0 && Util.getMillis() - this.player.getLastActionTime() > (long) (this.server.getPlayerIdleTimeout() * 1000 * 60)) { this.player.resetLastActionTime(); // CraftBukkit - SPIGOT-854 @@ -96,7 +96,7 @@ index 2217d9b3bb589278da5b421ffce9e00261d08469..26b0bc810b4b09df9c910e3b8b49c18d } this.chatPreviewThrottler.tick(); -@@ -467,16 +467,26 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic +@@ -470,16 +470,26 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic return this.server.isSingleplayerOwner(this.player.getGameProfile()); } @@ -126,7 +126,7 @@ index 2217d9b3bb589278da5b421ffce9e00261d08469..26b0bc810b4b09df9c910e3b8b49c18d // Paper end // CraftBukkit start - fire PlayerKickEvent if (this.processedDisconnect) { -@@ -505,7 +515,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic +@@ -508,7 +518,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic net.kyori.adventure.text.Component leaveMessage = net.kyori.adventure.text.Component.translatable("multiplayer.player.left", net.kyori.adventure.text.format.NamedTextColor.YELLOW, io.papermc.paper.configuration.GlobalConfiguration.get().messages.useDisplayNameInQuitMessage ? this.player.getBukkitEntity().displayName() : net.kyori.adventure.text.Component.text(this.player.getScoreboardName())); // Paper - Adventure @@ -135,7 +135,7 @@ index 2217d9b3bb589278da5b421ffce9e00261d08469..26b0bc810b4b09df9c910e3b8b49c18d if (this.cserver.getServer().isRunning()) { this.cserver.getPluginManager().callEvent(event); -@@ -575,7 +585,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic +@@ -578,7 +588,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic public void handleMoveVehicle(ServerboundMoveVehiclePacket packet) { PacketUtils.ensureRunningOnSameThread(packet, this, this.player.getLevel()); if (ServerGamePacketListenerImpl.containsInvalidValues(packet.getX(), packet.getY(), packet.getZ(), packet.getYRot(), packet.getXRot())) { @@ -144,7 +144,7 @@ index 2217d9b3bb589278da5b421ffce9e00261d08469..26b0bc810b4b09df9c910e3b8b49c18d } else { Entity entity = this.player.getRootVehicle(); -@@ -773,7 +783,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic +@@ -776,7 +786,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic PacketUtils.ensureRunningOnSameThread(packet, this, this.player.getLevel()); if (packet.getId() == this.awaitingTeleport) { if (this.awaitingPositionFromClient == null) { @@ -153,7 +153,7 @@ index 2217d9b3bb589278da5b421ffce9e00261d08469..26b0bc810b4b09df9c910e3b8b49c18d return; } -@@ -826,13 +836,13 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic +@@ -833,13 +843,13 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic // PacketUtils.ensureRunningOnSameThread(packet, this, this.player.getLevel()); // Paper - run this async // CraftBukkit start if (this.chatSpamTickCount.addAndGet(io.papermc.paper.configuration.GlobalConfiguration.get().spamLimiter.tabSpamIncrement) > io.papermc.paper.configuration.GlobalConfiguration.get().spamLimiter.tabSpamLimit && !this.server.getPlayerList().isOp(this.player.getGameProfile())) { // Paper start - split and make configurable @@ -169,7 +169,7 @@ index 2217d9b3bb589278da5b421ffce9e00261d08469..26b0bc810b4b09df9c910e3b8b49c18d return; } // Paper end -@@ -985,7 +995,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic +@@ -992,7 +1002,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic // Paper start - validate pick item position if (!(packet.getSlot() >= 0 && packet.getSlot() < this.player.getInventory().items.size())) { ServerGamePacketListenerImpl.LOGGER.warn("{} tried to set an invalid carried item", this.player.getName().getString()); @@ -178,7 +178,7 @@ index 2217d9b3bb589278da5b421ffce9e00261d08469..26b0bc810b4b09df9c910e3b8b49c18d return; } this.player.getInventory().pickSlot(packet.getSlot()); // Paper - Diff above if changed -@@ -1172,7 +1182,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic +@@ -1179,7 +1189,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic int byteLength = testString.getBytes(java.nio.charset.StandardCharsets.UTF_8).length; if (byteLength > 256 * 4) { ServerGamePacketListenerImpl.LOGGER.warn(this.player.getScoreboardName() + " tried to send a book with with a page too large!"); @@ -187,7 +187,7 @@ index 2217d9b3bb589278da5b421ffce9e00261d08469..26b0bc810b4b09df9c910e3b8b49c18d return; } byteTotal += byteLength; -@@ -1195,14 +1205,14 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic +@@ -1202,14 +1212,14 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic if (byteTotal > byteAllowed) { ServerGamePacketListenerImpl.LOGGER.warn(this.player.getScoreboardName() + " tried to send too large of a book. Book Size: " + byteTotal + " - Allowed: "+ byteAllowed + " - Pages: " + pageList.size()); @@ -204,7 +204,7 @@ index 2217d9b3bb589278da5b421ffce9e00261d08469..26b0bc810b4b09df9c910e3b8b49c18d return; } this.lastBookTick = MinecraftServer.currentTick; -@@ -1326,7 +1336,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic +@@ -1333,7 +1343,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic public void handleMovePlayer(ServerboundMovePlayerPacket packet) { PacketUtils.ensureRunningOnSameThread(packet, this, this.player.getLevel()); if (ServerGamePacketListenerImpl.containsInvalidValues(packet.getX(0.0D), packet.getY(0.0D), packet.getZ(0.0D), packet.getYRot(0.0F), packet.getXRot(0.0F))) { @@ -213,7 +213,7 @@ index 2217d9b3bb589278da5b421ffce9e00261d08469..26b0bc810b4b09df9c910e3b8b49c18d } else { ServerLevel worldserver = this.player.getLevel(); -@@ -1753,7 +1763,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic +@@ -1760,7 +1770,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic this.dropCount++; if (this.dropCount >= 20) { ServerGamePacketListenerImpl.LOGGER.warn(this.player.getScoreboardName() + " dropped their items too quickly!"); @@ -222,7 +222,7 @@ index 2217d9b3bb589278da5b421ffce9e00261d08469..26b0bc810b4b09df9c910e3b8b49c18d return; } } -@@ -1961,7 +1971,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic +@@ -1968,7 +1978,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic PacketUtils.ensureRunningOnSameThread(packet, this, this.player.getLevel()); if (packet.getAction() == ServerboundResourcePackPacket.Action.DECLINED && this.server.isResourcePackRequired()) { ServerGamePacketListenerImpl.LOGGER.info("Disconnecting {} due to resource pack rejection", this.player.getName()); @@ -231,7 +231,7 @@ index 2217d9b3bb589278da5b421ffce9e00261d08469..26b0bc810b4b09df9c910e3b8b49c18d } // Paper start PlayerResourcePackStatusEvent.Status packStatus = PlayerResourcePackStatusEvent.Status.values()[packet.action.ordinal()]; -@@ -2074,7 +2084,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic +@@ -2081,7 +2091,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic this.player.resetLastActionTime(); } else { ServerGamePacketListenerImpl.LOGGER.warn("{} tried to set an invalid carried item", this.player.getName().getString()); @@ -240,7 +240,7 @@ index 2217d9b3bb589278da5b421ffce9e00261d08469..26b0bc810b4b09df9c910e3b8b49c18d } } -@@ -2087,7 +2097,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic +@@ -2094,7 +2104,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic } // CraftBukkit end if (ServerGamePacketListenerImpl.isChatMessageIllegal(packet.message())) { @@ -249,7 +249,7 @@ index 2217d9b3bb589278da5b421ffce9e00261d08469..26b0bc810b4b09df9c910e3b8b49c18d } else { if (this.tryHandleChat(packet.message(), packet.timeStamp(), packet.lastSeenMessages())) { // this.server.submit(() -> { // CraftBukkit - async chat -@@ -2115,7 +2125,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic +@@ -2122,7 +2132,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic @Override public void handleChatCommand(ServerboundChatCommandPacket packet) { if (ServerGamePacketListenerImpl.isChatMessageIllegal(packet.command())) { @@ -258,7 +258,7 @@ index 2217d9b3bb589278da5b421ffce9e00261d08469..26b0bc810b4b09df9c910e3b8b49c18d } else { if (this.tryHandleChat(packet.command(), packet.timeStamp(), packet.lastSeenMessages())) { this.server.submit(() -> { -@@ -2201,7 +2211,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic +@@ -2208,7 +2218,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic private boolean tryHandleChat(String message, Instant timestamp, LastSeenMessages.Update acknowledgment) { if (!this.updateChatOrder(timestamp)) { ServerGamePacketListenerImpl.LOGGER.warn("{} sent out-of-order chat: '{}'", this.player.getName().getString(), message); @@ -267,16 +267,16 @@ 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 - ChatSender chatsender = this.player.asChatSender(); +@@ -2467,7 +2477,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic + } - if (chatsender.profilePublicKey() != null && !message.verify(chatsender)) { -- 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 - return false; - } else { - if (message.hasExpiredServer(Instant.now())) { -@@ -2477,7 +2487,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic + if (!playerchatmessage.verify(chatsender)) { +- 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 + return false; + } + } +@@ -2495,7 +2505,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 +@@ -2598,7 +2608,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic private void handleValidationFailure(Set 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 +@@ -2745,7 +2755,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 +@@ -2760,7 +2770,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 +@@ -2858,7 +2868,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 +@@ -3266,7 +3276,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 +@@ -3469,7 +3479,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 +@@ -3515,7 +3525,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 +@@ -3525,7 +3535,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 +@@ -3543,7 +3553,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 63f92d68b91f1049802a1541c7ec4efaa324ac11..c332750833cccee1264a3399ed0539f6fee6af44 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 { @@ -391,7 +391,7 @@ index bdb37391b9df7ec4983728de8324aa3f1ed20f4b..ca0ad4fd5f4aafacd197494970f2aec3 // CraftBukkit end diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -index 7d030d7a8a58f4a031e09d09c9718af3d3c1e707..140730ff3e10066d19321c75e241a1e0d8d3ba17 100644 +index 0004b78b63a2bf4b34467f9a550f6f0807e4dfb4..4750ac09f2abfb712b042028a95d23121ffc049f 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java @@ -516,7 +516,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player { diff --git a/patches/server/0657-Add-PufferFishStateChangeEvent.patch b/patches/server/0655-Add-PufferFishStateChangeEvent.patch similarity index 100% rename from patches/server/0657-Add-PufferFishStateChangeEvent.patch rename to patches/server/0655-Add-PufferFishStateChangeEvent.patch diff --git a/patches/server/0658-Fix-PlayerBucketEmptyEvent-result-itemstack.patch b/patches/server/0656-Fix-PlayerBucketEmptyEvent-result-itemstack.patch similarity index 100% rename from patches/server/0658-Fix-PlayerBucketEmptyEvent-result-itemstack.patch rename to patches/server/0656-Fix-PlayerBucketEmptyEvent-result-itemstack.patch diff --git a/patches/server/0659-Synchronize-PalettedContainer-instead-of-ThreadingDe.patch b/patches/server/0657-Synchronize-PalettedContainer-instead-of-ThreadingDe.patch similarity index 97% rename from patches/server/0659-Synchronize-PalettedContainer-instead-of-ThreadingDe.patch rename to patches/server/0657-Synchronize-PalettedContainer-instead-of-ThreadingDe.patch index 0c92b3cd69..af97198c95 100644 --- a/patches/server/0659-Synchronize-PalettedContainer-instead-of-ThreadingDe.patch +++ b/patches/server/0657-Synchronize-PalettedContainer-instead-of-ThreadingDe.patch @@ -14,7 +14,7 @@ contention situations. And this is extremely a low contention situation. diff --git a/src/main/java/net/minecraft/world/level/chunk/PalettedContainer.java b/src/main/java/net/minecraft/world/level/chunk/PalettedContainer.java -index 723608946947fa2792c7284fa5faa85ab9507897..e77b516995666402cc8814ac78a6c11077108b2e 100644 +index b688d239ff11b315f60cd980d8f6780b982a865b..d93118b7a602ceb6ef11ddabbce1d13fb8029a44 100644 --- a/src/main/java/net/minecraft/world/level/chunk/PalettedContainer.java +++ b/src/main/java/net/minecraft/world/level/chunk/PalettedContainer.java @@ -32,14 +32,14 @@ public class PalettedContainer implements PaletteResize, PalettedContainer diff --git a/patches/server/0660-Add-option-to-fix-items-merging-through-walls.patch b/patches/server/0658-Add-option-to-fix-items-merging-through-walls.patch similarity index 100% rename from patches/server/0660-Add-option-to-fix-items-merging-through-walls.patch rename to patches/server/0658-Add-option-to-fix-items-merging-through-walls.patch diff --git a/patches/server/0661-Add-BellRevealRaiderEvent.patch b/patches/server/0659-Add-BellRevealRaiderEvent.patch similarity index 100% rename from patches/server/0661-Add-BellRevealRaiderEvent.patch rename to patches/server/0659-Add-BellRevealRaiderEvent.patch diff --git a/patches/server/0662-Fix-invulnerable-end-crystals.patch b/patches/server/0660-Fix-invulnerable-end-crystals.patch similarity index 100% rename from patches/server/0662-Fix-invulnerable-end-crystals.patch rename to patches/server/0660-Fix-invulnerable-end-crystals.patch diff --git a/patches/server/0663-Add-ElderGuardianAppearanceEvent.patch b/patches/server/0661-Add-ElderGuardianAppearanceEvent.patch similarity index 100% rename from patches/server/0663-Add-ElderGuardianAppearanceEvent.patch rename to patches/server/0661-Add-ElderGuardianAppearanceEvent.patch diff --git a/patches/server/0664-Fix-dangerous-end-portal-logic.patch b/patches/server/0662-Fix-dangerous-end-portal-logic.patch similarity index 100% rename from patches/server/0664-Fix-dangerous-end-portal-logic.patch rename to patches/server/0662-Fix-dangerous-end-portal-logic.patch diff --git a/patches/server/0665-Optimize-Biome-Mob-Lookups-for-Mob-Spawning.patch b/patches/server/0663-Optimize-Biome-Mob-Lookups-for-Mob-Spawning.patch similarity index 100% rename from patches/server/0665-Optimize-Biome-Mob-Lookups-for-Mob-Spawning.patch rename to patches/server/0663-Optimize-Biome-Mob-Lookups-for-Mob-Spawning.patch diff --git a/patches/server/0666-Make-item-validations-configurable.patch b/patches/server/0664-Make-item-validations-configurable.patch similarity index 100% rename from patches/server/0666-Make-item-validations-configurable.patch rename to patches/server/0664-Make-item-validations-configurable.patch diff --git a/patches/server/0667-Line-Of-Sight-Changes.patch b/patches/server/0665-Line-Of-Sight-Changes.patch similarity index 100% rename from patches/server/0667-Line-Of-Sight-Changes.patch rename to patches/server/0665-Line-Of-Sight-Changes.patch diff --git a/patches/server/0668-add-per-world-spawn-limits.patch b/patches/server/0666-add-per-world-spawn-limits.patch similarity index 100% rename from patches/server/0668-add-per-world-spawn-limits.patch rename to patches/server/0666-add-per-world-spawn-limits.patch diff --git a/patches/server/0669-Fix-PotionSplashEvent-for-water-splash-potions.patch b/patches/server/0667-Fix-PotionSplashEvent-for-water-splash-potions.patch similarity index 100% rename from patches/server/0669-Fix-PotionSplashEvent-for-water-splash-potions.patch rename to patches/server/0667-Fix-PotionSplashEvent-for-water-splash-potions.patch diff --git a/patches/server/0670-Add-more-LimitedRegion-API.patch b/patches/server/0668-Add-more-LimitedRegion-API.patch similarity index 100% rename from patches/server/0670-Add-more-LimitedRegion-API.patch rename to patches/server/0668-Add-more-LimitedRegion-API.patch diff --git a/patches/server/0671-Fix-PlayerDropItemEvent-using-wrong-item.patch b/patches/server/0669-Fix-PlayerDropItemEvent-using-wrong-item.patch similarity index 91% rename from patches/server/0671-Fix-PlayerDropItemEvent-using-wrong-item.patch rename to patches/server/0669-Fix-PlayerDropItemEvent-using-wrong-item.patch index c053f7f56a..7d613a826d 100644 --- a/patches/server/0671-Fix-PlayerDropItemEvent-using-wrong-item.patch +++ b/patches/server/0669-Fix-PlayerDropItemEvent-using-wrong-item.patch @@ -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 4a35720430990b358ea5d7f2b6293e27e8d9f7ac..9a60cf249e0b9f089b0966c670e6046e7e1ed08a 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()) { diff --git a/patches/server/0672-Missing-Entity-Behavior-API.patch b/patches/server/0670-Missing-Entity-Behavior-API.patch similarity index 96% rename from patches/server/0672-Missing-Entity-Behavior-API.patch rename to patches/server/0670-Missing-Entity-Behavior-API.patch index 6e76bcfa3a..6630ab2427 100644 --- a/patches/server/0672-Missing-Entity-Behavior-API.patch +++ b/patches/server/0670-Missing-Entity-Behavior-API.patch @@ -3,7 +3,7 @@ From: Owen1212055 <23108066+Owen1212055@users.noreply.github.com> Date: Mon, 21 Jun 2021 23:56:07 -0400 Subject: [PATCH] Missing Entity Behavior API -Co-authored-by: Nassim Jahnke +Co-authored-by: Nassim Jahnke Co-authored-by: Jake Potrebic diff --git a/src/main/java/net/minecraft/world/entity/animal/Bee.java b/src/main/java/net/minecraft/world/entity/animal/Bee.java @@ -556,6 +556,24 @@ index 8a0a905f6701c6e94cbbf15793788350958fb728..2a74e6ecb4f57bc6879b37f7bc067541 } } +diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftWarden.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftWarden.java +index 024107a70cc517224b98581389db5cbf1977a1a3..4bec74bd45e3abc0fd0f2e07ed5ad9003b6aea33 100644 +--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftWarden.java ++++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftWarden.java +@@ -34,6 +34,13 @@ public class CraftWarden extends CraftMonster implements org.bukkit.entity.Warde + return this.getHandle().getAngerManagement().getActiveAnger(((CraftEntity) entity).getHandle()); + } + ++ // Paper start ++ @Override ++ public int getHighestAnger() { ++ return this.getHandle().getAngerManagement().getActiveAnger(null); ++ } ++ // Paper end ++ + @Override + public void increaseAnger(Entity entity, int increase) { + Preconditions.checkArgument(entity != null, "Entity cannot be null"); diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftWither.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftWither.java index e92355fa2042c4cf15354a11b7058cacbe996f0d..4cf3a374c9ee7c7bcf82e778aa094eb4f8463595 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftWither.java diff --git a/patches/server/0673-Ensure-disconnect-for-book-edit-is-called-on-main.patch b/patches/server/0671-Ensure-disconnect-for-book-edit-is-called-on-main.patch similarity index 88% rename from patches/server/0673-Ensure-disconnect-for-book-edit-is-called-on-main.patch rename to patches/server/0671-Ensure-disconnect-for-book-edit-is-called-on-main.patch index 7a25a37d56..1901b7c972 100644 --- a/patches/server/0673-Ensure-disconnect-for-book-edit-is-called-on-main.patch +++ b/patches/server/0671-Ensure-disconnect-for-book-edit-is-called-on-main.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Ensure disconnect for book edit is called on main diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -index 5cb42f3ec712bec46d76684e8e0a3f0f547d2586..685745b853f86fa2eda031ad20317ad321b1379a 100644 +index 32262185c3997c17f1b5b1847f768789de7659e6..c59cfe44536b62e1853903bd22990197b9d85083 100644 --- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -@@ -1212,7 +1212,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic +@@ -1219,7 +1219,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic // Paper end // CraftBukkit start if (this.lastBookTick + 20 > MinecraftServer.currentTick) { diff --git a/patches/server/0674-Fix-return-value-of-Block-applyBoneMeal-always-being.patch b/patches/server/0672-Fix-return-value-of-Block-applyBoneMeal-always-being.patch similarity index 100% rename from patches/server/0674-Fix-return-value-of-Block-applyBoneMeal-always-being.patch rename to patches/server/0672-Fix-return-value-of-Block-applyBoneMeal-always-being.patch diff --git a/patches/server/0675-Use-getChunkIfLoadedImmediately-in-places.patch b/patches/server/0673-Use-getChunkIfLoadedImmediately-in-places.patch similarity index 100% rename from patches/server/0675-Use-getChunkIfLoadedImmediately-in-places.patch rename to patches/server/0673-Use-getChunkIfLoadedImmediately-in-places.patch diff --git a/patches/server/0676-Fix-commands-from-signs-not-firing-command-events.patch b/patches/server/0674-Fix-commands-from-signs-not-firing-command-events.patch similarity index 97% rename from patches/server/0676-Fix-commands-from-signs-not-firing-command-events.patch rename to patches/server/0674-Fix-commands-from-signs-not-firing-command-events.patch index db3b70bf78..c66c6d829d 100644 --- a/patches/server/0676-Fix-commands-from-signs-not-firing-command-events.patch +++ b/patches/server/0674-Fix-commands-from-signs-not-firing-command-events.patch @@ -112,10 +112,10 @@ index 831db5ee21938d71e99bf9d17b92a6ca15531740..def4fdd2c7e4f925fa128692a744e5d1 public DyeColor getColor() { diff --git a/src/main/java/org/bukkit/craftbukkit/command/BukkitCommandWrapper.java b/src/main/java/org/bukkit/craftbukkit/command/BukkitCommandWrapper.java -index 9e4a660bdeaa70536bd8aeb90aa4a6a979f3f061..2476727cd60034c4df2db36b9ed808e72d7b686f 100644 +index d113e54a30db16e2ad955170df6030d15de530d6..26f3a2799e687731d883e7733591f6934479e88d 100644 --- a/src/main/java/org/bukkit/craftbukkit/command/BukkitCommandWrapper.java +++ b/src/main/java/org/bukkit/craftbukkit/command/BukkitCommandWrapper.java -@@ -56,7 +56,7 @@ public class BukkitCommandWrapper implements com.mojang.brigadier.Command { this.connection.disconnect(ichatbasecomponent); })); @@ -37,7 +37,7 @@ index c65c72a2dd3c87621c1369c52770b912057eafd2..bd152bdb0e00b807c514f601ec400a1a this.connection.setReadOnly(); MinecraftServer minecraftserver = this.server; Connection networkmanager = this.connection; -@@ -1996,6 +1995,11 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic +@@ -2003,6 +2002,11 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic @Override public void onDisconnect(Component reason) { @@ -49,7 +49,7 @@ index c65c72a2dd3c87621c1369c52770b912057eafd2..bd152bdb0e00b807c514f601ec400a1a // CraftBukkit start - Rarely it would send a disconnect line twice if (this.processedDisconnect) { return; -@@ -2012,7 +2016,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic +@@ -2019,7 +2023,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic this.player.disconnect(); // Paper start - Adventure @@ -59,7 +59,7 @@ index c65c72a2dd3c87621c1369c52770b912057eafd2..bd152bdb0e00b807c514f601ec400a1a this.server.getPlayerList().broadcastSystemMessage(PaperAdventure.asVanilla(quitMessage), false); // Paper end diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java -index ca0ad4fd5f4aafacd197494970f2aec3b2a6c4d0..0354b7e20bbc9f888cf85d6db42ce2b64a25b4c2 100644 +index c332750833cccee1264a3399ed0539f6fee6af44..0e20ebf895e7ebe4201a8596519929ea65f653af 100644 --- a/src/main/java/net/minecraft/server/players/PlayerList.java +++ b/src/main/java/net/minecraft/server/players/PlayerList.java @@ -592,6 +592,11 @@ public abstract class PlayerList { diff --git a/patches/server/0679-Add-config-for-mobs-immune-to-default-effects.patch b/patches/server/0677-Add-config-for-mobs-immune-to-default-effects.patch similarity index 100% rename from patches/server/0679-Add-config-for-mobs-immune-to-default-effects.patch rename to patches/server/0677-Add-config-for-mobs-immune-to-default-effects.patch diff --git a/patches/server/0680-Fix-incorrect-message-for-outdated-client.patch b/patches/server/0678-Fix-incorrect-message-for-outdated-client.patch similarity index 100% rename from patches/server/0680-Fix-incorrect-message-for-outdated-client.patch rename to patches/server/0678-Fix-incorrect-message-for-outdated-client.patch diff --git a/patches/server/0681-Don-t-apply-cramming-damage-to-players.patch b/patches/server/0679-Don-t-apply-cramming-damage-to-players.patch similarity index 93% rename from patches/server/0681-Don-t-apply-cramming-damage-to-players.patch rename to patches/server/0679-Don-t-apply-cramming-damage-to-players.patch index 42b7636a7a..28e1719c3c 100644 --- a/patches/server/0681-Don-t-apply-cramming-damage-to-players.patch +++ b/patches/server/0679-Don-t-apply-cramming-damage-to-players.patch @@ -11,7 +11,7 @@ It does not make a lot of sense to damage players if they get crammed, For those who really want it a config option is provided. diff --git a/src/main/java/net/minecraft/server/level/ServerPlayer.java b/src/main/java/net/minecraft/server/level/ServerPlayer.java -index 7670c02dca163d360e64a1491f2efe69aaaab411..f523311e822af9cbef571338fd8fef177b9fc73d 100644 +index 787f2b23352fbfb66a76ca5fce6de94cc10b30d2..56ac440465813a7dab8d166e882e18143a50729f 100644 --- a/src/main/java/net/minecraft/server/level/ServerPlayer.java +++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java @@ -1446,7 +1446,7 @@ public class ServerPlayer extends Player { diff --git a/patches/server/0682-Rate-options-and-timings-for-sensors-and-behaviors.patch b/patches/server/0680-Rate-options-and-timings-for-sensors-and-behaviors.patch similarity index 100% rename from patches/server/0682-Rate-options-and-timings-for-sensors-and-behaviors.patch rename to patches/server/0680-Rate-options-and-timings-for-sensors-and-behaviors.patch diff --git a/patches/server/0683-Add-a-bunch-of-missing-forceDrop-toggles.patch b/patches/server/0681-Add-a-bunch-of-missing-forceDrop-toggles.patch similarity index 100% rename from patches/server/0683-Add-a-bunch-of-missing-forceDrop-toggles.patch rename to patches/server/0681-Add-a-bunch-of-missing-forceDrop-toggles.patch diff --git a/patches/server/0684-Stinger-API.patch b/patches/server/0682-Stinger-API.patch similarity index 100% rename from patches/server/0684-Stinger-API.patch rename to patches/server/0682-Stinger-API.patch diff --git a/patches/server/0685-Fix-incosistency-issue-with-empty-map-items-in-CB.patch b/patches/server/0683-Fix-incosistency-issue-with-empty-map-items-in-CB.patch similarity index 100% rename from patches/server/0685-Fix-incosistency-issue-with-empty-map-items-in-CB.patch rename to patches/server/0683-Fix-incosistency-issue-with-empty-map-items-in-CB.patch diff --git a/patches/server/0686-Add-System.out-err-catcher.patch b/patches/server/0684-Add-System.out-err-catcher.patch similarity index 97% rename from patches/server/0686-Add-System.out-err-catcher.patch rename to patches/server/0684-Add-System.out-err-catcher.patch index 58a7215c05..ce81957ca1 100644 --- a/patches/server/0686-Add-System.out-err-catcher.patch +++ b/patches/server/0684-Add-System.out-err-catcher.patch @@ -105,10 +105,10 @@ index 0000000000000000000000000000000000000000..76d0d00cd6742991e3f3ec827a75ee87 + } +} diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -index e8f327693e8b488790bf58d4927497402211bf1d..2f91be86f31c868dee3699ce5426a3ce5c8296b0 100644 +index 96e207db7c06f02bdcae9af482bf2d36b5baee9b..589ee4fd2a7f2c81ef0324662d8349cd3105373f 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -@@ -282,6 +282,7 @@ public final class CraftServer implements Server { +@@ -284,6 +284,7 @@ public final class CraftServer implements Server { public int reloadCount; private final io.papermc.paper.datapack.PaperDatapackManager datapackManager; // Paper public static Exception excessiveVelEx; // Paper - Velocity warnings diff --git a/patches/server/0687-Fix-test-not-bootstrapping.patch b/patches/server/0685-Fix-test-not-bootstrapping.patch similarity index 100% rename from patches/server/0687-Fix-test-not-bootstrapping.patch rename to patches/server/0685-Fix-test-not-bootstrapping.patch diff --git a/patches/server/0688-Rewrite-LogEvents-to-contain-the-source-jars-in-stac.patch b/patches/server/0686-Rewrite-LogEvents-to-contain-the-source-jars-in-stac.patch similarity index 100% rename from patches/server/0688-Rewrite-LogEvents-to-contain-the-source-jars-in-stac.patch rename to patches/server/0686-Rewrite-LogEvents-to-contain-the-source-jars-in-stac.patch diff --git a/patches/server/0689-Improve-boat-collision-performance.patch b/patches/server/0687-Improve-boat-collision-performance.patch similarity index 100% rename from patches/server/0689-Improve-boat-collision-performance.patch rename to patches/server/0687-Improve-boat-collision-performance.patch diff --git a/patches/server/0690-Prevent-AFK-kick-while-watching-end-credits.patch b/patches/server/0688-Prevent-AFK-kick-while-watching-end-credits.patch similarity index 89% rename from patches/server/0690-Prevent-AFK-kick-while-watching-end-credits.patch rename to patches/server/0688-Prevent-AFK-kick-while-watching-end-credits.patch index 0b2683b9e2..256b532261 100644 --- a/patches/server/0690-Prevent-AFK-kick-while-watching-end-credits.patch +++ b/patches/server/0688-Prevent-AFK-kick-while-watching-end-credits.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Prevent AFK kick while watching end credits. diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -index e1993c9f08b73e4366f60369e7f147c9c8bda958..e8cd8adad14c6bcab3ccef7fcc458b38d90592c3 100644 +index e1b3045d4fa6f69e9d70279980ab7ef46404e782..6a20b0265b278593c87f61206785090b9392f6d6 100644 --- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -@@ -441,7 +441,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic +@@ -444,7 +444,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic --this.dropSpamTickCount; } diff --git a/patches/server/0691-Allow-skipping-writing-of-comments-to-server.propert.patch b/patches/server/0689-Allow-skipping-writing-of-comments-to-server.propert.patch similarity index 100% rename from patches/server/0691-Allow-skipping-writing-of-comments-to-server.propert.patch rename to patches/server/0689-Allow-skipping-writing-of-comments-to-server.propert.patch diff --git a/patches/server/0692-Add-PlayerSetSpawnEvent.patch b/patches/server/0690-Add-PlayerSetSpawnEvent.patch similarity index 95% rename from patches/server/0692-Add-PlayerSetSpawnEvent.patch rename to patches/server/0690-Add-PlayerSetSpawnEvent.patch index b1aa1739f5..fb613de145 100644 --- a/patches/server/0692-Add-PlayerSetSpawnEvent.patch +++ b/patches/server/0690-Add-PlayerSetSpawnEvent.patch @@ -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 56ac440465813a7dab8d166e882e18143a50729f..80e1970f568a74a43e624188a77cfbd28cfa52dd 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 0e20ebf895e7ebe4201a8596519929ea65f653af..03c413dfd16f415377749baa4fdd41949c6a12b9 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 bf5931cbcfbfdc6e68706b7e86b24b2478e4bbef..55f4a09bc27c30936e29fa2a2fe2ef0a67b8876d 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 { diff --git a/patches/server/0693-Make-hoppers-respect-inventory-max-stack-size.patch b/patches/server/0691-Make-hoppers-respect-inventory-max-stack-size.patch similarity index 100% rename from patches/server/0693-Make-hoppers-respect-inventory-max-stack-size.patch rename to patches/server/0691-Make-hoppers-respect-inventory-max-stack-size.patch diff --git a/patches/server/0694-Optimize-entity-tracker-passenger-checks.patch b/patches/server/0692-Optimize-entity-tracker-passenger-checks.patch similarity index 100% rename from patches/server/0694-Optimize-entity-tracker-passenger-checks.patch rename to patches/server/0692-Optimize-entity-tracker-passenger-checks.patch diff --git a/patches/server/0695-Config-option-for-Piglins-guarding-chests.patch b/patches/server/0693-Config-option-for-Piglins-guarding-chests.patch similarity index 100% rename from patches/server/0695-Config-option-for-Piglins-guarding-chests.patch rename to patches/server/0693-Config-option-for-Piglins-guarding-chests.patch diff --git a/patches/server/0696-Added-EntityDamageItemEvent.patch b/patches/server/0694-Added-EntityDamageItemEvent.patch similarity index 100% rename from patches/server/0696-Added-EntityDamageItemEvent.patch rename to patches/server/0694-Added-EntityDamageItemEvent.patch diff --git a/patches/server/0697-Optimize-indirect-passenger-iteration.patch b/patches/server/0695-Optimize-indirect-passenger-iteration.patch similarity index 100% rename from patches/server/0697-Optimize-indirect-passenger-iteration.patch rename to patches/server/0695-Optimize-indirect-passenger-iteration.patch diff --git a/patches/server/0698-Fix-block-drops-position-losing-precision-millions-o.patch b/patches/server/0696-Fix-block-drops-position-losing-precision-millions-o.patch similarity index 100% rename from patches/server/0698-Fix-block-drops-position-losing-precision-millions-o.patch rename to patches/server/0696-Fix-block-drops-position-losing-precision-millions-o.patch diff --git a/patches/server/0699-Configurable-item-frame-map-cursor-update-interval.patch b/patches/server/0697-Configurable-item-frame-map-cursor-update-interval.patch similarity index 100% rename from patches/server/0699-Configurable-item-frame-map-cursor-update-interval.patch rename to patches/server/0697-Configurable-item-frame-map-cursor-update-interval.patch diff --git a/patches/server/0700-Make-EntityUnleashEvent-cancellable.patch b/patches/server/0698-Make-EntityUnleashEvent-cancellable.patch similarity index 100% rename from patches/server/0700-Make-EntityUnleashEvent-cancellable.patch rename to patches/server/0698-Make-EntityUnleashEvent-cancellable.patch diff --git a/patches/server/0701-Clear-bucket-NBT-after-dispense.patch b/patches/server/0699-Clear-bucket-NBT-after-dispense.patch similarity index 100% rename from patches/server/0701-Clear-bucket-NBT-after-dispense.patch rename to patches/server/0699-Clear-bucket-NBT-after-dispense.patch diff --git a/patches/server/0702-Change-EnderEye-target-without-changing-other-things.patch b/patches/server/0700-Change-EnderEye-target-without-changing-other-things.patch similarity index 100% rename from patches/server/0702-Change-EnderEye-target-without-changing-other-things.patch rename to patches/server/0700-Change-EnderEye-target-without-changing-other-things.patch diff --git a/patches/server/0703-Add-BlockBreakBlockEvent.patch b/patches/server/0701-Add-BlockBreakBlockEvent.patch similarity index 100% rename from patches/server/0703-Add-BlockBreakBlockEvent.patch rename to patches/server/0701-Add-BlockBreakBlockEvent.patch diff --git a/patches/server/0704-Option-to-prevent-NBT-copy-in-smithing-recipes.patch b/patches/server/0702-Option-to-prevent-NBT-copy-in-smithing-recipes.patch similarity index 100% rename from patches/server/0704-Option-to-prevent-NBT-copy-in-smithing-recipes.patch rename to patches/server/0702-Option-to-prevent-NBT-copy-in-smithing-recipes.patch diff --git a/patches/server/0705-More-CommandBlock-API.patch b/patches/server/0703-More-CommandBlock-API.patch similarity index 100% rename from patches/server/0705-More-CommandBlock-API.patch rename to patches/server/0703-More-CommandBlock-API.patch diff --git a/patches/server/0704-Add-missing-team-sidebar-display-slots.patch b/patches/server/0704-Add-missing-team-sidebar-display-slots.patch new file mode 100644 index 0000000000..ee0f1ced64 --- /dev/null +++ b/patches/server/0704-Add-missing-team-sidebar-display-slots.patch @@ -0,0 +1,102 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Jake Potrebic +Date: Fri, 1 Oct 2021 08:04:39 -0700 +Subject: [PATCH] Add missing team sidebar display slots + + +diff --git a/src/main/java/org/bukkit/craftbukkit/scoreboard/CraftScoreboardTranslations.java b/src/main/java/org/bukkit/craftbukkit/scoreboard/CraftScoreboardTranslations.java +index e2d3fe9af7d3bd82bee519b20e141cd58f68bbd6..944a4fee237730c0d89567aaa6ddf268467aa0e0 100644 +--- a/src/main/java/org/bukkit/craftbukkit/scoreboard/CraftScoreboardTranslations.java ++++ b/src/main/java/org/bukkit/craftbukkit/scoreboard/CraftScoreboardTranslations.java +@@ -7,36 +7,23 @@ import org.bukkit.scoreboard.DisplaySlot; + import org.bukkit.scoreboard.RenderType; + + public final class CraftScoreboardTranslations { +- static final int MAX_DISPLAY_SLOT = 19; ++ static final int MAX_DISPLAY_SLOT = Scoreboard.getDisplaySlotNames().length; // Paper ++ @Deprecated // Paper + static final ImmutableBiMap SLOTS = ImmutableBiMap.builder() + .put(DisplaySlot.BELOW_NAME, "belowName") + .put(DisplaySlot.PLAYER_LIST, "list") + .put(DisplaySlot.SIDEBAR, "sidebar") +- .put(DisplaySlot.SIDEBAR_BLACK, "sidebar.team.black") +- .put(DisplaySlot.SIDEBAR_DARK_BLUE, "sidebar.team.dark_blue") +- .put(DisplaySlot.SIDEBAR_DARK_GREEN, "sidebar.team.dark_green") +- .put(DisplaySlot.SIDEBAR_DARK_AQUA, "sidebar.team.dark_aqua") +- .put(DisplaySlot.SIDEBAR_DARK_RED, "sidebar.team.dark_red") +- .put(DisplaySlot.SIDEBAR_DARK_PURPLE, "sidebar.team.dark_purple") +- .put(DisplaySlot.SIDEBAR_GOLD, "sidebar.team.gold") +- .put(DisplaySlot.SIDEBAR_GRAY, "sidebar.team.gray") +- .put(DisplaySlot.SIDEBAR_DARK_GRAY, "sidebar.team.dark_gray") +- .put(DisplaySlot.SIDEBAR_BLUE, "sidebar.team.blue") +- .put(DisplaySlot.SIDEBAR_GREEN, "sidebar.team.green") +- .put(DisplaySlot.SIDEBAR_AQUA, "sidebar.team.aqua") +- .put(DisplaySlot.SIDEBAR_RED, "sidebar.team.red") +- .put(DisplaySlot.SIDEBAR_LIGHT_PURPLE, "sidebar.team.light_purple") +- .put(DisplaySlot.SIDEBAR_YELLOW, "sidebar.team.yellow") +- .put(DisplaySlot.SIDEBAR_WHITE, "sidebar.team.white") + .buildOrThrow(); + + private CraftScoreboardTranslations() {} + + public static DisplaySlot toBukkitSlot(int i) { ++ if (true) return org.bukkit.scoreboard.DisplaySlot.NAMES.value(Scoreboard.getDisplaySlotName(i)); // Paper + return CraftScoreboardTranslations.SLOTS.inverse().get(Scoreboard.getDisplaySlotName(i)); + } + + public static int fromBukkitSlot(DisplaySlot slot) { ++ if (true) return Scoreboard.getDisplaySlotByName(slot.getId()); // Paper + return Scoreboard.getDisplaySlotByName(CraftScoreboardTranslations.SLOTS.get(slot)); + } + +diff --git a/src/main/java/org/bukkit/craftbukkit/util/Commodore.java b/src/main/java/org/bukkit/craftbukkit/util/Commodore.java +index 89a32de0a3fbb7465b078b2aa1cc1d156a4a174d..27646d963bd1158f3fe0a9c0593a312404f0e7b0 100644 +--- a/src/main/java/org/bukkit/craftbukkit/util/Commodore.java ++++ b/src/main/java/org/bukkit/craftbukkit/util/Commodore.java +@@ -252,6 +252,14 @@ public class Commodore + desc = getOriginalOrRewrite( desc ); + } + // Paper end ++ // Paper start - DisplaySlot ++ if (owner.equals("org/bukkit/scoreboard/DisplaySlot")) { ++ if (name.startsWith("SIDEBAR_") && !name.startsWith("SIDEBAR_TEAM_")) { ++ super.visitFieldInsn(opcode, owner, name.replace("SIDEBAR_", "SIDEBAR_TEAM_"), desc); ++ return; ++ } ++ } ++ // Paper end - DisplaySlot + + if ( owner.equals( "org/bukkit/block/Biome" ) ) + { +diff --git a/src/test/java/io/papermc/paper/scoreboard/DisplaySlotTest.java b/src/test/java/io/papermc/paper/scoreboard/DisplaySlotTest.java +new file mode 100644 +index 0000000000000000000000000000000000000000..bb41a2f2c0a5e3b4cb3fe1b584e0ceb7a7116afb +--- /dev/null ++++ b/src/test/java/io/papermc/paper/scoreboard/DisplaySlotTest.java +@@ -0,0 +1,26 @@ ++package io.papermc.paper.scoreboard; ++ ++import net.minecraft.world.scores.Scoreboard; ++import org.bukkit.craftbukkit.scoreboard.CraftScoreboardTranslations; ++import org.bukkit.scoreboard.DisplaySlot; ++import org.junit.Test; ++ ++import static org.junit.Assert.assertNotEquals; ++import static org.junit.Assert.assertNotNull; ++ ++public class DisplaySlotTest { ++ ++ @Test ++ public void testBukkitToMinecraftDisplaySlots() { ++ for (DisplaySlot value : DisplaySlot.values()) { ++ assertNotEquals(-1, CraftScoreboardTranslations.fromBukkitSlot(value)); ++ } ++ } ++ ++ @Test ++ public void testMinecraftToBukkitDisplaySlots() { ++ for (String name : Scoreboard.getDisplaySlotNames()) { ++ assertNotNull(CraftScoreboardTranslations.toBukkitSlot(Scoreboard.getDisplaySlotByName(name))); ++ } ++ } ++} diff --git a/patches/server/0707-Add-back-EntityPortalExitEvent.patch b/patches/server/0705-Add-back-EntityPortalExitEvent.patch similarity index 100% rename from patches/server/0707-Add-back-EntityPortalExitEvent.patch rename to patches/server/0705-Add-back-EntityPortalExitEvent.patch diff --git a/patches/server/0708-Add-methods-to-find-targets-for-lightning-strikes.patch b/patches/server/0706-Add-methods-to-find-targets-for-lightning-strikes.patch similarity index 100% rename from patches/server/0708-Add-methods-to-find-targets-for-lightning-strikes.patch rename to patches/server/0706-Add-methods-to-find-targets-for-lightning-strikes.patch diff --git a/patches/server/0706-Add-missing-team-sidebar-display-slots.patch b/patches/server/0706-Add-missing-team-sidebar-display-slots.patch deleted file mode 100644 index 5581728a48..0000000000 --- a/patches/server/0706-Add-missing-team-sidebar-display-slots.patch +++ /dev/null @@ -1,65 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: Jake Potrebic -Date: Fri, 1 Oct 2021 08:04:39 -0700 -Subject: [PATCH] Add missing team sidebar display slots - - -diff --git a/src/main/java/org/bukkit/craftbukkit/scoreboard/CraftScoreboardTranslations.java b/src/main/java/org/bukkit/craftbukkit/scoreboard/CraftScoreboardTranslations.java -index f1be7a4f96a556569e4a607959bfd085fa0cb64c..ca58cde37f4e5abeb33e2f583b3d53e80697eba9 100644 ---- a/src/main/java/org/bukkit/craftbukkit/scoreboard/CraftScoreboardTranslations.java -+++ b/src/main/java/org/bukkit/craftbukkit/scoreboard/CraftScoreboardTranslations.java -@@ -7,7 +7,8 @@ import org.bukkit.scoreboard.DisplaySlot; - import org.bukkit.scoreboard.RenderType; - - public final class CraftScoreboardTranslations { -- static final int MAX_DISPLAY_SLOT = 3; -+ static final int MAX_DISPLAY_SLOT = Scoreboard.getDisplaySlotNames().length; // Paper -+ @Deprecated // Paper - static ImmutableBiMap SLOTS = ImmutableBiMap.of( - DisplaySlot.BELOW_NAME, "belowName", - DisplaySlot.PLAYER_LIST, "list", -@@ -16,10 +17,12 @@ public final class CraftScoreboardTranslations { - private CraftScoreboardTranslations() {} - - public static DisplaySlot toBukkitSlot(int i) { -+ if (true) return org.bukkit.scoreboard.DisplaySlot.NAMES.value(Scoreboard.getDisplaySlotName(i)); // Paper - return CraftScoreboardTranslations.SLOTS.inverse().get(Scoreboard.getDisplaySlotName(i)); - } - - public static int fromBukkitSlot(DisplaySlot slot) { -+ if (true) return Scoreboard.getDisplaySlotByName(slot.getId()); // Paper - return Scoreboard.getDisplaySlotByName(CraftScoreboardTranslations.SLOTS.get(slot)); - } - -diff --git a/src/test/java/io/papermc/paper/scoreboard/DisplaySlotTest.java b/src/test/java/io/papermc/paper/scoreboard/DisplaySlotTest.java -new file mode 100644 -index 0000000000000000000000000000000000000000..bb41a2f2c0a5e3b4cb3fe1b584e0ceb7a7116afb ---- /dev/null -+++ b/src/test/java/io/papermc/paper/scoreboard/DisplaySlotTest.java -@@ -0,0 +1,26 @@ -+package io.papermc.paper.scoreboard; -+ -+import net.minecraft.world.scores.Scoreboard; -+import org.bukkit.craftbukkit.scoreboard.CraftScoreboardTranslations; -+import org.bukkit.scoreboard.DisplaySlot; -+import org.junit.Test; -+ -+import static org.junit.Assert.assertNotEquals; -+import static org.junit.Assert.assertNotNull; -+ -+public class DisplaySlotTest { -+ -+ @Test -+ public void testBukkitToMinecraftDisplaySlots() { -+ for (DisplaySlot value : DisplaySlot.values()) { -+ assertNotEquals(-1, CraftScoreboardTranslations.fromBukkitSlot(value)); -+ } -+ } -+ -+ @Test -+ public void testMinecraftToBukkitDisplaySlots() { -+ for (String name : Scoreboard.getDisplaySlotNames()) { -+ assertNotNull(CraftScoreboardTranslations.toBukkitSlot(Scoreboard.getDisplaySlotByName(name))); -+ } -+ } -+} diff --git a/patches/server/0709-Get-entity-default-attributes.patch b/patches/server/0707-Get-entity-default-attributes.patch similarity index 98% rename from patches/server/0709-Get-entity-default-attributes.patch rename to patches/server/0707-Get-entity-default-attributes.patch index 49b00d01a0..c2cbc0160d 100644 --- a/patches/server/0709-Get-entity-default-attributes.patch +++ b/patches/server/0707-Get-entity-default-attributes.patch @@ -90,7 +90,7 @@ index 0000000000000000000000000000000000000000..4ecba0b02c2813a890aecc5586987879 + } +} diff --git a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java -index c98c5e070349e5c9356a3dec2344a135ad8f0b56..7e024b0f0a5201b4e9e7fcd7a160b146d7f12b52 100644 +index 6fd3bbc36cb6e270a10f778fe2764823f90cca9c..51ecfd4c4afe6dfc42c3aa85e6fc55d0e965a5dc 100644 --- a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java +++ b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java @@ -562,6 +562,18 @@ public final class CraftMagicNumbers implements UnsafeValues { diff --git a/patches/server/0710-Left-handed-API.patch b/patches/server/0708-Left-handed-API.patch similarity index 100% rename from patches/server/0710-Left-handed-API.patch rename to patches/server/0708-Left-handed-API.patch diff --git a/patches/server/0711-Add-advancement-display-API.patch b/patches/server/0709-Add-advancement-display-API.patch similarity index 100% rename from patches/server/0711-Add-advancement-display-API.patch rename to patches/server/0709-Add-advancement-display-API.patch diff --git a/patches/server/0712-Add-ItemFactory-getMonsterEgg-API.patch b/patches/server/0710-Add-ItemFactory-getMonsterEgg-API.patch similarity index 100% rename from patches/server/0712-Add-ItemFactory-getMonsterEgg-API.patch rename to patches/server/0710-Add-ItemFactory-getMonsterEgg-API.patch diff --git a/patches/server/0713-Add-critical-damage-API.patch b/patches/server/0711-Add-critical-damage-API.patch similarity index 100% rename from patches/server/0713-Add-critical-damage-API.patch rename to patches/server/0711-Add-critical-damage-API.patch diff --git a/patches/server/0714-Fix-issues-with-mob-conversion.patch b/patches/server/0712-Fix-issues-with-mob-conversion.patch similarity index 100% rename from patches/server/0714-Fix-issues-with-mob-conversion.patch rename to patches/server/0712-Fix-issues-with-mob-conversion.patch diff --git a/patches/server/0715-Add-isCollidable-methods-to-various-places.patch b/patches/server/0713-Add-isCollidable-methods-to-various-places.patch similarity index 96% rename from patches/server/0715-Add-isCollidable-methods-to-various-places.patch rename to patches/server/0713-Add-isCollidable-methods-to-various-places.patch index 70c5cdaf6e..2b95e405a3 100644 --- a/patches/server/0715-Add-isCollidable-methods-to-various-places.patch +++ b/patches/server/0713-Add-isCollidable-methods-to-various-places.patch @@ -37,7 +37,7 @@ index 7b9e943b391c061782fccd2b8d705ceec8db50fe..966ac60daebb7bb211ab8096fc0c5f33 + // Paper end } diff --git a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java -index 7e024b0f0a5201b4e9e7fcd7a160b146d7f12b52..c3ac503bd2c04a94bc3c172b2c6bfe1308da29aa 100644 +index 51ecfd4c4afe6dfc42c3aa85e6fc55d0e965a5dc..0a3d447f87698dc786d6cab6ded27eb1b5780204 100644 --- a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java +++ b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java @@ -574,6 +574,12 @@ public final class CraftMagicNumbers implements UnsafeValues { diff --git a/patches/server/0716-Goat-ram-API.patch b/patches/server/0714-Goat-ram-API.patch similarity index 100% rename from patches/server/0716-Goat-ram-API.patch rename to patches/server/0714-Goat-ram-API.patch diff --git a/patches/server/0717-Add-API-for-resetting-a-single-score.patch b/patches/server/0715-Add-API-for-resetting-a-single-score.patch similarity index 100% rename from patches/server/0717-Add-API-for-resetting-a-single-score.patch rename to patches/server/0715-Add-API-for-resetting-a-single-score.patch diff --git a/patches/server/0718-Add-Raw-Byte-Entity-Serialization.patch b/patches/server/0716-Add-Raw-Byte-Entity-Serialization.patch similarity index 97% rename from patches/server/0718-Add-Raw-Byte-Entity-Serialization.patch rename to patches/server/0716-Add-Raw-Byte-Entity-Serialization.patch index fe3844bf5b..2f27482d7e 100644 --- a/patches/server/0718-Add-Raw-Byte-Entity-Serialization.patch +++ b/patches/server/0716-Add-Raw-Byte-Entity-Serialization.patch @@ -45,7 +45,7 @@ index b8e5205c165bcba5b8383334f3d0d1daf9d0a8cd..ff8562821ebb363c755e9d316679226d // Paper end } diff --git a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java -index c3ac503bd2c04a94bc3c172b2c6bfe1308da29aa..1f491d48b591281e3a054c33683ac4cf76ada802 100644 +index 0a3d447f87698dc786d6cab6ded27eb1b5780204..d3b37adfe6d66e82db18d94f143af3aba4543f79 100644 --- a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java +++ b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java @@ -457,6 +457,30 @@ public final class CraftMagicNumbers implements UnsafeValues { diff --git a/patches/server/0719-Vanilla-command-permission-fixes.patch b/patches/server/0717-Vanilla-command-permission-fixes.patch similarity index 96% rename from patches/server/0719-Vanilla-command-permission-fixes.patch rename to patches/server/0717-Vanilla-command-permission-fixes.patch index 777e0e5339..8e3102cba2 100644 --- a/patches/server/0719-Vanilla-command-permission-fixes.patch +++ b/patches/server/0717-Vanilla-command-permission-fixes.patch @@ -30,10 +30,10 @@ index 899008b2980d13f1be6280cd8cb959c53a29bebf..f875507241ac6769545e91cd3285232b private RedirectModifier modifier = null; private boolean forks; diff --git a/src/main/java/net/minecraft/commands/Commands.java b/src/main/java/net/minecraft/commands/Commands.java -index edf980cf8992ddfe003ced279fe1324fc2364e5a..e70e5af7e49e4ccf332d9ce44e1a106344b35490 100644 +index 884a7c3a082140d2e1d154851c534ab09f5da4ce..6d480d0332ee9348eacc3269890ee49206623c2a 100644 --- a/src/main/java/net/minecraft/commands/Commands.java +++ b/src/main/java/net/minecraft/commands/Commands.java -@@ -213,7 +213,13 @@ public class Commands { +@@ -212,7 +212,13 @@ public class Commands { if (environment.includeIntegrated) { PublishCommand.register(this.dispatcher); } diff --git a/patches/server/0720-Make-CallbackExecutor-strict-again.patch b/patches/server/0718-Make-CallbackExecutor-strict-again.patch similarity index 100% rename from patches/server/0720-Make-CallbackExecutor-strict-again.patch rename to patches/server/0718-Make-CallbackExecutor-strict-again.patch diff --git a/patches/server/0721-Do-not-allow-the-server-to-unload-chunks-at-request-.patch b/patches/server/0719-Do-not-allow-the-server-to-unload-chunks-at-request-.patch similarity index 100% rename from patches/server/0721-Do-not-allow-the-server-to-unload-chunks-at-request-.patch rename to patches/server/0719-Do-not-allow-the-server-to-unload-chunks-at-request-.patch diff --git a/patches/server/0722-Do-not-run-close-logic-for-inventories-on-chunk-unlo.patch b/patches/server/0720-Do-not-run-close-logic-for-inventories-on-chunk-unlo.patch similarity index 97% rename from patches/server/0722-Do-not-run-close-logic-for-inventories-on-chunk-unlo.patch rename to patches/server/0720-Do-not-run-close-logic-for-inventories-on-chunk-unlo.patch index f323665a82..05c02fd444 100644 --- a/patches/server/0722-Do-not-run-close-logic-for-inventories-on-chunk-unlo.patch +++ b/patches/server/0720-Do-not-run-close-logic-for-inventories-on-chunk-unlo.patch @@ -28,7 +28,7 @@ index 8c95d537c7bf5cc9b63f0e412c9ad67f5e6fe51e..2634eba0537648c0e013455e813e2589 } // 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 ec713ffb7c4cba53dc983ebde5596e4749107493..62f2c9645a3bf5b2bfd9fe99d3e6ec08c7dafa9a 100644 +index 80e1970f568a74a43e624188a77cfbd28cfa52dd..951ccf3526dc2f5e4e2f16952036683ad132fbe0 100644 --- a/src/main/java/net/minecraft/server/level/ServerPlayer.java +++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java @@ -1588,6 +1588,18 @@ public class ServerPlayer extends Player { diff --git a/patches/server/0723-Correctly-handle-recursion-for-chunkholder-updates.patch b/patches/server/0721-Correctly-handle-recursion-for-chunkholder-updates.patch similarity index 100% rename from patches/server/0723-Correctly-handle-recursion-for-chunkholder-updates.patch rename to patches/server/0721-Correctly-handle-recursion-for-chunkholder-updates.patch diff --git a/patches/server/0724-Fix-GameProfileCache-concurrency.patch b/patches/server/0722-Fix-GameProfileCache-concurrency.patch similarity index 100% rename from patches/server/0724-Fix-GameProfileCache-concurrency.patch rename to patches/server/0722-Fix-GameProfileCache-concurrency.patch diff --git a/patches/server/0725-Fix-chunks-refusing-to-unload-at-low-TPS.patch b/patches/server/0723-Fix-chunks-refusing-to-unload-at-low-TPS.patch similarity index 100% rename from patches/server/0725-Fix-chunks-refusing-to-unload-at-low-TPS.patch rename to patches/server/0723-Fix-chunks-refusing-to-unload-at-low-TPS.patch diff --git a/patches/server/0726-Do-not-allow-ticket-level-changes-while-unloading-pl.patch b/patches/server/0724-Do-not-allow-ticket-level-changes-while-unloading-pl.patch similarity index 100% rename from patches/server/0726-Do-not-allow-ticket-level-changes-while-unloading-pl.patch rename to patches/server/0724-Do-not-allow-ticket-level-changes-while-unloading-pl.patch diff --git a/patches/server/0727-Do-not-allow-ticket-level-changes-when-updating-chun.patch b/patches/server/0725-Do-not-allow-ticket-level-changes-when-updating-chun.patch similarity index 100% rename from patches/server/0727-Do-not-allow-ticket-level-changes-when-updating-chun.patch rename to patches/server/0725-Do-not-allow-ticket-level-changes-when-updating-chun.patch diff --git a/patches/server/0728-Log-when-the-async-catcher-is-tripped.patch b/patches/server/0726-Log-when-the-async-catcher-is-tripped.patch similarity index 100% rename from patches/server/0728-Log-when-the-async-catcher-is-tripped.patch rename to patches/server/0726-Log-when-the-async-catcher-is-tripped.patch diff --git a/patches/server/0729-Add-paper-mobcaps-and-paper-playermobcaps.patch b/patches/server/0727-Add-paper-mobcaps-and-paper-playermobcaps.patch similarity index 99% rename from patches/server/0729-Add-paper-mobcaps-and-paper-playermobcaps.patch rename to patches/server/0727-Add-paper-mobcaps-and-paper-playermobcaps.patch index b5dc131bb0..3e6c326057 100644 --- a/patches/server/0729-Add-paper-mobcaps-and-paper-playermobcaps.patch +++ b/patches/server/0727-Add-paper-mobcaps-and-paper-playermobcaps.patch @@ -286,10 +286,10 @@ index fa23e9c476d4edc6176d8b8a6cb13c52d2f66a87..4150e8cd7197eac53042d56f0a53a495 // Paper start - add parameters and int ret type spawnCategoryForChunk(group, world, chunk, checker, runner, Integer.MAX_VALUE, null); diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -index 2f91be86f31c868dee3699ce5426a3ce5c8296b0..669dade4853ae52ba011ede9bc8944ea11e5fa54 100644 +index 589ee4fd2a7f2c81ef0324662d8349cd3105373f..7f874c53cdb1815e3337c51ab564b7dafb20c939 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -@@ -2154,6 +2154,11 @@ public final class CraftServer implements Server { +@@ -2156,6 +2156,11 @@ public final class CraftServer implements Server { @Override public int getSpawnLimit(SpawnCategory spawnCategory) { diff --git a/patches/server/0730-Prevent-unload-calls-removing-tickets-for-sync-loads.patch b/patches/server/0728-Prevent-unload-calls-removing-tickets-for-sync-loads.patch similarity index 100% rename from patches/server/0730-Prevent-unload-calls-removing-tickets-for-sync-loads.patch rename to patches/server/0728-Prevent-unload-calls-removing-tickets-for-sync-loads.patch diff --git a/patches/server/0731-Sanitize-ResourceLocation-error-logging.patch b/patches/server/0729-Sanitize-ResourceLocation-error-logging.patch similarity index 97% rename from patches/server/0731-Sanitize-ResourceLocation-error-logging.patch rename to patches/server/0729-Sanitize-ResourceLocation-error-logging.patch index 2a00379593..c2ff3a02e4 100644 --- a/patches/server/0731-Sanitize-ResourceLocation-error-logging.patch +++ b/patches/server/0729-Sanitize-ResourceLocation-error-logging.patch @@ -1,5 +1,5 @@ From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: Nassim Jahnke +From: Nassim Jahnke Date: Thu, 26 Aug 2021 12:09:47 +0200 Subject: [PATCH] Sanitize ResourceLocation error logging diff --git a/patches/server/0732-Allow-controlled-flushing-for-network-manager.patch b/patches/server/0730-Allow-controlled-flushing-for-network-manager.patch similarity index 84% rename from patches/server/0732-Allow-controlled-flushing-for-network-manager.patch rename to patches/server/0730-Allow-controlled-flushing-for-network-manager.patch index e1622fd8a8..cbd07781ef 100644 --- a/patches/server/0732-Allow-controlled-flushing-for-network-manager.patch +++ b/patches/server/0730-Allow-controlled-flushing-for-network-manager.patch @@ -9,7 +9,7 @@ This patch will be used to optimise out flush calls in later patches. diff --git a/src/main/java/net/minecraft/network/Connection.java b/src/main/java/net/minecraft/network/Connection.java -index 25d26ba482edac4158ba247e105d8c5fac0729e4..b8e127f19c38d51baaa1a2c47a0d2eab62d71e90 100644 +index b5f884d6671823085a2ab0e8da2d30afd2928f32..057a0be81b12bd8a4ac71106dc8ada91bd4c9bfd 100644 --- a/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> { @@ -56,19 +56,19 @@ index 25d26ba482edac4158ba247e105d8c5fac0729e4..b8e127f19c38d51baaa1a2c47a0d2eab net.minecraft.server.MCUtil.isMainThread() && packet.isReady() && this.queue.isEmpty() && (packet.getExtraPackets() == null || packet.getExtraPackets().isEmpty()) ))) { -- this.sendPacket(packet, packetsendlistener); -+ this.sendPacket(packet, packetsendlistener, null); // Paper +- this.sendPacket(packet, callbacks); ++ this.sendPacket(packet, callbacks, null); // Paper return; } // write the packets to the queue, then flush - antixray hooks there already @@ -288,6 +321,14 @@ public class Connection extends SimpleChannelInboundHandler> { } - private void sendPacket(Packet packet, @Nullable PacketSendListener packetsendlistener) { + private void sendPacket(Packet packet, @Nullable PacketSendListener callbacks) { + // 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 + 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 @@ -80,22 +80,22 @@ index 25d26ba482edac4158ba247e105d8c5fac0729e4..b8e127f19c38d51baaa1a2c47a0d2eab } if (this.channel.eventLoop().inEventLoop()) { -- this.doSendPacket(packet, packetsendlistener, enumprotocol, enumprotocol1); -+ this.doSendPacket(packet, packetsendlistener, enumprotocol, enumprotocol1, flush); // Paper - add flush parameter +- this.doSendPacket(packet, callbacks, enumprotocol, enumprotocol1); ++ this.doSendPacket(packet, callbacks, enumprotocol, enumprotocol1, flush); // Paper } else { this.channel.eventLoop().execute(() -> { -- this.doSendPacket(packet, packetsendlistener, enumprotocol, enumprotocol1); -+ this.doSendPacket(packet, packetsendlistener, enumprotocol, enumprotocol1, flush); // Paper - add flush parameter +- this.doSendPacket(packet, callbacks, enumprotocol, enumprotocol1); ++ 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 -+ 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 if (packetState != currentState) { this.setProtocol(packetState); @@ -107,7 +107,7 @@ index 25d26ba482edac4158ba247e105d8c5fac0729e4..b8e127f19c38d51baaa1a2c47a0d2eab - ChannelFuture channelfuture = this.channel.writeAndFlush(packet); + ChannelFuture channelfuture = flush ? this.channel.writeAndFlush(packet) : this.channel.write(packet); // Paper - add flush parameter - if (packetsendlistener != null) { + if (callbacks != null) { channelfuture.addListener((future) -> { @@ -376,6 +422,10 @@ public class Connection extends SimpleChannelInboundHandler> { } diff --git a/patches/server/0733-Optimise-general-POI-access.patch b/patches/server/0731-Optimise-general-POI-access.patch similarity index 100% rename from patches/server/0733-Optimise-general-POI-access.patch rename to patches/server/0731-Optimise-general-POI-access.patch diff --git a/patches/server/0734-Add-more-async-catchers.patch b/patches/server/0732-Add-more-async-catchers.patch similarity index 100% rename from patches/server/0734-Add-more-async-catchers.patch rename to patches/server/0732-Add-more-async-catchers.patch diff --git a/patches/server/0735-Rewrite-entity-bounding-box-lookup-calls.patch b/patches/server/0733-Rewrite-entity-bounding-box-lookup-calls.patch similarity index 99% rename from patches/server/0735-Rewrite-entity-bounding-box-lookup-calls.patch rename to patches/server/0733-Rewrite-entity-bounding-box-lookup-calls.patch index 4348e1948f..efe868fdfc 100644 --- a/patches/server/0735-Rewrite-entity-bounding-box-lookup-calls.patch +++ b/patches/server/0733-Rewrite-entity-bounding-box-lookup-calls.patch @@ -1280,11 +1280,11 @@ index 3bedc22c253c3632b5624c05e78ed3671e5d30ce..fbd82b6be6604bf854e01ed5718e4e07 + // Paper end } diff --git a/src/main/java/org/spigotmc/ActivationRange.java b/src/main/java/org/spigotmc/ActivationRange.java -index c9a032c5331a918453de5e8c6a6d13f5c9f415ee..5bffc9a0f6ef9d54abb359565d07509b177c2b82 100644 +index 0508f43ad396679d3372ae4caf029086a1524109..b1ed97618d08d7691d24f89e9e9b0ed0f2bddd09 100644 --- a/src/main/java/org/spigotmc/ActivationRange.java +++ b/src/main/java/org/spigotmc/ActivationRange.java -@@ -210,7 +210,13 @@ public class ActivationRange - ActivationType.VILLAGER.boundingBox = player.getBoundingBox().inflate( villagerActivationRange, 256, villagerActivationRange ); +@@ -211,7 +211,13 @@ public class ActivationRange + ActivationType.VILLAGER.boundingBox = player.getBoundingBox().inflate( villagerActivationRange, worldHeight, villagerActivationRange ); // Paper end - world.getEntities().get(maxBB, ActivationRange::activateEntity); diff --git a/patches/server/0736-Optimise-chunk-tick-iteration.patch b/patches/server/0734-Optimise-chunk-tick-iteration.patch similarity index 100% rename from patches/server/0736-Optimise-chunk-tick-iteration.patch rename to patches/server/0734-Optimise-chunk-tick-iteration.patch diff --git a/patches/server/0737-Execute-chunk-tasks-mid-tick.patch b/patches/server/0735-Execute-chunk-tasks-mid-tick.patch similarity index 96% rename from patches/server/0737-Execute-chunk-tasks-mid-tick.patch rename to patches/server/0735-Execute-chunk-tasks-mid-tick.patch index 11d226c606..a000a740bb 100644 --- a/patches/server/0737-Execute-chunk-tasks-mid-tick.patch +++ b/patches/server/0735-Execute-chunk-tasks-mid-tick.patch @@ -19,10 +19,10 @@ 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 d605c4355674644e47ea5ea9e979f7806aed1607..421872f7cc1a3cbb4dc596d0e0fa0f9b63602a8a 100644 +index 98fe4165d291b47a39ce741884353c87dd0a4789..99073ea2757cd1c15b098d7cfaf8681702f04a19 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> { diff --git a/patches/server/0742-Manually-inline-methods-in-BlockPosition.patch b/patches/server/0740-Manually-inline-methods-in-BlockPosition.patch similarity index 100% rename from patches/server/0742-Manually-inline-methods-in-BlockPosition.patch rename to patches/server/0740-Manually-inline-methods-in-BlockPosition.patch diff --git a/patches/server/0743-Distance-manager-tick-timings.patch b/patches/server/0741-Distance-manager-tick-timings.patch similarity index 100% rename from patches/server/0743-Distance-manager-tick-timings.patch rename to patches/server/0741-Distance-manager-tick-timings.patch diff --git a/patches/server/0744-Name-craft-scheduler-threads-according-to-the-plugin.patch b/patches/server/0742-Name-craft-scheduler-threads-according-to-the-plugin.patch similarity index 100% rename from patches/server/0744-Name-craft-scheduler-threads-according-to-the-plugin.patch rename to patches/server/0742-Name-craft-scheduler-threads-according-to-the-plugin.patch diff --git a/patches/server/0745-Make-sure-inlined-getChunkAt-has-inlined-logic-for-l.patch b/patches/server/0743-Make-sure-inlined-getChunkAt-has-inlined-logic-for-l.patch similarity index 100% rename from patches/server/0745-Make-sure-inlined-getChunkAt-has-inlined-logic-for-l.patch rename to patches/server/0743-Make-sure-inlined-getChunkAt-has-inlined-logic-for-l.patch diff --git a/patches/server/0746-Add-packet-limiter-config.patch b/patches/server/0744-Add-packet-limiter-config.patch similarity index 98% rename from patches/server/0746-Add-packet-limiter-config.patch rename to patches/server/0744-Add-packet-limiter-config.patch index 9fc8214e17..8aa45e5f93 100644 --- a/patches/server/0746-Add-packet-limiter-config.patch +++ b/patches/server/0744-Add-packet-limiter-config.patch @@ -24,7 +24,7 @@ and an action can be defined: DROP or KICK If interval or rate are less-than 0, the limit is ignored diff --git a/src/main/java/net/minecraft/network/Connection.java b/src/main/java/net/minecraft/network/Connection.java -index 30f8053547ebbe05549ede851835a707793f8e45..e5b7145efddefb8bf756c3b0f115c92306830ae4 100644 +index 98443474d1881bbeee8f249b89e44a0f84261be7..51217798bfd549483ce456b44d14089f35642c55 100644 --- a/src/main/java/net/minecraft/network/Connection.java +++ b/src/main/java/net/minecraft/network/Connection.java @@ -131,6 +131,22 @@ public class Connection extends SimpleChannelInboundHandler> { diff --git a/patches/server/0747-Use-correct-LevelStem-registry-when-loading-default-.patch b/patches/server/0745-Use-correct-LevelStem-registry-when-loading-default-.patch similarity index 96% rename from patches/server/0747-Use-correct-LevelStem-registry-when-loading-default-.patch rename to patches/server/0745-Use-correct-LevelStem-registry-when-loading-default-.patch index 0fb83af7c8..82aca1adfa 100644 --- a/patches/server/0747-Use-correct-LevelStem-registry-when-loading-default-.patch +++ b/patches/server/0745-Use-correct-LevelStem-registry-when-loading-default-.patch @@ -24,7 +24,7 @@ index 8da1226a6c293abb038d10c7921a77ed71ad06cc..f958f0ae738a6fb26400e17e54c8d69e } else { Holder holder = registry.getOrCreateHolderOrThrow(entryKey); diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index 421872f7cc1a3cbb4dc596d0e0fa0f9b63602a8a..8a36c0bacb71cd9e31affa6290d28bf0f0374d07 100644 +index 2d94390e3b9fa3afd2471cc691d59de0f470b46c..68c0bb1d493b3de3c3e80018a1655ec968b0316a 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java @@ -553,7 +553,14 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop getStates() { diff --git a/src/main/java/net/minecraft/world/level/chunk/PalettedContainer.java b/src/main/java/net/minecraft/world/level/chunk/PalettedContainer.java -index e77b516995666402cc8814ac78a6c11077108b2e..1326dc1239e00e7001c9ea98713b955b37e759b9 100644 +index d93118b7a602ceb6ef11ddabbce1d13fb8029a44..5ebde3a4f99b8d017d9a10a30fefc0b7dd011319 100644 --- a/src/main/java/net/minecraft/world/level/chunk/PalettedContainer.java +++ b/src/main/java/net/minecraft/world/level/chunk/PalettedContainer.java @@ -383,6 +383,14 @@ public class PalettedContainer implements PaletteResize, PalettedContainer diff --git a/patches/server/0758-Optimise-non-flush-packet-sending.patch b/patches/server/0756-Optimise-non-flush-packet-sending.patch similarity index 77% rename from patches/server/0758-Optimise-non-flush-packet-sending.patch rename to patches/server/0756-Optimise-non-flush-packet-sending.patch index 1b2114c376..21c35fd4d5 100644 --- a/patches/server/0758-Optimise-non-flush-packet-sending.patch +++ b/patches/server/0756-Optimise-non-flush-packet-sending.patch @@ -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. diff --git a/src/main/java/net/minecraft/network/Connection.java b/src/main/java/net/minecraft/network/Connection.java -index 80cc3b62af324512f695e971cce2b01f6eadbdbf..549c82b2bd91db70bc83b4e33131774a0d2d17ac 100644 +index 51217798bfd549483ce456b44d14089f35642c55..fefda9868fd3c4b3392b2bf4c68c0b4b2f311f31 100644 --- a/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; @@ -34,20 +34,20 @@ index 80cc3b62af324512f695e971cce2b01f6eadbdbf..549c82b2bd91db70bc83b4e33131774a private static final float AVERAGE_PACKETS_SMOOTHING = 0.75F; @@ -396,9 +398,19 @@ public class Connection extends SimpleChannelInboundHandler> { 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 { + // 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 + // into two branches. On conflict, just re-copy - no changes were made inside the executor code. + if (!flush) { + 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); + } else { // Paper end - optimise packets that are not flushed this.channel.eventLoop().execute(() -> { -- this.doSendPacket(packet, packetsendlistener, enumprotocol, enumprotocol1, flush); // Paper - add flush parameter -+ this.doSendPacket(packet, packetsendlistener, enumprotocol, enumprotocol1, flush); // Paper - add flush parameter // Paper - diff on change +- this.doSendPacket(packet, callbacks, enumprotocol, enumprotocol1, flush); // Paper ++ this.doSendPacket(packet, callbacks, enumprotocol, enumprotocol1, flush); // Paper - add flush parameter // Paper - diff on change }); + } // Paper } diff --git a/patches/server/0759-Optimise-nearby-player-lookups.patch b/patches/server/0757-Optimise-nearby-player-lookups.patch similarity index 100% rename from patches/server/0759-Optimise-nearby-player-lookups.patch rename to patches/server/0757-Optimise-nearby-player-lookups.patch diff --git a/patches/server/0760-Optimise-WorldServer-notify.patch b/patches/server/0758-Optimise-WorldServer-notify.patch similarity index 100% rename from patches/server/0760-Optimise-WorldServer-notify.patch rename to patches/server/0758-Optimise-WorldServer-notify.patch diff --git a/patches/server/0761-Remove-streams-for-villager-AI.patch b/patches/server/0759-Remove-streams-for-villager-AI.patch similarity index 100% rename from patches/server/0761-Remove-streams-for-villager-AI.patch rename to patches/server/0759-Remove-streams-for-villager-AI.patch diff --git a/patches/server/0762-Rewrite-dataconverter-system.patch b/patches/server/0760-Rewrite-dataconverter-system.patch similarity index 100% rename from patches/server/0762-Rewrite-dataconverter-system.patch rename to patches/server/0760-Rewrite-dataconverter-system.patch diff --git a/patches/server/0763-Use-Velocity-compression-and-cipher-natives.patch b/patches/server/0761-Use-Velocity-compression-and-cipher-natives.patch similarity index 98% rename from patches/server/0763-Use-Velocity-compression-and-cipher-natives.patch rename to patches/server/0761-Use-Velocity-compression-and-cipher-natives.patch index e204eda85d..ed1f57fae4 100644 --- a/patches/server/0763-Use-Velocity-compression-and-cipher-natives.patch +++ b/patches/server/0761-Use-Velocity-compression-and-cipher-natives.patch @@ -268,7 +268,7 @@ index 792883afe53d2b7989c25a81c2f9a639d5e21d20..c04379ca8a4db0f4de46ad2b3b338431 return this.threshold; } diff --git a/src/main/java/net/minecraft/network/Connection.java b/src/main/java/net/minecraft/network/Connection.java -index 549c82b2bd91db70bc83b4e33131774a0d2d17ac..56a93ea07f4e90b084f9a8da4cd9f53afde4c0d5 100644 +index fefda9868fd3c4b3392b2bf4c68c0b4b2f311f31..66afd752fd7d327e141d49b477f07e1ff3645d02 100644 --- a/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> { @@ -341,10 +341,10 @@ index b80aedd2002959b4026c27ce76b3ed17f0acfb5b..2985271132c9ae822dcb0d7a7e6f0c26 protected void initChannel(Channel channel) { try { diff --git a/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java -index c8a29ec3eac3ae61731cdc4f142578d98ec993ff..547abc18f1e03945977bd38947d9db5e201045c4 100644 +index f6efd220d7f78f3f763bf1983d20c636eb4923b6..77cb18da4f89bb89aea7d1ef5ebe3dd7acfe000d 100644 --- a/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 +@@ -315,12 +315,14 @@ public class ServerLoginPacketListenerImpl implements TickablePacketListener, Se } SecretKey secretkey = packet.getSecretKey(privatekey); diff --git a/patches/server/0764-Reduce-worldgen-thread-worker-count-for-low-core-cou.patch b/patches/server/0762-Reduce-worldgen-thread-worker-count-for-low-core-cou.patch similarity index 100% rename from patches/server/0764-Reduce-worldgen-thread-worker-count-for-low-core-cou.patch rename to patches/server/0762-Reduce-worldgen-thread-worker-count-for-low-core-cou.patch diff --git a/patches/server/0765-Do-not-process-entity-loads-in-CraftChunk-getEntitie.patch b/patches/server/0763-Do-not-process-entity-loads-in-CraftChunk-getEntitie.patch similarity index 100% rename from patches/server/0765-Do-not-process-entity-loads-in-CraftChunk-getEntitie.patch rename to patches/server/0763-Do-not-process-entity-loads-in-CraftChunk-getEntitie.patch diff --git a/patches/server/0766-Async-catch-modifications-to-critical-entity-state.patch b/patches/server/0764-Async-catch-modifications-to-critical-entity-state.patch similarity index 100% rename from patches/server/0766-Async-catch-modifications-to-critical-entity-state.patch rename to patches/server/0764-Async-catch-modifications-to-critical-entity-state.patch diff --git a/patches/server/0767-Fix-Bukkit-NamespacedKey-shenanigans.patch b/patches/server/0765-Fix-Bukkit-NamespacedKey-shenanigans.patch similarity index 98% rename from patches/server/0767-Fix-Bukkit-NamespacedKey-shenanigans.patch rename to patches/server/0765-Fix-Bukkit-NamespacedKey-shenanigans.patch index 283d481666..fabf5a82e9 100644 --- a/patches/server/0767-Fix-Bukkit-NamespacedKey-shenanigans.patch +++ b/patches/server/0765-Fix-Bukkit-NamespacedKey-shenanigans.patch @@ -1,5 +1,5 @@ From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: Nassim Jahnke +From: Nassim Jahnke Date: Sun, 24 Oct 2021 15:49:35 +0200 Subject: [PATCH] Fix Bukkit NamespacedKey shenanigans diff --git a/patches/server/0768-Fix-merchant-inventory-not-closing-on-entity-removal.patch b/patches/server/0766-Fix-merchant-inventory-not-closing-on-entity-removal.patch similarity index 100% rename from patches/server/0768-Fix-merchant-inventory-not-closing-on-entity-removal.patch rename to patches/server/0766-Fix-merchant-inventory-not-closing-on-entity-removal.patch diff --git a/patches/server/0769-Check-requirement-before-suggesting-root-nodes.patch b/patches/server/0767-Check-requirement-before-suggesting-root-nodes.patch similarity index 100% rename from patches/server/0769-Check-requirement-before-suggesting-root-nodes.patch rename to patches/server/0767-Check-requirement-before-suggesting-root-nodes.patch diff --git a/patches/server/0770-Don-t-respond-to-ServerboundCommandSuggestionPacket-.patch b/patches/server/0768-Don-t-respond-to-ServerboundCommandSuggestionPacket-.patch similarity index 74% rename from patches/server/0770-Don-t-respond-to-ServerboundCommandSuggestionPacket-.patch rename to patches/server/0768-Don-t-respond-to-ServerboundCommandSuggestionPacket-.patch index f749f4a415..4377fac5ec 100644 --- a/patches/server/0770-Don-t-respond-to-ServerboundCommandSuggestionPacket-.patch +++ b/patches/server/0768-Don-t-respond-to-ServerboundCommandSuggestionPacket-.patch @@ -6,10 +6,10 @@ Subject: [PATCH] Don't respond to ServerboundCommandSuggestionPacket when diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -index 1f5ccfd997392d010a9375b87f01e5a248802acc..331c700ec85d84417bf734f30a3870659c5da2e9 100644 +index 6a20b0265b278593c87f61206785090b9392f6d6..aecf10bddc2607924f716791315333d93e78bddf 100644 --- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -@@ -846,6 +846,11 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic +@@ -853,6 +853,11 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic } // Paper end // CraftBukkit end @@ -17,7 +17,7 @@ index 1f5ccfd997392d010a9375b87f01e5a248802acc..331c700ec85d84417bf734f30a387065 + if (org.spigotmc.SpigotConfig.tabComplete < 0) { + return; + } -+ // Paper end ++ // Paper end - Don't suggest if tab-complete is disabled + // Paper start - async tab completion + TAB_COMPLETE_EXECUTOR.execute(() -> { StringReader stringreader = new StringReader(packet.getCommand()); - - if (stringreader.canRead() && stringreader.peek() == '/') { diff --git a/patches/server/0771-Fix-setPatternColor-on-tropical-fish-bucket-meta.patch b/patches/server/0769-Fix-setPatternColor-on-tropical-fish-bucket-meta.patch similarity index 100% rename from patches/server/0771-Fix-setPatternColor-on-tropical-fish-bucket-meta.patch rename to patches/server/0769-Fix-setPatternColor-on-tropical-fish-bucket-meta.patch diff --git a/patches/server/0772-Ensure-valid-vehicle-status.patch b/patches/server/0770-Ensure-valid-vehicle-status.patch similarity index 86% rename from patches/server/0772-Ensure-valid-vehicle-status.patch rename to patches/server/0770-Ensure-valid-vehicle-status.patch index 82002eaa2f..2d1f854e7d 100644 --- a/patches/server/0772-Ensure-valid-vehicle-status.patch +++ b/patches/server/0770-Ensure-valid-vehicle-status.patch @@ -1,11 +1,11 @@ From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: Nassim Jahnke +From: Nassim Jahnke Date: Tue, 28 Sep 2021 09:47:47 +0200 Subject: [PATCH] Ensure valid vehicle status diff --git a/src/main/java/net/minecraft/server/level/ServerPlayer.java b/src/main/java/net/minecraft/server/level/ServerPlayer.java -index 62f2c9645a3bf5b2bfd9fe99d3e6ec08c7dafa9a..e243e67ff389014b2b1a80fa20e67996fae48f8d 100644 +index 951ccf3526dc2f5e4e2f16952036683ad132fbe0..97de35c614e1e9b0e825f9914173a3e1e0e53221 100644 --- a/src/main/java/net/minecraft/server/level/ServerPlayer.java +++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java @@ -513,7 +513,7 @@ public class ServerPlayer extends Player { diff --git a/patches/server/0773-Prevent-softlocked-end-exit-portal-generation.patch b/patches/server/0771-Prevent-softlocked-end-exit-portal-generation.patch similarity index 100% rename from patches/server/0773-Prevent-softlocked-end-exit-portal-generation.patch rename to patches/server/0771-Prevent-softlocked-end-exit-portal-generation.patch diff --git a/patches/server/0774-Fix-CocaoDecorator-causing-a-crash-when-trying-to-ge.patch b/patches/server/0772-Fix-CocaoDecorator-causing-a-crash-when-trying-to-ge.patch similarity index 100% rename from patches/server/0774-Fix-CocaoDecorator-causing-a-crash-when-trying-to-ge.patch rename to patches/server/0772-Fix-CocaoDecorator-causing-a-crash-when-trying-to-ge.patch diff --git a/patches/server/0775-Don-t-log-debug-logging-being-disabled.patch b/patches/server/0773-Don-t-log-debug-logging-being-disabled.patch similarity index 100% rename from patches/server/0775-Don-t-log-debug-logging-being-disabled.patch rename to patches/server/0773-Don-t-log-debug-logging-being-disabled.patch diff --git a/patches/server/0776-fix-various-menus-with-empty-level-accesses.patch b/patches/server/0774-fix-various-menus-with-empty-level-accesses.patch similarity index 100% rename from patches/server/0776-fix-various-menus-with-empty-level-accesses.patch rename to patches/server/0774-fix-various-menus-with-empty-level-accesses.patch diff --git a/patches/server/0777-Do-not-overload-I-O-threads-with-chunk-data-while-fl.patch b/patches/server/0775-Do-not-overload-I-O-threads-with-chunk-data-while-fl.patch similarity index 100% rename from patches/server/0777-Do-not-overload-I-O-threads-with-chunk-data-while-fl.patch rename to patches/server/0775-Do-not-overload-I-O-threads-with-chunk-data-while-fl.patch diff --git a/patches/server/0778-Preserve-overstacked-loot.patch b/patches/server/0776-Preserve-overstacked-loot.patch similarity index 100% rename from patches/server/0778-Preserve-overstacked-loot.patch rename to patches/server/0776-Preserve-overstacked-loot.patch diff --git a/patches/server/0779-Update-head-rotation-in-missing-places.patch b/patches/server/0777-Update-head-rotation-in-missing-places.patch similarity index 100% rename from patches/server/0779-Update-head-rotation-in-missing-places.patch rename to patches/server/0777-Update-head-rotation-in-missing-places.patch diff --git a/patches/server/0780-prevent-unintended-light-block-manipulation.patch b/patches/server/0778-prevent-unintended-light-block-manipulation.patch similarity index 100% rename from patches/server/0780-prevent-unintended-light-block-manipulation.patch rename to patches/server/0778-prevent-unintended-light-block-manipulation.patch diff --git a/patches/server/0781-Fix-CraftCriteria-defaults-map.patch b/patches/server/0779-Fix-CraftCriteria-defaults-map.patch similarity index 58% rename from patches/server/0781-Fix-CraftCriteria-defaults-map.patch rename to patches/server/0779-Fix-CraftCriteria-defaults-map.patch index 11fce3ca24..65eeffccea 100644 --- a/patches/server/0781-Fix-CraftCriteria-defaults-map.patch +++ b/patches/server/0779-Fix-CraftCriteria-defaults-map.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Fix CraftCriteria defaults map diff --git a/src/main/java/org/bukkit/craftbukkit/scoreboard/CraftCriteria.java b/src/main/java/org/bukkit/craftbukkit/scoreboard/CraftCriteria.java -index 22801e33fa15322c37cd11d73a40a43fa721a8e4..0cd63772871311fc0cb7111657cc9a9dac106167 100644 +index a8728102499ec8a0b4946bcc9b59c16193731f8c..d849ef9a51dc901c8045d63218b8ee5fa5c7ee7a 100644 --- a/src/main/java/org/bukkit/craftbukkit/scoreboard/CraftCriteria.java +++ b/src/main/java/org/bukkit/craftbukkit/scoreboard/CraftCriteria.java -@@ -37,7 +37,7 @@ final class CraftCriteria { +@@ -54,7 +54,7 @@ public final class CraftCriteria implements Criteria { } static CraftCriteria getFromNMS(Objective objective) { @@ -16,17 +16,4 @@ index 22801e33fa15322c37cd11d73a40a43fa721a8e4..0cd63772871311fc0cb7111657cc9a9d + return java.util.Objects.requireNonNullElseGet(CraftCriteria.DEFAULTS.get(objective.getCriteria().getName()), () -> new CraftCriteria(objective.getCriteria())); // Paper } - static CraftCriteria getFromBukkit(String name) { -@@ -45,6 +45,12 @@ final class CraftCriteria { - if (criteria != null) { - return criteria; - } -+ // Paper start - fix criteria defaults -+ var nmsCriteria = ObjectiveCriteria.byName(name); -+ if (nmsCriteria.isPresent()) { -+ return new CraftCriteria(nmsCriteria.get()); -+ } -+ // Paper end - return new CraftCriteria(name); - } - + public static CraftCriteria getFromBukkit(String name) { diff --git a/patches/server/0782-Fix-upstreams-block-state-factories.patch b/patches/server/0780-Fix-upstreams-block-state-factories.patch similarity index 100% rename from patches/server/0782-Fix-upstreams-block-state-factories.patch rename to patches/server/0780-Fix-upstreams-block-state-factories.patch diff --git a/patches/server/0783-Add-config-option-for-logging-player-ip-addresses.patch b/patches/server/0781-Add-config-option-for-logging-player-ip-addresses.patch similarity index 96% rename from patches/server/0783-Add-config-option-for-logging-player-ip-addresses.patch rename to patches/server/0781-Add-config-option-for-logging-player-ip-addresses.patch index d228f9e1cd..f72d88e116 100644 --- a/patches/server/0783-Add-config-option-for-logging-player-ip-addresses.patch +++ b/patches/server/0781-Add-config-option-for-logging-player-ip-addresses.patch @@ -49,10 +49,10 @@ index 2985271132c9ae822dcb0d7a7e6f0c268d1736cc..cfdbcd024de6ad0f9d4e83b2f912b36e 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 -index c246fbd3c155d74684c3a105818abef833f1ed96..c1cb1406bf00843568e94c5d72cf60b3e5455720 100644 +index 77cb18da4f89bb89aea7d1ef5ebe3dd7acfe000d..acd581d14e0ef1fe5a6545ee67be00deff589879 100644 --- a/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 +@@ -236,7 +236,10 @@ public class ServerLoginPacketListenerImpl implements TickablePacketListener, Se } public String getUserName() { @@ -65,7 +65,7 @@ index c246fbd3c155d74684c3a105818abef833f1ed96..c1cb1406bf00843568e94c5d72cf60b3 @Nullable diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java -index 76fa5e31701bc0e504d8e7b6ebfa737f3a10dc3b..75c64d23eb15368f8a40ebf9026d54604d450f91 100644 +index 03c413dfd16f415377749baa4fdd41949c6a12b9..d3c6c1b9ac00df265507db61301cae397214dca7 100644 --- a/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 { diff --git a/patches/server/0784-Configurable-feature-seeds.patch b/patches/server/0782-Configurable-feature-seeds.patch similarity index 98% rename from patches/server/0784-Configurable-feature-seeds.patch rename to patches/server/0782-Configurable-feature-seeds.patch index 580d461869..0b298aa5e7 100644 --- a/patches/server/0784-Configurable-feature-seeds.patch +++ b/patches/server/0782-Configurable-feature-seeds.patch @@ -1,5 +1,5 @@ From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: Nassim Jahnke +From: Nassim Jahnke Date: Tue, 31 Aug 2021 17:05:27 +0200 Subject: [PATCH] Configurable feature seeds diff --git a/patches/server/0785-VanillaCommandWrapper-didnt-account-for-entity-sende.patch b/patches/server/0783-VanillaCommandWrapper-didnt-account-for-entity-sende.patch similarity index 100% rename from patches/server/0785-VanillaCommandWrapper-didnt-account-for-entity-sende.patch rename to patches/server/0783-VanillaCommandWrapper-didnt-account-for-entity-sende.patch diff --git a/patches/server/0786-Add-root-admin-user-detection.patch b/patches/server/0784-Add-root-admin-user-detection.patch similarity index 100% rename from patches/server/0786-Add-root-admin-user-detection.patch rename to patches/server/0784-Add-root-admin-user-detection.patch diff --git a/patches/server/0787-Always-allow-item-changing-in-Fireball.patch b/patches/server/0785-Always-allow-item-changing-in-Fireball.patch similarity index 100% rename from patches/server/0787-Always-allow-item-changing-in-Fireball.patch rename to patches/server/0785-Always-allow-item-changing-in-Fireball.patch diff --git a/patches/server/0788-don-t-attempt-to-teleport-dead-entities.patch b/patches/server/0786-don-t-attempt-to-teleport-dead-entities.patch similarity index 100% rename from patches/server/0788-don-t-attempt-to-teleport-dead-entities.patch rename to patches/server/0786-don-t-attempt-to-teleport-dead-entities.patch diff --git a/patches/server/0789-Prevent-excessive-velocity-through-repeated-crits.patch b/patches/server/0787-Prevent-excessive-velocity-through-repeated-crits.patch similarity index 97% rename from patches/server/0789-Prevent-excessive-velocity-through-repeated-crits.patch rename to patches/server/0787-Prevent-excessive-velocity-through-repeated-crits.patch index 15bdf422f1..2b1bccc6b8 100644 --- a/patches/server/0789-Prevent-excessive-velocity-through-repeated-crits.patch +++ b/patches/server/0787-Prevent-excessive-velocity-through-repeated-crits.patch @@ -1,5 +1,5 @@ From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: Nassim Jahnke +From: Nassim Jahnke Date: Thu, 25 Nov 2021 10:25:09 +0100 Subject: [PATCH] Prevent excessive velocity through repeated crits diff --git a/patches/server/0790-Remove-client-side-code-using-deprecated-for-removal.patch b/patches/server/0788-Remove-client-side-code-using-deprecated-for-removal.patch similarity index 100% rename from patches/server/0790-Remove-client-side-code-using-deprecated-for-removal.patch rename to patches/server/0788-Remove-client-side-code-using-deprecated-for-removal.patch diff --git a/patches/server/0791-Rewrite-the-light-engine.patch b/patches/server/0789-Rewrite-the-light-engine.patch similarity index 99% rename from patches/server/0791-Rewrite-the-light-engine.patch rename to patches/server/0789-Rewrite-the-light-engine.patch index cb60f1cacb..7784f1b578 100644 --- a/patches/server/0791-Rewrite-the-light-engine.patch +++ b/patches/server/0789-Rewrite-the-light-engine.patch @@ -5039,7 +5039,7 @@ index c85380c3bf3bf4448a28a91af78f41c235a583e4..d870cefbe5b7485f423817f4f639e3e2 while (iterator.hasNext()) { diff --git a/src/main/java/net/minecraft/world/level/chunk/PalettedContainer.java b/src/main/java/net/minecraft/world/level/chunk/PalettedContainer.java -index 1326dc1239e00e7001c9ea98713b955b37e759b9..09201b51d6b9fadcef7e38d6a108bfafc5235fbe 100644 +index 5ebde3a4f99b8d017d9a10a30fefc0b7dd011319..7908360dd47937b2cb702e381802b7b278a5198e 100644 --- a/src/main/java/net/minecraft/world/level/chunk/PalettedContainer.java +++ b/src/main/java/net/minecraft/world/level/chunk/PalettedContainer.java @@ -203,7 +203,7 @@ public class PalettedContainer implements PaletteResize, PalettedContainer diff --git a/patches/server/0792-Always-parse-protochunk-light-sources-unless-it-is-m.patch b/patches/server/0790-Always-parse-protochunk-light-sources-unless-it-is-m.patch similarity index 100% rename from patches/server/0792-Always-parse-protochunk-light-sources-unless-it-is-m.patch rename to patches/server/0790-Always-parse-protochunk-light-sources-unless-it-is-m.patch diff --git a/patches/server/0793-Fix-removing-recipes-from-RecipeIterator.patch b/patches/server/0791-Fix-removing-recipes-from-RecipeIterator.patch similarity index 100% rename from patches/server/0793-Fix-removing-recipes-from-RecipeIterator.patch rename to patches/server/0791-Fix-removing-recipes-from-RecipeIterator.patch diff --git a/patches/server/0794-Prevent-sending-oversized-item-data-in-equipment-and.patch b/patches/server/0792-Prevent-sending-oversized-item-data-in-equipment-and.patch similarity index 99% rename from patches/server/0794-Prevent-sending-oversized-item-data-in-equipment-and.patch rename to patches/server/0792-Prevent-sending-oversized-item-data-in-equipment-and.patch index b5429f37e6..ec1d45e5e6 100644 --- a/patches/server/0794-Prevent-sending-oversized-item-data-in-equipment-and.patch +++ b/patches/server/0792-Prevent-sending-oversized-item-data-in-equipment-and.patch @@ -1,5 +1,5 @@ From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: Nassim Jahnke +From: Nassim Jahnke Date: Wed, 1 Dec 2021 12:36:25 +0100 Subject: [PATCH] Prevent sending oversized item data in equipment and metadata diff --git a/patches/server/0795-Hide-unnecessary-itemmeta-from-clients.patch b/patches/server/0793-Hide-unnecessary-itemmeta-from-clients.patch similarity index 76% rename from patches/server/0795-Hide-unnecessary-itemmeta-from-clients.patch rename to patches/server/0793-Hide-unnecessary-itemmeta-from-clients.patch index 2ee0b2523b..ae7f6deb59 100644 --- a/patches/server/0795-Hide-unnecessary-itemmeta-from-clients.patch +++ b/patches/server/0793-Hide-unnecessary-itemmeta-from-clients.patch @@ -17,6 +17,21 @@ index 319dfa82dff1fe188a52bed5aa2d39575853b793..919758363c7b703cb200582768e68c97 // Paper end } } +diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +index aecf10bddc2607924f716791315333d93e78bddf..52a5df31e7e0420c0cebeca4f9bfc1c981b8e128 100644 +--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java ++++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +@@ -2824,8 +2824,8 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic + } + // Paper end + // SPIGOT-7136 - Allays +- if (entity instanceof Allay) { +- ServerGamePacketListenerImpl.this.send(new ClientboundSetEquipmentPacket(entity.getId(), Arrays.stream(net.minecraft.world.entity.EquipmentSlot.values()).map((slot) -> Pair.of(slot, ((LivingEntity) entity).getItemBySlot(slot).copy())).collect(Collectors.toList()))); ++ if (entity instanceof Allay allay) { // Paper ++ ServerGamePacketListenerImpl.this.send(new ClientboundSetEquipmentPacket(entity.getId(), Arrays.stream(net.minecraft.world.entity.EquipmentSlot.values()).map((slot) -> Pair.of(slot, allay.stripMeta(allay.getItemBySlot(slot), true))).collect(Collectors.toList()))); // Paper - remove unnecessary item meta + player.containerMenu.sendAllDataToRemote(); + } + } diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java index d8522072adb93d47fdd7cfa947132c23c2386952..8dc54061802f0253193bda79bded1d5265591519 100644 --- a/src/main/java/net/minecraft/world/entity/LivingEntity.java diff --git a/patches/server/0796-Fix-kelp-modifier-changing-growth-for-other-crops.patch b/patches/server/0794-Fix-kelp-modifier-changing-growth-for-other-crops.patch similarity index 100% rename from patches/server/0796-Fix-kelp-modifier-changing-growth-for-other-crops.patch rename to patches/server/0794-Fix-kelp-modifier-changing-growth-for-other-crops.patch diff --git a/patches/server/0797-Prevent-ContainerOpenersCounter-openCount-from-going.patch b/patches/server/0795-Prevent-ContainerOpenersCounter-openCount-from-going.patch similarity index 100% rename from patches/server/0797-Prevent-ContainerOpenersCounter-openCount-from-going.patch rename to patches/server/0795-Prevent-ContainerOpenersCounter-openCount-from-going.patch diff --git a/patches/server/0798-Add-PlayerItemFrameChangeEvent.patch b/patches/server/0796-Add-PlayerItemFrameChangeEvent.patch similarity index 100% rename from patches/server/0798-Add-PlayerItemFrameChangeEvent.patch rename to patches/server/0796-Add-PlayerItemFrameChangeEvent.patch diff --git a/patches/server/0799-Add-player-health-update-API.patch b/patches/server/0797-Add-player-health-update-API.patch similarity index 95% rename from patches/server/0799-Add-player-health-update-API.patch rename to patches/server/0797-Add-player-health-update-API.patch index 43971bf079..da94ae0e7a 100644 --- a/patches/server/0799-Add-player-health-update-API.patch +++ b/patches/server/0797-Add-player-health-update-API.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Add player health update API diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -index fa85a7be4a131b7ae8a5d2aae78a82fcd53e5967..7112eb5f32faceb371b73a0ee82cf7b23b977f3a 100644 +index 55f4a09bc27c30936e29fa2a2fe2ef0a67b8876d..67833efdd2c4babe20a01691a44ec6f153656729 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java @@ -2152,9 +2152,11 @@ public class CraftPlayer extends CraftHumanEntity implements Player { diff --git a/patches/server/0800-Optimize-HashMapPalette.patch b/patches/server/0798-Optimize-HashMapPalette.patch similarity index 100% rename from patches/server/0800-Optimize-HashMapPalette.patch rename to patches/server/0798-Optimize-HashMapPalette.patch diff --git a/patches/server/0801-Allow-delegation-to-vanilla-chunk-gen.patch b/patches/server/0799-Allow-delegation-to-vanilla-chunk-gen.patch similarity index 97% rename from patches/server/0801-Allow-delegation-to-vanilla-chunk-gen.patch rename to patches/server/0799-Allow-delegation-to-vanilla-chunk-gen.patch index 930b668b61..b7371b996d 100644 --- a/patches/server/0801-Allow-delegation-to-vanilla-chunk-gen.patch +++ b/patches/server/0799-Allow-delegation-to-vanilla-chunk-gen.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Allow delegation to vanilla chunk gen diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -index 669dade4853ae52ba011ede9bc8944ea11e5fa54..2a48cb31263426abd7577bbddd1c0504ac42f7e0 100644 +index 7f874c53cdb1815e3337c51ab564b7dafb20c939..fe0b8b623b8853aaa4fd0a105f502cfebb763dfb 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -@@ -2322,6 +2322,90 @@ public final class CraftServer implements Server { +@@ -2329,6 +2329,90 @@ public final class CraftServer implements Server { return new OldCraftChunkData(world.getMinHeight(), world.getMaxHeight(), handle.registryAccess().registryOrThrow(net.minecraft.core.Registry.BIOME_REGISTRY), world); // Paper - Anti-Xray - Add parameters } diff --git a/patches/server/0802-Highly-optimise-single-and-multi-AABB-VoxelShapes-an.patch b/patches/server/0800-Highly-optimise-single-and-multi-AABB-VoxelShapes-an.patch similarity index 99% rename from patches/server/0802-Highly-optimise-single-and-multi-AABB-VoxelShapes-an.patch rename to patches/server/0800-Highly-optimise-single-and-multi-AABB-VoxelShapes-an.patch index 727777f3a5..6523368311 100644 --- a/patches/server/0802-Highly-optimise-single-and-multi-AABB-VoxelShapes-an.patch +++ b/patches/server/0800-Highly-optimise-single-and-multi-AABB-VoxelShapes-an.patch @@ -1180,7 +1180,7 @@ index 0000000000000000000000000000000000000000..d67a40e7be030142443680c89e1763fc + } +} diff --git a/src/main/java/net/minecraft/server/level/ServerPlayer.java b/src/main/java/net/minecraft/server/level/ServerPlayer.java -index e243e67ff389014b2b1a80fa20e67996fae48f8d..c3484d612d0273bc066b3ac274b33c21ae9e0936 100644 +index 97de35c614e1e9b0e825f9914173a3e1e0e53221..b35b36527294dd697d146d2ad817d7911145ae8c 100644 --- a/src/main/java/net/minecraft/server/level/ServerPlayer.java +++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java @@ -423,7 +423,7 @@ public class ServerPlayer extends Player { @@ -1202,7 +1202,7 @@ index e243e67ff389014b2b1a80fa20e67996fae48f8d..c3484d612d0273bc066b3ac274b33c21 } } diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java -index 6aac9f91ef95f7b0a3319360dbc8360d2c93eb8c..132ce6a997540c3f67f12be068883bd990e7bd63 100644 +index d3c6c1b9ac00df265507db61301cae397214dca7..8f89c694e08db71a8e1509a102ad96defe788828 100644 --- a/src/main/java/net/minecraft/server/players/PlayerList.java +++ b/src/main/java/net/minecraft/server/players/PlayerList.java @@ -937,7 +937,7 @@ public abstract class PlayerList { diff --git a/patches/server/0803-Optimise-collision-checking-in-player-move-packet-ha.patch b/patches/server/0801-Optimise-collision-checking-in-player-move-packet-ha.patch similarity index 94% rename from patches/server/0803-Optimise-collision-checking-in-player-move-packet-ha.patch rename to patches/server/0801-Optimise-collision-checking-in-player-move-packet-ha.patch index 3d4be25da9..2f406412e9 100644 --- a/patches/server/0803-Optimise-collision-checking-in-player-move-packet-ha.patch +++ b/patches/server/0801-Optimise-collision-checking-in-player-move-packet-ha.patch @@ -6,10 +6,10 @@ Subject: [PATCH] Optimise collision checking in player move packet handling Move collision logic to just the hasNewCollision call instead of getCubes + hasNewCollision diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -index 331c700ec85d84417bf734f30a3870659c5da2e9..abd9ee4c2cddf0fd1e31bffbb60db025491e8315 100644 +index 52a5df31e7e0420c0cebeca4f9bfc1c981b8e128..36c37ae73696a5fe443e7fd6614bca95e29be9a8 100644 --- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -@@ -658,7 +658,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic +@@ -661,7 +661,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic return; } @@ -18,7 +18,7 @@ index 331c700ec85d84417bf734f30a3870659c5da2e9..abd9ee4c2cddf0fd1e31bffbb60db025 d6 = d3 - this.vehicleLastGoodX; // Paper - diff on change, used for checking large move vectors above d7 = d4 - this.vehicleLastGoodY - 1.0E-6D; // Paper - diff on change, used for checking large move vectors above -@@ -666,6 +666,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic +@@ -669,6 +669,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic boolean flag1 = entity.verticalCollisionBelow; entity.move(MoverType.PLAYER, new Vec3(d6, d7, d8)); @@ -26,7 +26,7 @@ index 331c700ec85d84417bf734f30a3870659c5da2e9..abd9ee4c2cddf0fd1e31bffbb60db025 double d11 = d7; d6 = d3 - entity.getX(); -@@ -679,16 +680,24 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic +@@ -682,16 +683,24 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic boolean flag2 = false; if (d10 > org.spigotmc.SpigotConfig.movedWronglyThreshold) { // Spigot @@ -54,7 +54,7 @@ index 331c700ec85d84417bf734f30a3870659c5da2e9..abd9ee4c2cddf0fd1e31bffbb60db025 entity.absMoveTo(d0, d1, d2, f, f1); this.player.absMoveTo(d0, d1, d2, this.player.getYRot(), this.player.getXRot()); // CraftBukkit this.connection.send(new ClientboundMoveVehiclePacket(entity)); -@@ -774,7 +783,32 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic +@@ -777,7 +786,32 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic } private boolean noBlocksAround(Entity entity) { @@ -88,7 +88,7 @@ index 331c700ec85d84417bf734f30a3870659c5da2e9..abd9ee4c2cddf0fd1e31bffbb60db025 } @Override -@@ -1350,7 +1384,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic +@@ -1357,7 +1391,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic } if (this.awaitingPositionFromClient != null) { @@ -97,7 +97,7 @@ index 331c700ec85d84417bf734f30a3870659c5da2e9..abd9ee4c2cddf0fd1e31bffbb60db025 this.awaitingTeleportTime = this.tickCount; this.teleport(this.awaitingPositionFromClient.x, this.awaitingPositionFromClient.y, this.awaitingPositionFromClient.z, this.player.getYRot(), this.player.getXRot()); } -@@ -1444,7 +1478,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic +@@ -1451,7 +1485,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic } } @@ -106,7 +106,7 @@ index 331c700ec85d84417bf734f30a3870659c5da2e9..abd9ee4c2cddf0fd1e31bffbb60db025 d7 = d0 - this.lastGoodX; // Paper - diff on change, used for checking large move vectors above d8 = d1 - this.lastGoodY; // Paper - diff on change, used for checking large move vectors above -@@ -1485,6 +1519,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic +@@ -1492,6 +1526,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic boolean flag1 = this.player.verticalCollisionBelow; this.player.move(MoverType.PLAYER, new Vec3(d7, d8, d9)); @@ -114,7 +114,7 @@ index 331c700ec85d84417bf734f30a3870659c5da2e9..abd9ee4c2cddf0fd1e31bffbb60db025 this.player.onGround = packet.isOnGround(); // CraftBukkit - SPIGOT-5810, SPIGOT-5835, SPIGOT-6828: reset by this.player.move // Paper start - prevent position desync if (this.awaitingPositionFromClient != null) { -@@ -1504,12 +1539,23 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic +@@ -1511,12 +1546,23 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic boolean flag2 = false; if (!this.player.isChangingDimension() && d11 > org.spigotmc.SpigotConfig.movedWronglyThreshold && !this.player.isSleeping() && !this.player.gameMode.isCreative() && this.player.gameMode.getGameModeForPlayer() != GameType.SPECTATOR) { // Spigot @@ -140,7 +140,7 @@ index 331c700ec85d84417bf734f30a3870659c5da2e9..abd9ee4c2cddf0fd1e31bffbb60db025 this.internalTeleport(d3, d4, d5, f, f1, Collections.emptySet(), false); // CraftBukkit - SPIGOT-1807: Don't call teleport event, when the client thinks the player is falling, because the chunks are not loaded on the client yet. } else { // CraftBukkit start - fire PlayerMoveEvent -@@ -1595,6 +1641,27 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic +@@ -1602,6 +1648,27 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic } } diff --git a/patches/server/0804-Actually-unload-POI-data.patch b/patches/server/0802-Actually-unload-POI-data.patch similarity index 100% rename from patches/server/0804-Actually-unload-POI-data.patch rename to patches/server/0802-Actually-unload-POI-data.patch diff --git a/patches/server/0805-Fix-ChunkSnapshot-isSectionEmpty-int-and-optimize-Pa.patch b/patches/server/0803-Fix-ChunkSnapshot-isSectionEmpty-int-and-optimize-Pa.patch similarity index 100% rename from patches/server/0805-Fix-ChunkSnapshot-isSectionEmpty-int-and-optimize-Pa.patch rename to patches/server/0803-Fix-ChunkSnapshot-isSectionEmpty-int-and-optimize-Pa.patch diff --git a/patches/server/0806-Update-Log4j.patch b/patches/server/0804-Update-Log4j.patch similarity index 100% rename from patches/server/0806-Update-Log4j.patch rename to patches/server/0804-Update-Log4j.patch diff --git a/patches/server/0807-Add-more-Campfire-API.patch b/patches/server/0805-Add-more-Campfire-API.patch similarity index 100% rename from patches/server/0807-Add-more-Campfire-API.patch rename to patches/server/0805-Add-more-Campfire-API.patch diff --git a/patches/server/0808-Only-write-chunk-data-to-disk-if-it-serializes-witho.patch b/patches/server/0806-Only-write-chunk-data-to-disk-if-it-serializes-witho.patch similarity index 87% rename from patches/server/0808-Only-write-chunk-data-to-disk-if-it-serializes-witho.patch rename to patches/server/0806-Only-write-chunk-data-to-disk-if-it-serializes-witho.patch index 7c333b5f55..8596aa0004 100644 --- a/patches/server/0808-Only-write-chunk-data-to-disk-if-it-serializes-witho.patch +++ b/patches/server/0806-Only-write-chunk-data-to-disk-if-it-serializes-witho.patch @@ -8,17 +8,27 @@ This ensures at least a valid version of the chunk exists on disk, even if outdated diff --git a/src/main/java/net/minecraft/world/level/chunk/storage/RegionFile.java b/src/main/java/net/minecraft/world/level/chunk/storage/RegionFile.java -index 8ff8855c5267379b3a5f5d8baa4a275ffee2c4bf..6704ae5c2ee01f8b319f4d425fe08c16d7b1b212 100644 +index 8ff8855c5267379b3a5f5d8baa4a275ffee2c4bf..fc3442b4c7e1f22080fe6bf36d4fade162d6709e 100644 --- a/src/main/java/net/minecraft/world/level/chunk/storage/RegionFile.java +++ b/src/main/java/net/minecraft/world/level/chunk/storage/RegionFile.java -@@ -1019,6 +1019,24 @@ public class RegionFile implements AutoCloseable { +@@ -1004,6 +1004,9 @@ public class RegionFile implements AutoCloseable { + } + + } ++ ++ public static final int MAX_CHUNK_SIZE = 500 * 1024 * 1024; // Paper - don't write garbage data to disk if writing serialization fails ++ + // Paper end + private class ChunkBuffer extends ByteArrayOutputStream { + +@@ -1019,6 +1022,24 @@ public class RegionFile implements AutoCloseable { this.pos = chunkcoordintpair; } + // Paper start - don't write garbage data to disk if writing serialization fails + @Override + public void write(final int b) { -+ if (this.count > 500_000_000) { ++ if (this.count > MAX_CHUNK_SIZE) { + throw new RegionFileStorage.RegionFileSizeException("Region file too large: " + this.count); + } + super.write(b); @@ -26,7 +36,7 @@ index 8ff8855c5267379b3a5f5d8baa4a275ffee2c4bf..6704ae5c2ee01f8b319f4d425fe08c16 + + @Override + public void write(final byte[] b, final int off, final int len) { -+ if (this.count + len > 500_000_000) { ++ if (this.count + len > MAX_CHUNK_SIZE) { + throw new RegionFileStorage.RegionFileSizeException("Region file too large: " + (this.count + len)); + } + super.write(b, off, len); diff --git a/patches/server/0809-Fix-tripwire-state-inconsistency.patch b/patches/server/0807-Fix-tripwire-state-inconsistency.patch similarity index 98% rename from patches/server/0809-Fix-tripwire-state-inconsistency.patch rename to patches/server/0807-Fix-tripwire-state-inconsistency.patch index d567618d3d..eba71d4136 100644 --- a/patches/server/0809-Fix-tripwire-state-inconsistency.patch +++ b/patches/server/0807-Fix-tripwire-state-inconsistency.patch @@ -1,5 +1,5 @@ From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: Nassim Jahnke +From: Nassim Jahnke Date: Sun, 19 Dec 2021 21:11:20 +0100 Subject: [PATCH] Fix tripwire state inconsistency diff --git a/patches/server/0810-Fix-fluid-logging-on-Block-breakNaturally.patch b/patches/server/0808-Fix-fluid-logging-on-Block-breakNaturally.patch similarity index 100% rename from patches/server/0810-Fix-fluid-logging-on-Block-breakNaturally.patch rename to patches/server/0808-Fix-fluid-logging-on-Block-breakNaturally.patch diff --git a/patches/server/0811-Forward-CraftEntity-in-teleport-command.patch b/patches/server/0809-Forward-CraftEntity-in-teleport-command.patch similarity index 100% rename from patches/server/0811-Forward-CraftEntity-in-teleport-command.patch rename to patches/server/0809-Forward-CraftEntity-in-teleport-command.patch diff --git a/patches/server/0812-Improve-scoreboard-entries.patch b/patches/server/0810-Improve-scoreboard-entries.patch similarity index 92% rename from patches/server/0812-Improve-scoreboard-entries.patch rename to patches/server/0810-Improve-scoreboard-entries.patch index 313567a730..2a65cbf36c 100644 --- a/patches/server/0812-Improve-scoreboard-entries.patch +++ b/patches/server/0810-Improve-scoreboard-entries.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Improve scoreboard entries diff --git a/src/main/java/org/bukkit/craftbukkit/scoreboard/CraftObjective.java b/src/main/java/org/bukkit/craftbukkit/scoreboard/CraftObjective.java -index 6752cd9b3bc246fc2a7764df0d2b40d3e638fa62..c5cf800ab8cbb5ebcf1b06ad591f08be75859b8c 100644 +index b7f0277b50a0f45c32b818bf9fe1218874aa8533..20b29f78fe56909e02061021b82a84cb7728d8a8 100644 --- a/src/main/java/org/bukkit/craftbukkit/scoreboard/CraftObjective.java +++ b/src/main/java/org/bukkit/craftbukkit/scoreboard/CraftObjective.java -@@ -138,6 +138,14 @@ final class CraftObjective extends CraftScoreboardComponent implements Objective +@@ -146,6 +146,14 @@ final class CraftObjective extends CraftScoreboardComponent implements Objective return new CraftScore(this, entry); } @@ -24,10 +24,10 @@ index 6752cd9b3bc246fc2a7764df0d2b40d3e638fa62..c5cf800ab8cbb5ebcf1b06ad591f08be public void unregister() throws IllegalStateException { CraftScoreboard scoreboard = this.checkState(); diff --git a/src/main/java/org/bukkit/craftbukkit/scoreboard/CraftScoreboard.java b/src/main/java/org/bukkit/craftbukkit/scoreboard/CraftScoreboard.java -index 167376bcd547f55983ccbb0d46e571c45c7d1ed9..912d302af733d8ee2517cf5f243301e6452493f9 100644 +index a038ede38ebb507d6a0182a4a34f2b0722ef024e..fe57437155ff9471738d3b85e787350601b79584 100644 --- a/src/main/java/org/bukkit/craftbukkit/scoreboard/CraftScoreboard.java +++ b/src/main/java/org/bukkit/craftbukkit/scoreboard/CraftScoreboard.java -@@ -234,4 +234,23 @@ public final class CraftScoreboard implements org.bukkit.scoreboard.Scoreboard { +@@ -247,4 +247,23 @@ public final class CraftScoreboard implements org.bukkit.scoreboard.Scoreboard { public Scoreboard getHandle() { return this.board; } diff --git a/patches/server/0813-Entity-powdered-snow-API.patch b/patches/server/0811-Entity-powdered-snow-API.patch similarity index 100% rename from patches/server/0813-Entity-powdered-snow-API.patch rename to patches/server/0811-Entity-powdered-snow-API.patch diff --git a/patches/server/0814-Add-API-for-item-entity-health.patch b/patches/server/0812-Add-API-for-item-entity-health.patch similarity index 100% rename from patches/server/0814-Add-API-for-item-entity-health.patch rename to patches/server/0812-Add-API-for-item-entity-health.patch diff --git a/patches/server/0815-Fix-entity-type-tags-suggestions-in-selectors.patch b/patches/server/0813-Fix-entity-type-tags-suggestions-in-selectors.patch similarity index 95% rename from patches/server/0815-Fix-entity-type-tags-suggestions-in-selectors.patch rename to patches/server/0813-Fix-entity-type-tags-suggestions-in-selectors.patch index 6717a81d06..ca29c1bbf2 100644 --- a/patches/server/0815-Fix-entity-type-tags-suggestions-in-selectors.patch +++ b/patches/server/0813-Fix-entity-type-tags-suggestions-in-selectors.patch @@ -10,7 +10,7 @@ when if this was fixed on the client, that wouldn't be needed. Mojira Issue: https://bugs.mojang.com/browse/MC-235045 diff --git a/src/main/java/net/minecraft/commands/CommandSourceStack.java b/src/main/java/net/minecraft/commands/CommandSourceStack.java -index b14773074fc4b10ef427eb0ad9e21601a7287901..e0dd0fc1638377f4d4226d4b2976b901d635dff0 100644 +index 6fdbe747645eb83f31b56bca77a9d7962237aed8..dd0143f319d4adef8834c513af34b1cce7a94a84 100644 --- a/src/main/java/net/minecraft/commands/CommandSourceStack.java +++ b/src/main/java/net/minecraft/commands/CommandSourceStack.java @@ -412,4 +412,20 @@ public class CommandSourceStack implements SharedSuggestionProvider, com.destroy @@ -35,18 +35,18 @@ index b14773074fc4b10ef427eb0ad9e21601a7287901..e0dd0fc1638377f4d4226d4b2976b901 + // Paper end } diff --git a/src/main/java/net/minecraft/commands/Commands.java b/src/main/java/net/minecraft/commands/Commands.java -index e70e5af7e49e4ccf332d9ce44e1a106344b35490..a0f5aa8c3cfce63af9cb286278a7fdebd7aa3642 100644 +index 27093aed1f4112a5414671fd5d9c4e683011506d..67ab16743b36dbf8b4336e33988d8e78433f566d 100644 --- a/src/main/java/net/minecraft/commands/Commands.java +++ b/src/main/java/net/minecraft/commands/Commands.java -@@ -422,6 +422,7 @@ public class Commands { +@@ -433,6 +433,7 @@ public class Commands { private void fillUsableCommands(CommandNode tree, CommandNode result, CommandSourceStack source, Map, CommandNode> resultNodes) { Iterator iterator = tree.getChildren().iterator(); + boolean registeredAskServerSuggestionsForTree = false; // Paper - tell clients to ask server for suggestions for EntityArguments while (iterator.hasNext()) { CommandNode commandnode2 = (CommandNode) iterator.next(); - if ( !org.spigotmc.SpigotConfig.sendNamespaced && commandnode2.getName().contains( ":" ) ) continue; // Spigot -@@ -443,6 +444,12 @@ public class Commands { + // Paper start +@@ -459,6 +460,12 @@ public class Commands { if (requiredargumentbuilder.getSuggestionsProvider() != null) { requiredargumentbuilder.suggests(SuggestionProviders.safelySwap(requiredargumentbuilder.getSuggestionsProvider())); diff --git a/patches/server/0816-Configurable-max-block-light-for-monster-spawning.patch b/patches/server/0814-Configurable-max-block-light-for-monster-spawning.patch similarity index 96% rename from patches/server/0816-Configurable-max-block-light-for-monster-spawning.patch rename to patches/server/0814-Configurable-max-block-light-for-monster-spawning.patch index 3430e3062a..baf913d352 100644 --- a/patches/server/0816-Configurable-max-block-light-for-monster-spawning.patch +++ b/patches/server/0814-Configurable-max-block-light-for-monster-spawning.patch @@ -1,5 +1,5 @@ From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: Nassim Jahnke +From: Nassim Jahnke Date: Thu, 16 Dec 2021 09:40:39 +0100 Subject: [PATCH] Configurable max block light for monster spawning diff --git a/patches/server/0817-Fix-sticky-pistons-and-BlockPistonRetractEvent.patch b/patches/server/0815-Fix-sticky-pistons-and-BlockPistonRetractEvent.patch similarity index 100% rename from patches/server/0817-Fix-sticky-pistons-and-BlockPistonRetractEvent.patch rename to patches/server/0815-Fix-sticky-pistons-and-BlockPistonRetractEvent.patch diff --git a/patches/server/0818-Load-effect-amplifiers-greater-than-127-correctly.patch b/patches/server/0816-Load-effect-amplifiers-greater-than-127-correctly.patch similarity index 91% rename from patches/server/0818-Load-effect-amplifiers-greater-than-127-correctly.patch rename to patches/server/0816-Load-effect-amplifiers-greater-than-127-correctly.patch index cf55a56134..768bf70b1f 100644 --- a/patches/server/0818-Load-effect-amplifiers-greater-than-127-correctly.patch +++ b/patches/server/0816-Load-effect-amplifiers-greater-than-127-correctly.patch @@ -6,7 +6,7 @@ Subject: [PATCH] Load effect amplifiers greater than 127 correctly MOJIRA: MC-118857 diff --git a/src/main/java/net/minecraft/world/effect/MobEffectInstance.java b/src/main/java/net/minecraft/world/effect/MobEffectInstance.java -index b99f15fbe87bcf130d9136559d38a2082a275c12..d545a581b802ec74bcf8a1709d1b0cb790ed5d40 100644 +index 3232ecbf96761528be1bc88f223b51771386ad37..f5c9be3fde2654bd5a6b3ee737afe96a9393e836 100644 --- a/src/main/java/net/minecraft/world/effect/MobEffectInstance.java +++ b/src/main/java/net/minecraft/world/effect/MobEffectInstance.java @@ -265,7 +265,7 @@ public class MobEffectInstance implements Comparable { diff --git a/patches/server/0819-Expose-isFuel-and-canSmelt-methods-to-FurnaceInvento.patch b/patches/server/0817-Expose-isFuel-and-canSmelt-methods-to-FurnaceInvento.patch similarity index 100% rename from patches/server/0819-Expose-isFuel-and-canSmelt-methods-to-FurnaceInvento.patch rename to patches/server/0817-Expose-isFuel-and-canSmelt-methods-to-FurnaceInvento.patch diff --git a/patches/server/0820-Fix-bees-aging-inside-hives.patch b/patches/server/0818-Fix-bees-aging-inside-hives.patch similarity index 100% rename from patches/server/0820-Fix-bees-aging-inside-hives.patch rename to patches/server/0818-Fix-bees-aging-inside-hives.patch diff --git a/patches/server/0821-Bucketable-API.patch b/patches/server/0819-Bucketable-API.patch similarity index 100% rename from patches/server/0821-Bucketable-API.patch rename to patches/server/0819-Bucketable-API.patch diff --git a/patches/server/0822-Check-player-world-in-endPortalSoundRadius.patch b/patches/server/0820-Check-player-world-in-endPortalSoundRadius.patch similarity index 100% rename from patches/server/0822-Check-player-world-in-endPortalSoundRadius.patch rename to patches/server/0820-Check-player-world-in-endPortalSoundRadius.patch diff --git a/patches/server/0823-Validate-usernames.patch b/patches/server/0821-Validate-usernames.patch similarity index 90% rename from patches/server/0823-Validate-usernames.patch rename to patches/server/0821-Validate-usernames.patch index 99c6bacac5..bf5280d1de 100644 --- a/patches/server/0823-Validate-usernames.patch +++ b/patches/server/0821-Validate-usernames.patch @@ -5,18 +5,18 @@ 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 -index 303981c9b873eee07052fbe607690d12074cd1d1..aabd8916470290045832e0fc1895d099c8553dd4 100644 +index acd581d14e0ef1fe5a6545ee67be00deff589879..553eb8e437b07376dbfc54b0018bcc3ff93e4461 100644 --- a/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 +@@ -66,6 +66,7 @@ public class ServerLoginPacketListenerImpl implements TickablePacketListener, Se + @Nullable private ProfilePublicKey.Data profilePublicKeyData; public String hostname = ""; // CraftBukkit - add field - private int velocityLoginMessageId = -1; // Paper - Velocity support + public boolean iKnowThisMayNotBeTheBestIdeaButPleaseDisableUsernameValidation = false; // Paper - username validation overriding public ServerLoginPacketListenerImpl(MinecraftServer server, Connection connection) { this.state = ServerLoginPacketListenerImpl.State.HELLO; -@@ -272,10 +273,38 @@ public class ServerLoginPacketListenerImpl implements TickablePacketListener, Se +@@ -255,10 +256,38 @@ public class ServerLoginPacketListenerImpl implements TickablePacketListener, Se } } @@ -56,7 +56,7 @@ index 303981c9b873eee07052fbe607690d12074cd1d1..aabd8916470290045832e0fc1895d099 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 -index 132ce6a997540c3f67f12be068883bd990e7bd63..dd514cc59b28fdc49dbb4c9641f11e8835b8fb1a 100644 +index 8f89c694e08db71a8e1509a102ad96defe788828..dd06ed2a72df27a6f2bd4014ec9055729e7f2773 100644 --- a/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 { diff --git a/patches/server/0824-Fix-saving-configs-with-more-long-comments.patch b/patches/server/0822-Fix-saving-configs-with-more-long-comments.patch similarity index 100% rename from patches/server/0824-Fix-saving-configs-with-more-long-comments.patch rename to patches/server/0822-Fix-saving-configs-with-more-long-comments.patch diff --git a/patches/server/0825-Make-water-animal-spawn-height-configurable.patch b/patches/server/0823-Make-water-animal-spawn-height-configurable.patch similarity index 100% rename from patches/server/0825-Make-water-animal-spawn-height-configurable.patch rename to patches/server/0823-Make-water-animal-spawn-height-configurable.patch diff --git a/patches/server/0826-Expose-vanilla-BiomeProvider-from-WorldInfo.patch b/patches/server/0824-Expose-vanilla-BiomeProvider-from-WorldInfo.patch similarity index 97% rename from patches/server/0826-Expose-vanilla-BiomeProvider-from-WorldInfo.patch rename to patches/server/0824-Expose-vanilla-BiomeProvider-from-WorldInfo.patch index 27fb3bbc46..c07b3000af 100644 --- a/patches/server/0826-Expose-vanilla-BiomeProvider-from-WorldInfo.patch +++ b/patches/server/0824-Expose-vanilla-BiomeProvider-from-WorldInfo.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Expose vanilla BiomeProvider from WorldInfo diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index 8a36c0bacb71cd9e31affa6290d28bf0f0374d07..d087b37ef4a2c6bee9ef05dfc8ca614d98601928 100644 +index 68c0bb1d493b3de3c3e80018a1655ec968b0316a..a4433426efd0823cd8145a50b38127f63e90adc9 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java @@ -562,7 +562,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop iregistry = worlddata.worldGenSettings().dimensions(); LevelStem worlddimension = (LevelStem) iregistry.get(actualDimension); diff --git a/patches/server/0827-Add-config-option-for-worlds-affected-by-time-cmd.patch b/patches/server/0825-Add-config-option-for-worlds-affected-by-time-cmd.patch similarity index 100% rename from patches/server/0827-Add-config-option-for-worlds-affected-by-time-cmd.patch rename to patches/server/0825-Add-config-option-for-worlds-affected-by-time-cmd.patch diff --git a/patches/server/0828-Add-new-overload-to-PersistentDataContainer-has.patch b/patches/server/0826-Add-new-overload-to-PersistentDataContainer-has.patch similarity index 100% rename from patches/server/0828-Add-new-overload-to-PersistentDataContainer-has.patch rename to patches/server/0826-Add-new-overload-to-PersistentDataContainer-has.patch diff --git a/patches/server/0829-Multiple-Entries-with-Scoreboards.patch b/patches/server/0827-Multiple-Entries-with-Scoreboards.patch similarity index 100% rename from patches/server/0829-Multiple-Entries-with-Scoreboards.patch rename to patches/server/0827-Multiple-Entries-with-Scoreboards.patch diff --git a/patches/server/0830-Reset-placed-block-on-exception.patch b/patches/server/0828-Reset-placed-block-on-exception.patch similarity index 98% rename from patches/server/0830-Reset-placed-block-on-exception.patch rename to patches/server/0828-Reset-placed-block-on-exception.patch index abdf99f132..3881c0d6de 100644 --- a/patches/server/0830-Reset-placed-block-on-exception.patch +++ b/patches/server/0828-Reset-placed-block-on-exception.patch @@ -1,5 +1,5 @@ From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: Nassim Jahnke +From: Nassim Jahnke Date: Fri, 7 Jan 2022 11:45:15 +0100 Subject: [PATCH] Reset placed block on exception diff --git a/patches/server/0831-Add-configurable-height-for-slime-spawn.patch b/patches/server/0829-Add-configurable-height-for-slime-spawn.patch similarity index 100% rename from patches/server/0831-Add-configurable-height-for-slime-spawn.patch rename to patches/server/0829-Add-configurable-height-for-slime-spawn.patch diff --git a/patches/server/0832-Added-getHostname-to-AsyncPlayerPreLoginEvent.patch b/patches/server/0830-Added-getHostname-to-AsyncPlayerPreLoginEvent.patch similarity index 89% rename from patches/server/0832-Added-getHostname-to-AsyncPlayerPreLoginEvent.patch rename to patches/server/0830-Added-getHostname-to-AsyncPlayerPreLoginEvent.patch index fa20709fd9..eb758a5555 100644 --- a/patches/server/0832-Added-getHostname-to-AsyncPlayerPreLoginEvent.patch +++ b/patches/server/0830-Added-getHostname-to-AsyncPlayerPreLoginEvent.patch @@ -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 -index aabd8916470290045832e0fc1895d099c8553dd4..7982b8026c6eda0798422126208b40c59afa078a 100644 +index 553eb8e437b07376dbfc54b0018bcc3ff93e4461..51ff7ab5d8740e755cc893723f659c8481c1ec89 100644 --- a/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 +@@ -421,7 +421,7 @@ public class ServerLoginPacketListenerImpl implements TickablePacketListener, Se // Paper start com.destroystokyo.paper.profile.PlayerProfile profile = com.destroystokyo.paper.profile.CraftPlayerProfile.asBukkitMirror(ServerLoginPacketListenerImpl.this.gameProfile); diff --git a/patches/server/0833-Fix-xp-reward-for-baby-zombies.patch b/patches/server/0831-Fix-xp-reward-for-baby-zombies.patch similarity index 100% rename from patches/server/0833-Fix-xp-reward-for-baby-zombies.patch rename to patches/server/0831-Fix-xp-reward-for-baby-zombies.patch diff --git a/patches/server/0834-Kick-on-main-for-illegal-chat.patch b/patches/server/0832-Kick-on-main-for-illegal-chat.patch similarity index 89% rename from patches/server/0834-Kick-on-main-for-illegal-chat.patch rename to patches/server/0832-Kick-on-main-for-illegal-chat.patch index bc0f8683b0..475571bd7e 100644 --- a/patches/server/0834-Kick-on-main-for-illegal-chat.patch +++ b/patches/server/0832-Kick-on-main-for-illegal-chat.patch @@ -1,5 +1,5 @@ From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: Nassim Jahnke +From: Nassim Jahnke Date: Mon, 17 Jan 2022 19:47:19 +0100 Subject: [PATCH] Kick on main for illegal chat @@ -7,10 +7,10 @@ Makes the PlayerKickEvent fire on the main thread for 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 -index abd9ee4c2cddf0fd1e31bffbb60db025491e8315..067b18932a39a97cd13b59d43350c1fe7239a3da 100644 +index 36c37ae73696a5fe443e7fd6614bca95e29be9a8..e16de9e1cf9c6d5377f7ce434cc737056093e71f 100644 --- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -@@ -2173,7 +2173,9 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic +@@ -2180,7 +2180,9 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic } // CraftBukkit end if (ServerGamePacketListenerImpl.isChatMessageIllegal(packet.message())) { @@ -20,7 +20,7 @@ index abd9ee4c2cddf0fd1e31bffbb60db025491e8315..067b18932a39a97cd13b59d43350c1fe } else { if (this.tryHandleChat(packet.message(), packet.timeStamp(), packet.lastSeenMessages())) { // this.server.submit(() -> { // CraftBukkit - async chat -@@ -2201,7 +2203,9 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic +@@ -2208,7 +2210,9 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic @Override public void handleChatCommand(ServerboundChatCommandPacket packet) { if (ServerGamePacketListenerImpl.isChatMessageIllegal(packet.command())) { @@ -30,7 +30,7 @@ index abd9ee4c2cddf0fd1e31bffbb60db025491e8315..067b18932a39a97cd13b59d43350c1fe } else { if (this.tryHandleChat(packet.command(), packet.timeStamp(), packet.lastSeenMessages())) { this.server.submit(() -> { -@@ -2287,7 +2291,9 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic +@@ -2294,7 +2298,9 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic private boolean tryHandleChat(String message, Instant timestamp, LastSeenMessages.Update acknowledgment) { if (!this.updateChatOrder(timestamp)) { ServerGamePacketListenerImpl.LOGGER.warn("{} sent out-of-order chat: '{}'", this.player.getName().getString(), message); diff --git a/patches/server/0835-Multi-Block-Change-API-Implementation.patch b/patches/server/0833-Multi-Block-Change-API-Implementation.patch similarity index 97% rename from patches/server/0835-Multi-Block-Change-API-Implementation.patch rename to patches/server/0833-Multi-Block-Change-API-Implementation.patch index bd05825fea..16d48b2da6 100644 --- a/patches/server/0835-Multi-Block-Change-API-Implementation.patch +++ b/patches/server/0833-Multi-Block-Change-API-Implementation.patch @@ -25,7 +25,7 @@ index 82ea4fabd5732052a286d50bcff8bbcc2c4aa7d7..652bea6868a03a5315965f79c76172fb public void write(FriendlyByteBuf buf) { buf.writeLong(this.sectionPos.asLong()); diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -index 9f6a26f1fb53c14b68ce7bc2a69a59cabd00de7f..fca6ccabd527bb05d2f89bf1278b46a85f397318 100644 +index 67833efdd2c4babe20a01691a44ec6f153656729..c569bf167addfedcb0d8c55b2d2cfcb52e05d0a6 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java @@ -29,6 +29,7 @@ import java.util.logging.Logger; diff --git a/patches/server/0836-Fix-NotePlayEvent.patch b/patches/server/0834-Fix-NotePlayEvent.patch similarity index 100% rename from patches/server/0836-Fix-NotePlayEvent.patch rename to patches/server/0834-Fix-NotePlayEvent.patch diff --git a/patches/server/0837-Freeze-Tick-Lock-API.patch b/patches/server/0835-Freeze-Tick-Lock-API.patch similarity index 100% rename from patches/server/0837-Freeze-Tick-Lock-API.patch rename to patches/server/0835-Freeze-Tick-Lock-API.patch diff --git a/patches/server/0838-Dolphin-API.patch b/patches/server/0836-Dolphin-API.patch similarity index 100% rename from patches/server/0838-Dolphin-API.patch rename to patches/server/0836-Dolphin-API.patch diff --git a/patches/server/0839-More-PotionEffectType-API.patch b/patches/server/0837-More-PotionEffectType-API.patch similarity index 100% rename from patches/server/0839-More-PotionEffectType-API.patch rename to patches/server/0837-More-PotionEffectType-API.patch diff --git a/patches/server/0840-Use-a-CHM-for-StructureTemplate.Pallete-cache.patch b/patches/server/0838-Use-a-CHM-for-StructureTemplate.Pallete-cache.patch similarity index 100% rename from patches/server/0840-Use-a-CHM-for-StructureTemplate.Pallete-cache.patch rename to patches/server/0838-Use-a-CHM-for-StructureTemplate.Pallete-cache.patch diff --git a/patches/server/0841-API-for-creating-command-sender-which-forwards-feedb.patch b/patches/server/0839-API-for-creating-command-sender-which-forwards-feedb.patch similarity index 97% rename from patches/server/0841-API-for-creating-command-sender-which-forwards-feedb.patch rename to patches/server/0839-API-for-creating-command-sender-which-forwards-feedb.patch index eaa7c86ed9..ca623b5026 100644 --- a/patches/server/0841-API-for-creating-command-sender-which-forwards-feedb.patch +++ b/patches/server/0839-API-for-creating-command-sender-which-forwards-feedb.patch @@ -122,10 +122,10 @@ index 0000000000000000000000000000000000000000..e3a5f1ec376319bdfda87fa27ae217bf + } +} diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -index 3c4fdd1a6e3bf04c523aca2b18632f6439189caa..b6280e653f4f625272e4208c663fc818424e8fca 100644 +index 3fe38a9a6f4c25b91a25bc2320a7d7fcbe446d9d..17d4afb04a0a767283fcccb0cc00ab0043b49e22 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -@@ -1988,6 +1988,13 @@ public final class CraftServer implements Server { +@@ -1990,6 +1990,13 @@ public final class CraftServer implements Server { return console.console; } diff --git a/patches/server/0842-Add-config-for-stronghold-seed.patch b/patches/server/0840-Add-config-for-stronghold-seed.patch similarity index 100% rename from patches/server/0842-Add-config-for-stronghold-seed.patch rename to patches/server/0840-Add-config-for-stronghold-seed.patch diff --git a/patches/server/0843-Implement-regenerateChunk.patch b/patches/server/0841-Implement-regenerateChunk.patch similarity index 99% rename from patches/server/0843-Implement-regenerateChunk.patch rename to patches/server/0841-Implement-regenerateChunk.patch index 273d8c3b32..3f73a6ed62 100644 --- a/patches/server/0843-Implement-regenerateChunk.patch +++ b/patches/server/0841-Implement-regenerateChunk.patch @@ -1,5 +1,5 @@ From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: Nassim Jahnke +From: Nassim Jahnke Date: Mon, 31 Jan 2022 11:21:50 +0100 Subject: [PATCH] Implement regenerateChunk diff --git a/patches/server/0844-Fix-cancelled-powdered-snow-bucket-placement.patch b/patches/server/0842-Fix-cancelled-powdered-snow-bucket-placement.patch similarity index 100% rename from patches/server/0844-Fix-cancelled-powdered-snow-bucket-placement.patch rename to patches/server/0842-Fix-cancelled-powdered-snow-bucket-placement.patch diff --git a/patches/server/0845-Add-missing-Validate-calls-to-CraftServer-getSpawnLi.patch b/patches/server/0843-Add-missing-Validate-calls-to-CraftServer-getSpawnLi.patch similarity index 86% rename from patches/server/0845-Add-missing-Validate-calls-to-CraftServer-getSpawnLi.patch rename to patches/server/0843-Add-missing-Validate-calls-to-CraftServer-getSpawnLi.patch index 9ec9b002df..2539ce04f9 100644 --- a/patches/server/0845-Add-missing-Validate-calls-to-CraftServer-getSpawnLi.patch +++ b/patches/server/0843-Add-missing-Validate-calls-to-CraftServer-getSpawnLi.patch @@ -6,10 +6,10 @@ Subject: [PATCH] Add missing Validate calls to CraftServer#getSpawnLimit Copies appropriate checks from CraftWorld#getSpawnLimit diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -index b6280e653f4f625272e4208c663fc818424e8fca..b880b31cd80153569db1fb55655e5485ea36cde0 100644 +index 17d4afb04a0a767283fcccb0cc00ab0043b49e22..8669584f7e89e89145631f86bf123b8a82c38e97 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -@@ -2162,6 +2162,8 @@ public final class CraftServer implements Server { +@@ -2164,6 +2164,8 @@ public final class CraftServer implements Server { @Override public int getSpawnLimit(SpawnCategory spawnCategory) { // Paper start diff --git a/patches/server/0846-Add-GameEvent-tags.patch b/patches/server/0844-Add-GameEvent-tags.patch similarity index 94% rename from patches/server/0846-Add-GameEvent-tags.patch rename to patches/server/0844-Add-GameEvent-tags.patch index 1dcf3cecb0..c4848660ea 100644 --- a/patches/server/0846-Add-GameEvent-tags.patch +++ b/patches/server/0844-Add-GameEvent-tags.patch @@ -45,10 +45,10 @@ index 0000000000000000000000000000000000000000..cb78a3d4e21376ea24347187478525d5 + } +} diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -index b880b31cd80153569db1fb55655e5485ea36cde0..941e2b22807373f739925b0d9a3eec28300ac7ff 100644 +index 8669584f7e89e89145631f86bf123b8a82c38e97..ac8f105371e61a93eb416e086ece0243bd251625 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -@@ -2568,6 +2568,15 @@ public final class CraftServer implements Server { +@@ -2575,6 +2575,15 @@ public final class CraftServer implements Server { return (org.bukkit.Tag) new CraftEntityTag(net.minecraft.core.Registry.ENTITY_TYPE, entityTagKey); } } @@ -64,7 +64,7 @@ index b880b31cd80153569db1fb55655e5485ea36cde0..941e2b22807373f739925b0d9a3eec28 default -> throw new IllegalArgumentException(); } -@@ -2600,6 +2609,13 @@ public final class CraftServer implements Server { +@@ -2607,6 +2616,13 @@ public final class CraftServer implements Server { net.minecraft.core.Registry> entityTags = net.minecraft.core.Registry.ENTITY_TYPE; return entityTags.getTags().map(pair -> (org.bukkit.Tag) new CraftEntityTag(entityTags, pair.getFirst())).collect(ImmutableList.toImmutableList()); } diff --git a/patches/server/0847-Execute-chunk-tasks-fairly-for-worlds-while-waiting-.patch b/patches/server/0845-Execute-chunk-tasks-fairly-for-worlds-while-waiting-.patch similarity index 87% rename from patches/server/0847-Execute-chunk-tasks-fairly-for-worlds-while-waiting-.patch rename to patches/server/0845-Execute-chunk-tasks-fairly-for-worlds-while-waiting-.patch index d4f44081c5..979e14609b 100644 --- a/patches/server/0847-Execute-chunk-tasks-fairly-for-worlds-while-waiting-.patch +++ b/patches/server/0845-Execute-chunk-tasks-fairly-for-worlds-while-waiting-.patch @@ -9,10 +9,10 @@ This might result in chunks loading far slower in the nether, for example. diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index d087b37ef4a2c6bee9ef05dfc8ca614d98601928..a790387e88c15e44ce3aaf50ab99e1d8beabb551 100644 +index a4433426efd0823cd8145a50b38127f63e90adc9..1444391ded50ec10e9bfeb073b01c885c429b8bd 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java -@@ -1313,6 +1313,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop> { @@ -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 b35b36527294dd697d146d2ad817d7911145ae8c..18c3d4aecf498f78040c27336d2ea56fd911d034 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 dd06ed2a72df27a6f2bd4014ec9055729e7f2773..a01858ee7a4419fb5b85df8863ab0052180079e3 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 c569bf167addfedcb0d8c55b2d2cfcb52e05d0a6..2cf84abadc7fd7806566948d4c6e2212bdf2aeb7 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 { diff --git a/patches/server/0857-Fix-Fluid-tags-isTagged-method.patch b/patches/server/0855-Fix-Fluid-tags-isTagged-method.patch similarity index 94% rename from patches/server/0857-Fix-Fluid-tags-isTagged-method.patch rename to patches/server/0855-Fix-Fluid-tags-isTagged-method.patch index 1210e3715a..0ce876073c 100644 --- a/patches/server/0857-Fix-Fluid-tags-isTagged-method.patch +++ b/patches/server/0855-Fix-Fluid-tags-isTagged-method.patch @@ -18,7 +18,7 @@ index 89cb1ec575c0f58e9934d98b056621348dbbe27a..cdd474e9b0363641839a66d3e61fec46 @Override diff --git a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java -index 1f491d48b591281e3a054c33683ac4cf76ada802..8961da579b114cbafb329c00aadf1cf75e70cf97 100644 +index d3b37adfe6d66e82db18d94f143af3aba4543f79..0a4e9b0957c9b0abbb88d472b5b3d7946c256af2 100644 --- a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java +++ b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java @@ -201,7 +201,7 @@ public final class CraftMagicNumbers implements UnsafeValues { diff --git a/patches/server/0858-Force-close-world-loading-screen.patch b/patches/server/0856-Force-close-world-loading-screen.patch similarity index 93% rename from patches/server/0858-Force-close-world-loading-screen.patch rename to patches/server/0856-Force-close-world-loading-screen.patch index 523a366198..d11111423a 100644 --- a/patches/server/0858-Force-close-world-loading-screen.patch +++ b/patches/server/0856-Force-close-world-loading-screen.patch @@ -1,5 +1,5 @@ From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: Nassim Jahnke +From: Nassim Jahnke Date: Wed, 2 Mar 2022 09:45:56 +0100 Subject: [PATCH] Force close world loading screen @@ -10,7 +10,7 @@ so we do not need that. The client only needs the chunk it is currently in to be loaded to close the loading screen, so we just send an empty one. diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java -index 04d77a1b001e80b2e2e3c6f33ee32f3abd1848fb..812c62d798d21584e12a3e83354c081c073bf8bf 100644 +index a01858ee7a4419fb5b85df8863ab0052180079e3..e1a5bd0ce00926078a0d2235b05e5972093044ab 100644 --- a/src/main/java/net/minecraft/server/players/PlayerList.java +++ b/src/main/java/net/minecraft/server/players/PlayerList.java @@ -423,6 +423,16 @@ public abstract class PlayerList { diff --git a/patches/server/0859-Fix-falling-block-spawn-methods.patch b/patches/server/0857-Fix-falling-block-spawn-methods.patch similarity index 98% rename from patches/server/0859-Fix-falling-block-spawn-methods.patch rename to patches/server/0857-Fix-falling-block-spawn-methods.patch index 168a31ec9e..3c1270d7c9 100644 --- a/patches/server/0859-Fix-falling-block-spawn-methods.patch +++ b/patches/server/0857-Fix-falling-block-spawn-methods.patch @@ -1,5 +1,5 @@ From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: Nassim Jahnke +From: Nassim Jahnke Date: Fri, 4 Mar 2022 20:35:19 +0100 Subject: [PATCH] Fix falling block spawn methods diff --git a/patches/server/0860-Expose-furnace-minecart-push-values.patch b/patches/server/0858-Expose-furnace-minecart-push-values.patch similarity index 100% rename from patches/server/0860-Expose-furnace-minecart-push-values.patch rename to patches/server/0858-Expose-furnace-minecart-push-values.patch diff --git a/patches/server/0861-Fix-cancelling-ProjectileHitEvent-for-piercing-arrow.patch b/patches/server/0859-Fix-cancelling-ProjectileHitEvent-for-piercing-arrow.patch similarity index 100% rename from patches/server/0861-Fix-cancelling-ProjectileHitEvent-for-piercing-arrow.patch rename to patches/server/0859-Fix-cancelling-ProjectileHitEvent-for-piercing-arrow.patch diff --git a/patches/server/0862-Fix-save-problems-on-shutdown.patch b/patches/server/0860-Fix-save-problems-on-shutdown.patch similarity index 91% rename from patches/server/0862-Fix-save-problems-on-shutdown.patch rename to patches/server/0860-Fix-save-problems-on-shutdown.patch index 5d60f277a3..b022788b8f 100644 --- a/patches/server/0862-Fix-save-problems-on-shutdown.patch +++ b/patches/server/0860-Fix-save-problems-on-shutdown.patch @@ -12,10 +12,10 @@ Subject: [PATCH] Fix save problems on shutdown processed so that the main process queue can be drained diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index 1edf1d97c2d0a145d3baac9140765a9c2bb2a7a6..ad9609ccb33bbe9bdda94a50900258ad3e0339f0 100644 +index dca520534feac302b8e0f389ee9286bd719e31a6..33cf037bf8ed5ea88f52ee3731cde63c70e813ef 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java -@@ -956,6 +956,13 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop { return worldserver1.getChunkSource().chunkMap.hasWork(); })) { -@@ -968,9 +975,11 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop { return true; }, false); @@ -42,7 +42,7 @@ index 1edf1d97c2d0a145d3baac9140765a9c2bb2a7a6..ad9609ccb33bbe9bdda94a50900258ad } this.saveAllChunks(false, true, false); -@@ -1265,6 +1274,11 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop Date: Tue, 22 Jun 2021 23:41:11 -0400 Subject: [PATCH] More Projectile API +Co-authored-by: Nassim Jahnke +diff --git a/src/main/java/net/minecraft/world/entity/projectile/ThrownPotion.java b/src/main/java/net/minecraft/world/entity/projectile/ThrownPotion.java +index fee09e6ff72cf1da389d5811dd005642cd50a5b4..4f276b2a86735a2c664738450ae0fbdd82031d4e 100644 +--- a/src/main/java/net/minecraft/world/entity/projectile/ThrownPotion.java ++++ b/src/main/java/net/minecraft/world/entity/projectile/ThrownPotion.java +@@ -98,6 +98,11 @@ public class ThrownPotion extends ThrowableItemProjectile implements ItemSupplie + @Override + protected void onHit(HitResult hitResult) { + super.onHit(hitResult); ++ // Paper start - More projectile API ++ this.splash(hitResult); ++ } ++ public void splash(@org.jetbrains.annotations.Nullable HitResult hitResult) { ++ // Paper end - More projectile API + if (!this.level.isClientSide) { + ItemStack itemstack = this.getItem(); + Potion potionregistry = PotionUtils.getPotion(itemstack); +@@ -110,7 +115,7 @@ public class ThrownPotion extends ThrowableItemProjectile implements ItemSupplie + if (this.isLingering()) { + this.makeAreaOfEffectCloud(itemstack, potionregistry); + } else { +- this.applySplash(list, hitResult.getType() == HitResult.Type.ENTITY ? ((EntityHitResult) hitResult).getEntity() : null); ++ this.applySplash(list, hitResult != null && hitResult.getType() == HitResult.Type.ENTITY ? ((EntityHitResult) hitResult).getEntity() : null); // Paper - nullable hitResult + } + } + diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftFirework.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftFirework.java index be86114eac3975b82ca74d4d6ed3f0402a642e8a..93fd9e87de3078f50431b5d80540d4335d7c79e5 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftFirework.java @@ -132,10 +158,10 @@ index 6bfa984781a483d048ef4318761203c701d8a632..5e0c2c5094e1578162d1a50d50701fbd + // Paper end } diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftThrownPotion.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftThrownPotion.java -index b08739dd1ffd041f0885af6c1f57dca9027763b6..c1594f62c06a49ba2d0c2c6e6befcda7d1fe6e1b 100644 +index 0db8aa840ea026d48215ac5dc80ffde5f12725b1..397e0df15a0e64e5bc522f62f3b327a5039ec4c8 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftThrownPotion.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftThrownPotion.java -@@ -39,11 +39,26 @@ public class CraftThrownPotion extends CraftProjectile implements ThrownPotion { +@@ -39,11 +39,31 @@ public class CraftThrownPotion extends CraftThrowableProjectile implements Throw Validate.notNull(item, "ItemStack cannot be null."); // The ItemStack must be a potion. @@ -159,6 +185,11 @@ index b08739dd1ffd041f0885af6c1f57dca9027763b6..c1594f62c06a49ba2d0c2c6e6befcda7 + CraftItemStack.applyMetaToItem(item, meta); + this.getHandle().setItem(item); // Reset item + } ++ ++ @Override ++ public void splash() { ++ this.getHandle().splash(null); ++ } + // Paper end @Override public net.minecraft.world.entity.projectile.ThrownPotion getHandle() { diff --git a/patches/server/0864-Fix-swamp-hut-cat-generation-deadlock.patch b/patches/server/0862-Fix-swamp-hut-cat-generation-deadlock.patch similarity index 100% rename from patches/server/0864-Fix-swamp-hut-cat-generation-deadlock.patch rename to patches/server/0862-Fix-swamp-hut-cat-generation-deadlock.patch diff --git a/patches/server/0865-Don-t-allow-vehicle-movement-from-players-while-tele.patch b/patches/server/0863-Don-t-allow-vehicle-movement-from-players-while-tele.patch similarity index 88% rename from patches/server/0865-Don-t-allow-vehicle-movement-from-players-while-tele.patch rename to patches/server/0863-Don-t-allow-vehicle-movement-from-players-while-tele.patch index 4a754b2d95..933fa4076e 100644 --- a/patches/server/0865-Don-t-allow-vehicle-movement-from-players-while-tele.patch +++ b/patches/server/0863-Don-t-allow-vehicle-movement-from-players-while-tele.patch @@ -7,10 +7,10 @@ Bring the vehicle move packet behavior in line with the regular player move packet. diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -index 067b18932a39a97cd13b59d43350c1fe7239a3da..55bf584ace138e6df855c011f1fb44dbdc0e7d98 100644 +index e16de9e1cf9c6d5377f7ce434cc737056093e71f..995cf6908108844299e582581a99d195a99df15b 100644 --- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -@@ -588,6 +588,12 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic +@@ -591,6 +591,12 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic } else { Entity entity = this.player.getRootVehicle(); diff --git a/patches/server/0866-Implement-getComputedBiome-API.patch b/patches/server/0864-Implement-getComputedBiome-API.patch similarity index 100% rename from patches/server/0866-Implement-getComputedBiome-API.patch rename to patches/server/0864-Implement-getComputedBiome-API.patch diff --git a/patches/server/0867-Make-some-itemstacks-nonnull.patch b/patches/server/0865-Make-some-itemstacks-nonnull.patch similarity index 100% rename from patches/server/0867-Make-some-itemstacks-nonnull.patch rename to patches/server/0865-Make-some-itemstacks-nonnull.patch diff --git a/patches/server/0868-Add-debug-for-invalid-GameProfiles-on-skull-blocks-i.patch b/patches/server/0866-Add-debug-for-invalid-GameProfiles-on-skull-blocks-i.patch similarity index 100% rename from patches/server/0868-Add-debug-for-invalid-GameProfiles-on-skull-blocks-i.patch rename to patches/server/0866-Add-debug-for-invalid-GameProfiles-on-skull-blocks-i.patch diff --git a/patches/server/0869-Implement-enchantWithLevels-API.patch b/patches/server/0867-Implement-enchantWithLevels-API.patch similarity index 100% rename from patches/server/0869-Implement-enchantWithLevels-API.patch rename to patches/server/0867-Implement-enchantWithLevels-API.patch diff --git a/patches/server/0870-Fix-saving-in-unloadWorld.patch b/patches/server/0868-Fix-saving-in-unloadWorld.patch similarity index 83% rename from patches/server/0870-Fix-saving-in-unloadWorld.patch rename to patches/server/0868-Fix-saving-in-unloadWorld.patch index 68deba0168..1e8c1b11d3 100644 --- a/patches/server/0870-Fix-saving-in-unloadWorld.patch +++ b/patches/server/0868-Fix-saving-in-unloadWorld.patch @@ -6,10 +6,10 @@ Subject: [PATCH] Fix saving in unloadWorld Change savingDisabled to false to ensure ServerLevel's saving logic gets called when unloadWorld is called with save = true diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -index 91ba3684c73bb127d67c6385bf55e71d96f69075..092bbbecfbb7154774befe5952e316f607b4334d 100644 +index 9b24f38406a1017dca430bbaeed4bf4227677972..dc3a0acfd0b4e5210994f5beb59df4351c67af69 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -@@ -1287,7 +1287,7 @@ public final class CraftServer implements Server { +@@ -1289,7 +1289,7 @@ public final class CraftServer implements Server { try { if (save) { diff --git a/patches/server/0871-Buffer-OOB-setBlock-calls.patch b/patches/server/0869-Buffer-OOB-setBlock-calls.patch similarity index 100% rename from patches/server/0871-Buffer-OOB-setBlock-calls.patch rename to patches/server/0869-Buffer-OOB-setBlock-calls.patch diff --git a/patches/server/0872-Add-TameableDeathMessageEvent.patch b/patches/server/0870-Add-TameableDeathMessageEvent.patch similarity index 100% rename from patches/server/0872-Add-TameableDeathMessageEvent.patch rename to patches/server/0870-Add-TameableDeathMessageEvent.patch diff --git a/patches/server/0873-Fix-new-block-data-for-EntityChangeBlockEvent-when-s.patch b/patches/server/0871-Fix-new-block-data-for-EntityChangeBlockEvent-when-s.patch similarity index 100% rename from patches/server/0873-Fix-new-block-data-for-EntityChangeBlockEvent-when-s.patch rename to patches/server/0871-Fix-new-block-data-for-EntityChangeBlockEvent-when-s.patch diff --git a/patches/server/0874-fix-player-loottables-running-when-mob-loot-gamerule.patch b/patches/server/0872-fix-player-loottables-running-when-mob-loot-gamerule.patch similarity index 92% rename from patches/server/0874-fix-player-loottables-running-when-mob-loot-gamerule.patch rename to patches/server/0872-fix-player-loottables-running-when-mob-loot-gamerule.patch index c3b07f6dd8..5030bb2520 100644 --- a/patches/server/0874-fix-player-loottables-running-when-mob-loot-gamerule.patch +++ b/patches/server/0872-fix-player-loottables-running-when-mob-loot-gamerule.patch @@ -5,7 +5,7 @@ Subject: [PATCH] fix player loottables running when mob loot gamerule is false diff --git a/src/main/java/net/minecraft/server/level/ServerPlayer.java b/src/main/java/net/minecraft/server/level/ServerPlayer.java -index 2dae3fe22bad90ba10a21999816b80e28a19ac39..a6e999b7698948564f6b7e1852a87acf389d60d7 100644 +index 18c3d4aecf498f78040c27336d2ea56fd911d034..3f3ebe28c669419091fd20c18185c61712e7f1e8 100644 --- a/src/main/java/net/minecraft/server/level/ServerPlayer.java +++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java @@ -861,12 +861,14 @@ public class ServerPlayer extends Player { diff --git a/patches/server/0875-Ensure-entity-passenger-world-matches-ridden-entity.patch b/patches/server/0873-Ensure-entity-passenger-world-matches-ridden-entity.patch similarity index 100% rename from patches/server/0875-Ensure-entity-passenger-world-matches-ridden-entity.patch rename to patches/server/0873-Ensure-entity-passenger-world-matches-ridden-entity.patch diff --git a/patches/server/0876-Guard-against-invalid-entity-positions.patch b/patches/server/0874-Guard-against-invalid-entity-positions.patch similarity index 100% rename from patches/server/0876-Guard-against-invalid-entity-positions.patch rename to patches/server/0874-Guard-against-invalid-entity-positions.patch diff --git a/patches/server/0877-cache-resource-keys.patch b/patches/server/0875-cache-resource-keys.patch similarity index 100% rename from patches/server/0877-cache-resource-keys.patch rename to patches/server/0875-cache-resource-keys.patch diff --git a/patches/server/0878-Allow-to-change-the-podium-for-the-EnderDragon.patch b/patches/server/0876-Allow-to-change-the-podium-for-the-EnderDragon.patch similarity index 100% rename from patches/server/0878-Allow-to-change-the-podium-for-the-EnderDragon.patch rename to patches/server/0876-Allow-to-change-the-podium-for-the-EnderDragon.patch diff --git a/patches/server/0879-Fix-NBT-pieces-overriding-a-block-entity-during-worl.patch b/patches/server/0877-Fix-NBT-pieces-overriding-a-block-entity-during-worl.patch similarity index 100% rename from patches/server/0879-Fix-NBT-pieces-overriding-a-block-entity-during-worl.patch rename to patches/server/0877-Fix-NBT-pieces-overriding-a-block-entity-during-worl.patch diff --git a/patches/server/0880-Fix-StructureGrowEvent-species-for-RED_MUSHROOM.patch b/patches/server/0878-Fix-StructureGrowEvent-species-for-RED_MUSHROOM.patch similarity index 100% rename from patches/server/0880-Fix-StructureGrowEvent-species-for-RED_MUSHROOM.patch rename to patches/server/0878-Fix-StructureGrowEvent-species-for-RED_MUSHROOM.patch diff --git a/patches/server/0881-Prevent-tile-entity-copies-loading-chunks.patch b/patches/server/0879-Prevent-tile-entity-copies-loading-chunks.patch similarity index 89% rename from patches/server/0881-Prevent-tile-entity-copies-loading-chunks.patch rename to patches/server/0879-Prevent-tile-entity-copies-loading-chunks.patch index 4089d0ecb6..d01f0f5309 100644 --- a/patches/server/0881-Prevent-tile-entity-copies-loading-chunks.patch +++ b/patches/server/0879-Prevent-tile-entity-copies-loading-chunks.patch @@ -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 995cf6908108844299e582581a99d195a99df15b..d35a49294b344f2e5fd22738a259021e72392596 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 +@@ -3419,7 +3419,12 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic BlockPos blockposition = BlockEntity.getPosFromTag(nbttagcompound); if (this.player.level.isLoaded(blockposition)) { diff --git a/patches/server/0882-Use-username-instead-of-display-name-in-PlayerList-g.patch b/patches/server/0880-Use-username-instead-of-display-name-in-PlayerList-g.patch similarity index 87% rename from patches/server/0882-Use-username-instead-of-display-name-in-PlayerList-g.patch rename to patches/server/0880-Use-username-instead-of-display-name-in-PlayerList-g.patch index 8db22afe38..5e03552681 100644 --- a/patches/server/0882-Use-username-instead-of-display-name-in-PlayerList-g.patch +++ b/patches/server/0880-Use-username-instead-of-display-name-in-PlayerList-g.patch @@ -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 e1a5bd0ce00926078a0d2235b05e5972093044ab..71623c84a5b15023189c14a6bf36e1b08f935fc1 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(); diff --git a/patches/server/0883-Fix-slime-spawners-not-spawning-outside-slime-chunks.patch b/patches/server/0881-Fix-slime-spawners-not-spawning-outside-slime-chunks.patch similarity index 100% rename from patches/server/0883-Fix-slime-spawners-not-spawning-outside-slime-chunks.patch rename to patches/server/0881-Fix-slime-spawners-not-spawning-outside-slime-chunks.patch diff --git a/patches/server/0884-Pass-ServerLevel-for-gamerule-callbacks.patch b/patches/server/0882-Pass-ServerLevel-for-gamerule-callbacks.patch similarity index 98% rename from patches/server/0884-Pass-ServerLevel-for-gamerule-callbacks.patch rename to patches/server/0882-Pass-ServerLevel-for-gamerule-callbacks.patch index dc49d0e1dc..049470071a 100644 --- a/patches/server/0884-Pass-ServerLevel-for-gamerule-callbacks.patch +++ b/patches/server/0882-Pass-ServerLevel-for-gamerule-callbacks.patch @@ -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 d35a49294b344f2e5fd22738a259021e72392596..f047f1027c5556b4dd7fe51875f075b3ba515c7f 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 +@@ -3015,7 +3015,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 diff --git a/patches/server/0885-Add-pre-unbreaking-amount-to-PlayerItemDamageEvent.patch b/patches/server/0883-Add-pre-unbreaking-amount-to-PlayerItemDamageEvent.patch similarity index 100% rename from patches/server/0885-Add-pre-unbreaking-amount-to-PlayerItemDamageEvent.patch rename to patches/server/0883-Add-pre-unbreaking-amount-to-PlayerItemDamageEvent.patch diff --git a/patches/server/0886-WorldCreator-keepSpawnLoaded.patch b/patches/server/0884-WorldCreator-keepSpawnLoaded.patch similarity index 84% rename from patches/server/0886-WorldCreator-keepSpawnLoaded.patch rename to patches/server/0884-WorldCreator-keepSpawnLoaded.patch index 0bc5d393e7..39ab6f7b35 100644 --- a/patches/server/0886-WorldCreator-keepSpawnLoaded.patch +++ b/patches/server/0884-WorldCreator-keepSpawnLoaded.patch @@ -5,10 +5,10 @@ Subject: [PATCH] WorldCreator#keepSpawnLoaded diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -index 092bbbecfbb7154774befe5952e316f607b4334d..bf19acd9587cd9c3da50aba5ede60708652f0d33 100644 +index dc3a0acfd0b4e5210994f5beb59df4351c67af69..eaf51d2b6ad149e19585e6cf600dddbf4bb3e68b 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -@@ -1246,6 +1246,7 @@ public final class CraftServer implements Server { +@@ -1248,6 +1248,7 @@ public final class CraftServer implements Server { internal.setSpawnSettings(true, true); // Paper - move up diff --git a/patches/server/0887-Fix-NPE-for-BlockDataMeta-getBlockData.patch b/patches/server/0885-Fix-NPE-for-BlockDataMeta-getBlockData.patch similarity index 100% rename from patches/server/0887-Fix-NPE-for-BlockDataMeta-getBlockData.patch rename to patches/server/0885-Fix-NPE-for-BlockDataMeta-getBlockData.patch diff --git a/patches/server/0888-Trigger-bee_nest_destroyed-trigger-in-the-correct-pl.patch b/patches/server/0886-Trigger-bee_nest_destroyed-trigger-in-the-correct-pl.patch similarity index 100% rename from patches/server/0888-Trigger-bee_nest_destroyed-trigger-in-the-correct-pl.patch rename to patches/server/0886-Trigger-bee_nest_destroyed-trigger-in-the-correct-pl.patch diff --git a/patches/server/0889-Add-EntityDyeEvent-and-CollarColorable-interface.patch b/patches/server/0887-Add-EntityDyeEvent-and-CollarColorable-interface.patch similarity index 100% rename from patches/server/0889-Add-EntityDyeEvent-and-CollarColorable-interface.patch rename to patches/server/0887-Add-EntityDyeEvent-and-CollarColorable-interface.patch diff --git a/patches/server/0890-Fire-CauldronLevelChange-on-initial-fill.patch b/patches/server/0888-Fire-CauldronLevelChange-on-initial-fill.patch similarity index 100% rename from patches/server/0890-Fire-CauldronLevelChange-on-initial-fill.patch rename to patches/server/0888-Fire-CauldronLevelChange-on-initial-fill.patch diff --git a/patches/server/0891-fix-powder-snow-cauldrons-not-turning-to-water.patch b/patches/server/0889-fix-powder-snow-cauldrons-not-turning-to-water.patch similarity index 100% rename from patches/server/0891-fix-powder-snow-cauldrons-not-turning-to-water.patch rename to patches/server/0889-fix-powder-snow-cauldrons-not-turning-to-water.patch diff --git a/patches/server/0892-Add-PlayerStopUsingItemEvent.patch b/patches/server/0890-Add-PlayerStopUsingItemEvent.patch similarity index 100% rename from patches/server/0892-Add-PlayerStopUsingItemEvent.patch rename to patches/server/0890-Add-PlayerStopUsingItemEvent.patch diff --git a/patches/server/0893-FallingBlock-auto-expire-setting.patch b/patches/server/0891-FallingBlock-auto-expire-setting.patch similarity index 100% rename from patches/server/0893-FallingBlock-auto-expire-setting.patch rename to patches/server/0891-FallingBlock-auto-expire-setting.patch diff --git a/patches/server/0894-Don-t-tick-markers.patch b/patches/server/0892-Don-t-tick-markers.patch similarity index 95% rename from patches/server/0894-Don-t-tick-markers.patch rename to patches/server/0892-Don-t-tick-markers.patch index 848b3dc5fb..12f235cffe 100644 --- a/patches/server/0894-Don-t-tick-markers.patch +++ b/patches/server/0892-Don-t-tick-markers.patch @@ -34,10 +34,10 @@ index 802b929a16b6a8aeee608caeb524e268f8df53bd..5b3a7626579ff6bcf3ad32f7193bf905 ServerLevel.this.entityManager.addNavigatorsIfPathingToRegion(entity); // Paper - optimise notify } diff --git a/src/main/java/org/spigotmc/ActivationRange.java b/src/main/java/org/spigotmc/ActivationRange.java -index 5bffc9a0f6ef9d54abb359565d07509b177c2b82..1a1a1f4d0ac025daccc2d3f84faf6592819f4d5c 100644 +index b1ed97618d08d7691d24f89e9e9b0ed0f2bddd09..40b382c2e0e33fe5c24a51b211cd2f9557a60c5e 100644 --- a/src/main/java/org/spigotmc/ActivationRange.java +++ b/src/main/java/org/spigotmc/ActivationRange.java -@@ -211,7 +211,7 @@ public class ActivationRange +@@ -212,7 +212,7 @@ public class ActivationRange // Paper end // Paper start diff --git a/patches/server/0895-Do-not-accept-invalid-client-settings.patch b/patches/server/0893-Do-not-accept-invalid-client-settings.patch similarity index 88% rename from patches/server/0895-Do-not-accept-invalid-client-settings.patch rename to patches/server/0893-Do-not-accept-invalid-client-settings.patch index fdd6c23cb1..e45f545882 100644 --- a/patches/server/0895-Do-not-accept-invalid-client-settings.patch +++ b/patches/server/0893-Do-not-accept-invalid-client-settings.patch @@ -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 f047f1027c5556b4dd7fe51875f075b3ba515c7f..82230f8f4e7f5287fe7f2da9ad5ad7d86ff28782 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 +@@ -3598,6 +3598,13 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic @Override public void handleClientInformation(ServerboundClientInformationPacket packet) { PacketUtils.ensureRunningOnSameThread(packet, this, this.player.getLevel()); diff --git a/patches/server/0896-Add-support-for-Proxy-Protocol.patch b/patches/server/0894-Add-support-for-Proxy-Protocol.patch similarity index 100% rename from patches/server/0896-Add-support-for-Proxy-Protocol.patch rename to patches/server/0894-Add-support-for-Proxy-Protocol.patch diff --git a/patches/server/0897-Fix-OfflinePlayer-getBedSpawnLocation.patch b/patches/server/0895-Fix-OfflinePlayer-getBedSpawnLocation.patch similarity index 100% rename from patches/server/0897-Fix-OfflinePlayer-getBedSpawnLocation.patch rename to patches/server/0895-Fix-OfflinePlayer-getBedSpawnLocation.patch diff --git a/patches/server/0898-Fix-FurnaceInventory-for-smokers-and-blast-furnaces.patch b/patches/server/0896-Fix-FurnaceInventory-for-smokers-and-blast-furnaces.patch similarity index 100% rename from patches/server/0898-Fix-FurnaceInventory-for-smokers-and-blast-furnaces.patch rename to patches/server/0896-Fix-FurnaceInventory-for-smokers-and-blast-furnaces.patch diff --git a/patches/server/0899-Sanitize-Sent-BlockEntity-NBT.patch b/patches/server/0897-Sanitize-Sent-BlockEntity-NBT.patch similarity index 100% rename from patches/server/0899-Sanitize-Sent-BlockEntity-NBT.patch rename to patches/server/0897-Sanitize-Sent-BlockEntity-NBT.patch diff --git a/patches/server/0900-Prevent-entity-loading-causing-async-lookups.patch b/patches/server/0898-Prevent-entity-loading-causing-async-lookups.patch similarity index 100% rename from patches/server/0900-Prevent-entity-loading-causing-async-lookups.patch rename to patches/server/0898-Prevent-entity-loading-causing-async-lookups.patch diff --git a/patches/server/0901-Disable-component-selector-resolving-in-books-by-def.patch b/patches/server/0899-Disable-component-selector-resolving-in-books-by-def.patch similarity index 96% rename from patches/server/0901-Disable-component-selector-resolving-in-books-by-def.patch rename to patches/server/0899-Disable-component-selector-resolving-in-books-by-def.patch index d79b7fb1b1..72862c20c5 100644 --- a/patches/server/0901-Disable-component-selector-resolving-in-books-by-def.patch +++ b/patches/server/0899-Disable-component-selector-resolving-in-books-by-def.patch @@ -1,5 +1,5 @@ From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: Nassim Jahnke +From: Nassim Jahnke Date: Thu, 2 Jun 2022 20:35:58 +0200 Subject: [PATCH] Disable component selector resolving in books by default diff --git a/patches/server/0902-Throw-exception-on-world-create-while-being-ticked.patch b/patches/server/0900-Throw-exception-on-world-create-while-being-ticked.patch similarity index 82% rename from patches/server/0902-Throw-exception-on-world-create-while-being-ticked.patch rename to patches/server/0900-Throw-exception-on-world-create-while-being-ticked.patch index 04a443d1d1..978f8d8459 100644 --- a/patches/server/0902-Throw-exception-on-world-create-while-being-ticked.patch +++ b/patches/server/0900-Throw-exception-on-world-create-while-being-ticked.patch @@ -7,7 +7,7 @@ There are no plans to support creating worlds while worlds are being ticked themselvess. diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index ad9609ccb33bbe9bdda94a50900258ad3e0339f0..6a81076239080ae6457308ca2e3628c3d32691bf 100644 +index 4d920031300a9801debc2eb39a4d3cb9d8fbb330..dd9ab51e904be2f2f2a2981d4f0f6638a6895e8d 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java @@ -297,6 +297,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop S spin(Function serverFactory) { AtomicReference atomicreference = new AtomicReference(); -@@ -1526,6 +1527,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop 0; // Paper -@@ -1573,6 +1575,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop void getEntitiesByClass(Class clazz, Entity except, AABB box, List into, Predicate predicate) {} ++ ++ @Override ++ public void scheduleTick(BlockPos pos, Fluid fluid, int delay) { ++ } ++ ++ @Override ++ public void scheduleTick(BlockPos pos, Block block, int delay, net.minecraft.world.ticks.TickPriority priority) { ++ } ++ ++ @Override ++ public void scheduleTick(BlockPos pos, Fluid fluid, int delay, net.minecraft.world.ticks.TickPriority priority) { ++ } + // Paper end + } diff --git a/patches/server/0909-Nameable-Banner-API.patch b/patches/server/0907-Nameable-Banner-API.patch similarity index 100% rename from patches/server/0909-Nameable-Banner-API.patch rename to patches/server/0907-Nameable-Banner-API.patch diff --git a/patches/server/0910-Don-t-broadcast-messages-to-command-blocks.patch b/patches/server/0908-Don-t-broadcast-messages-to-command-blocks.patch similarity index 92% rename from patches/server/0910-Don-t-broadcast-messages-to-command-blocks.patch rename to patches/server/0908-Don-t-broadcast-messages-to-command-blocks.patch index f27d75afb1..c9e7cd98d6 100644 --- a/patches/server/0910-Don-t-broadcast-messages-to-command-blocks.patch +++ b/patches/server/0908-Don-t-broadcast-messages-to-command-blocks.patch @@ -20,10 +20,10 @@ index c0195f73cd2c8721e882c681eaead65471710081..861b348f73867af3199f1cc0dab1ddd4 Date date = new Date(); diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -index e38a56460ff6c6b04ded3a544a27161ba5ab44d8..bfde5bbcccfaa754ec6bdf4f3817981a93e465bd 100644 +index 051899f6f6bb656a836045ee36e6a2afe83f34f6..32eb6efa94bc5ea3b516cbbd7e53f1460c23154d 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -@@ -1756,7 +1756,7 @@ public final class CraftServer implements Server { +@@ -1758,7 +1758,7 @@ public final class CraftServer implements Server { // Paper end Set recipients = new HashSet<>(); for (Permissible permissible : this.getPluginManager().getPermissionSubscriptions(permission)) { diff --git a/patches/server/0911-Prevent-empty-items-from-being-added-to-world.patch b/patches/server/0909-Prevent-empty-items-from-being-added-to-world.patch similarity index 100% rename from patches/server/0911-Prevent-empty-items-from-being-added-to-world.patch rename to patches/server/0909-Prevent-empty-items-from-being-added-to-world.patch diff --git a/patches/server/0912-Fix-CCE-for-SplashPotion-and-LingeringPotion-spawnin.patch b/patches/server/0910-Fix-CCE-for-SplashPotion-and-LingeringPotion-spawnin.patch similarity index 67% rename from patches/server/0912-Fix-CCE-for-SplashPotion-and-LingeringPotion-spawnin.patch rename to patches/server/0910-Fix-CCE-for-SplashPotion-and-LingeringPotion-spawnin.patch index a14591f9b1..ad894dbcce 100644 --- a/patches/server/0912-Fix-CCE-for-SplashPotion-and-LingeringPotion-spawnin.patch +++ b/patches/server/0910-Fix-CCE-for-SplashPotion-and-LingeringPotion-spawnin.patch @@ -7,15 +7,15 @@ Remove in 1.19 along with the SplashPotion and LingeringPotion interfaces diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftThrownPotion.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftThrownPotion.java -index c1594f62c06a49ba2d0c2c6e6befcda7d1fe6e1b..793d12cd7f2782cb412535fa7ec8ae9f57c082b0 100644 +index 397e0df15a0e64e5bc522f62f3b327a5039ec4c8..a926f4dc51821a05c28872dc90ad000fe8cb51f7 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftThrownPotion.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftThrownPotion.java @@ -14,7 +14,7 @@ import org.bukkit.entity.ThrownPotion; import org.bukkit.inventory.ItemStack; import org.bukkit.potion.PotionEffect; --public class CraftThrownPotion extends CraftProjectile implements ThrownPotion { -+public class CraftThrownPotion extends CraftProjectile implements ThrownPotion, org.bukkit.entity.SplashPotion, org.bukkit.entity.LingeringPotion { // Paper - implement other classes to avoid violating spawn method generic contracts +-public class CraftThrownPotion extends CraftThrowableProjectile implements ThrownPotion { ++public class CraftThrownPotion extends CraftThrowableProjectile implements ThrownPotion, org.bukkit.entity.SplashPotion, org.bukkit.entity.LingeringPotion { // Paper - implement other classes to avoid violating spawn method generic contracts public CraftThrownPotion(CraftServer server, net.minecraft.world.entity.projectile.ThrownPotion entity) { super(server, entity); } diff --git a/patches/server/0913-Don-t-print-component-in-resource-pack-rejection-mes.patch b/patches/server/0911-Don-t-print-component-in-resource-pack-rejection-mes.patch similarity index 90% rename from patches/server/0913-Don-t-print-component-in-resource-pack-rejection-mes.patch rename to patches/server/0911-Don-t-print-component-in-resource-pack-rejection-mes.patch index b2676ad18a..683453db46 100644 --- a/patches/server/0913-Don-t-print-component-in-resource-pack-rejection-mes.patch +++ b/patches/server/0911-Don-t-print-component-in-resource-pack-rejection-mes.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Don't print component in resource pack rejection message diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -index a54ea66d2c85fc82075bb8c27b34e2d1407e8375..c00443e73cd31f79679f8e4ba45a6f551349bb85 100644 +index 82230f8f4e7f5287fe7f2da9ad5ad7d86ff28782..9f5879498999ad421cec055eaf3b031a4e10b1fc 100644 --- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -@@ -2047,7 +2047,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic +@@ -2054,7 +2054,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic public void handleResourcePackResponse(ServerboundResourcePackPacket packet) { PacketUtils.ensureRunningOnSameThread(packet, this, this.player.getLevel()); if (packet.getAction() == ServerboundResourcePackPacket.Action.DECLINED && this.server.isResourcePackRequired()) { diff --git a/patches/server/0914-Add-Player-getFishHook.patch b/patches/server/0912-Add-Player-getFishHook.patch similarity index 100% rename from patches/server/0914-Add-Player-getFishHook.patch rename to patches/server/0912-Add-Player-getFishHook.patch diff --git a/patches/server/0915-Do-not-sync-load-chunk-for-dynamic-game-event-listen.patch b/patches/server/0913-Do-not-sync-load-chunk-for-dynamic-game-event-listen.patch similarity index 100% rename from patches/server/0915-Do-not-sync-load-chunk-for-dynamic-game-event-listen.patch rename to patches/server/0913-Do-not-sync-load-chunk-for-dynamic-game-event-listen.patch diff --git a/patches/server/0916-Add-various-missing-EntityDropItemEvent-calls.patch b/patches/server/0914-Add-various-missing-EntityDropItemEvent-calls.patch similarity index 100% rename from patches/server/0916-Add-various-missing-EntityDropItemEvent-calls.patch rename to patches/server/0914-Add-various-missing-EntityDropItemEvent-calls.patch diff --git a/patches/server/0917-Add-some-minimal-debug-information-to-chat-packet-er.patch b/patches/server/0915-Add-some-minimal-debug-information-to-chat-packet-er.patch similarity index 63% rename from patches/server/0917-Add-some-minimal-debug-information-to-chat-packet-er.patch rename to patches/server/0915-Add-some-minimal-debug-information-to-chat-packet-er.patch index b3f5f35dd0..dcf893dfdf 100644 --- a/patches/server/0917-Add-some-minimal-debug-information-to-chat-packet-er.patch +++ b/patches/server/0915-Add-some-minimal-debug-information-to-chat-packet-er.patch @@ -6,10 +6,10 @@ 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 9f5879498999ad421cec055eaf3b031a4e10b1fc..421f8d21f3edb65b42bf7228989bd95877976e06 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 +@@ -2303,7 +2303,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic private boolean tryHandleChat(String message, Instant timestamp, LastSeenMessages.Update acknowledgment) { if (!this.updateChatOrder(timestamp)) { @@ -18,12 +18,12 @@ 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 - return false; - } else { - if (message.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? c: {} s: {}", this.player.getName().getString(), message.signedContent().plain(), message.timeStamp().getEpochSecond(), Instant.now().getEpochSecond()); // Paper - } +@@ -2571,7 +2571,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic + } - return true; + if (playerchatmessage.hasExpiredServer(Instant.now())) { +- 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(), playerchatmessage.signedContent().plain(), playerchatmessage.timeStamp().getEpochSecond(), Instant.now().getEpochSecond()); // Paper + } + + return true; diff --git a/patches/server/0918-Fix-Bee-flower-NPE.patch b/patches/server/0916-Fix-Bee-flower-NPE.patch similarity index 100% rename from patches/server/0918-Fix-Bee-flower-NPE.patch rename to patches/server/0916-Fix-Bee-flower-NPE.patch diff --git a/patches/server/0919-Fix-Spigot-Config-not-using-commands.spam-exclusions.patch b/patches/server/0917-Fix-Spigot-Config-not-using-commands.spam-exclusions.patch similarity index 87% rename from patches/server/0919-Fix-Spigot-Config-not-using-commands.spam-exclusions.patch rename to patches/server/0917-Fix-Spigot-Config-not-using-commands.spam-exclusions.patch index 9d90007654..124437ae77 100644 --- a/patches/server/0919-Fix-Spigot-Config-not-using-commands.spam-exclusions.patch +++ b/patches/server/0917-Fix-Spigot-Config-not-using-commands.spam-exclusions.patch @@ -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 421f8d21f3edb65b42bf7228989bd95877976e06..e2197e11f8ec49495802f7d265709d716bc0524c 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 +@@ -2591,7 +2591,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic } // Spigot end // this.chatSpamTickCount += 20; diff --git a/patches/server/0920-Add-SpawnReason-to-Tadpoles-spawned-by-Frogspawn.patch b/patches/server/0918-Add-SpawnReason-to-Tadpoles-spawned-by-Frogspawn.patch similarity index 100% rename from patches/server/0920-Add-SpawnReason-to-Tadpoles-spawned-by-Frogspawn.patch rename to patches/server/0918-Add-SpawnReason-to-Tadpoles-spawned-by-Frogspawn.patch diff --git a/patches/server/0921-More-Teleport-API.patch b/patches/server/0919-More-Teleport-API.patch similarity index 97% rename from patches/server/0921-More-Teleport-API.patch rename to patches/server/0919-More-Teleport-API.patch index 696990e8f7..e3daa5b396 100644 --- a/patches/server/0921-More-Teleport-API.patch +++ b/patches/server/0919-More-Teleport-API.patch @@ -5,10 +5,10 @@ Subject: [PATCH] More Teleport API diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -index 72864ca3f0fa94512d7f57b4e05929be7d2912cd..2fe2336a9dd307dbd92cbf9472ffe698515f5ee9 100644 +index e2197e11f8ec49495802f7d265709d716bc0524c..ad6ae4a8c9e5af5f75d796add202bd8b2dec701a 100644 --- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -@@ -1728,11 +1728,17 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic +@@ -1735,11 +1735,17 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic return false; // CraftBukkit - Return event status } @@ -69,7 +69,7 @@ index 2a6c67634c31c332102d24bef293da1bacd0c000..b80cc0938b2b3928f4450f1314a9fbd7 // Let the server handle cross world teleports if (location.getWorld() != null && !location.getWorld().equals(this.getWorld())) { diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -index f74802748438f4d40fb5ab772a209dfb2ee406e6..d2249145046d728240cf1ae0b71c9ec16184bc18 100644 +index 77339926519057b1c878761780ff2d6621f5ccb7..6f0ffd1895a9c392b643f3595e709ec3706c39b4 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java @@ -1135,7 +1135,15 @@ public class CraftPlayer extends CraftHumanEntity implements Player { diff --git a/patches/server/0922-Add-EntityPortalReadyEvent.patch b/patches/server/0920-Add-EntityPortalReadyEvent.patch similarity index 100% rename from patches/server/0922-Add-EntityPortalReadyEvent.patch rename to patches/server/0920-Add-EntityPortalReadyEvent.patch diff --git a/patches/server/0923-Don-t-use-level-random-in-entity-constructors.patch b/patches/server/0921-Don-t-use-level-random-in-entity-constructors.patch similarity index 100% rename from patches/server/0923-Don-t-use-level-random-in-entity-constructors.patch rename to patches/server/0921-Don-t-use-level-random-in-entity-constructors.patch diff --git a/patches/server/0922-Send-block-entities-after-destroy-prediction.patch b/patches/server/0922-Send-block-entities-after-destroy-prediction.patch new file mode 100644 index 0000000000..66eaf9d3a9 --- /dev/null +++ b/patches/server/0922-Send-block-entities-after-destroy-prediction.patch @@ -0,0 +1,91 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Owen1212055 <23108066+Owen1212055@users.noreply.github.com> +Date: Sat, 25 Jun 2022 19:45:20 -0400 +Subject: [PATCH] Send block entities after destroy prediction + +Minecraft's prediction system does not handle block entities, so if we are manually sending block entities during +block breaking we need to set it after the prediction is finished. This fixes block entities not showing when cancelling the BlockBreakEvent. + +diff --git a/src/main/java/net/minecraft/server/level/ServerPlayerGameMode.java b/src/main/java/net/minecraft/server/level/ServerPlayerGameMode.java +index 9378e83a67a70dbb1fb4f05b33f1e553d008e62b..5a60f5dc202c44b06ca34e9a19d45cb715f74fd3 100644 +--- a/src/main/java/net/minecraft/server/level/ServerPlayerGameMode.java ++++ b/src/main/java/net/minecraft/server/level/ServerPlayerGameMode.java +@@ -62,6 +62,8 @@ public class ServerPlayerGameMode { + private BlockPos delayedDestroyPos; + private int delayedTickStart; + private int lastSentState; ++ public boolean captureSentBlockEntities = false; // Paper ++ public boolean capturedBlockEntity = false; // Paper + + public ServerPlayerGameMode(ServerPlayer player) { + this.gameModeForPlayer = GameType.DEFAULT_MODE; +@@ -187,10 +189,7 @@ public class ServerPlayerGameMode { + this.player.connection.send(new ClientboundBlockUpdatePacket(pos, this.level.getBlockState(pos))); + this.debugLogging(pos, false, sequence, "may not interact"); + // Update any tile entity data for this block +- BlockEntity tileentity = this.level.getBlockEntity(pos); +- if (tileentity != null) { +- this.player.connection.send(tileentity.getUpdatePacket()); +- } ++ capturedBlockEntity = true; // Paper - send block entity after predicting + // CraftBukkit end + return; + } +@@ -206,10 +205,7 @@ public class ServerPlayerGameMode { + // Paper end + this.player.connection.send(new ClientboundBlockUpdatePacket(this.level, pos)); + // Update any tile entity data for this block +- BlockEntity tileentity = this.level.getBlockEntity(pos); +- if (tileentity != null) { +- this.player.connection.send(tileentity.getUpdatePacket()); +- } ++ capturedBlockEntity = true; // Paper - send block entity after predicting + return; + } + // CraftBukkit end +@@ -385,10 +381,12 @@ public class ServerPlayerGameMode { + } + + // Update any tile entity data for this block ++ if (!captureSentBlockEntities) { // Paper - Toggle this location for capturing as this is used for api + BlockEntity tileentity = this.level.getBlockEntity(pos); + if (tileentity != null) { + this.player.connection.send(tileentity.getUpdatePacket()); + } ++ } else {capturedBlockEntity = true;} // Paper end + return false; + } + } +diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +index ad6ae4a8c9e5af5f75d796add202bd8b2dec701a..d030574fbd282c018898b64b6ced9749f54cb813 100644 +--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java ++++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +@@ -1880,8 +1880,28 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic + return; + } + // Paper end - Don't allow digging in unloaded chunks ++ // Paper start - send block entities after prediction ++ this.player.gameMode.capturedBlockEntity = false; ++ this.player.gameMode.captureSentBlockEntities = true; ++ // Paper end - send block entities after prediction + this.player.gameMode.handleBlockBreakAction(blockposition, packetplayinblockdig_enumplayerdigtype, packet.getDirection(), this.player.level.getMaxBuildHeight(), packet.getSequence()); + this.player.connection.ackBlockChangesUpTo(packet.getSequence()); ++ // Paper start - send block entities after prediction ++ this.player.gameMode.captureSentBlockEntities = false; ++ // If a block entity was modified speedup the block change ack to avoid the block entity ++ // being overriden. ++ if (this.player.gameMode.capturedBlockEntity) { ++ // manually tick ++ this.send(new ClientboundBlockChangedAckPacket(this.ackBlockChangesUpTo)); ++ this.player.connection.ackBlockChangesUpTo = -1; ++ ++ this.player.gameMode.capturedBlockEntity = false; ++ BlockEntity tileentity = this.player.level.getBlockEntity(blockposition); ++ if (tileentity != null) { ++ this.player.connection.send(tileentity.getUpdatePacket()); ++ } ++ } ++ // Paper end - send block entities after prediction + return; + default: + throw new IllegalArgumentException("Invalid player action"); diff --git a/patches/server/0923-Warn-on-plugins-accessing-faraway-chunks.patch b/patches/server/0923-Warn-on-plugins-accessing-faraway-chunks.patch new file mode 100644 index 0000000000..069ec6a90b --- /dev/null +++ b/patches/server/0923-Warn-on-plugins-accessing-faraway-chunks.patch @@ -0,0 +1,96 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Owen1212055 <23108066+Owen1212055@users.noreply.github.com> +Date: Fri, 29 Jul 2022 12:35:19 -0400 +Subject: [PATCH] Warn on plugins accessing faraway chunks + + +diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java +index 9467ccaa1d73e1913495a46919aee530e749977d..5a2a1d394852d39ea576624586f7fa736dec807c 100644 +--- a/src/main/java/net/minecraft/world/level/Level.java ++++ b/src/main/java/net/minecraft/world/level/Level.java +@@ -418,7 +418,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable { + } + + private static boolean isInWorldBoundsHorizontal(BlockPos pos) { +- return pos.getX() >= -30000000 && pos.getZ() >= -30000000 && pos.getX() < 30000000 && pos.getZ() < 30000000; ++ return pos.getX() >= -30000000 && pos.getZ() >= -30000000 && pos.getX() < 30000000 && pos.getZ() < 30000000; // Dif on change + } + + private static boolean isOutsideSpawnableHeight(int y) { +diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java +index a5d8dfc77475845be7c6d37eed04fb19eeef1c0c..f0b14914438840bd819fa7da8b76f4fcc13704d0 100644 +--- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java ++++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java +@@ -314,9 +314,24 @@ public class CraftWorld extends CraftRegionAccessor implements World { + public boolean setSpawnLocation(int x, int y, int z) { + return this.setSpawnLocation(x, y, z, 0.0F); + } ++ // Paper start ++ private static void warnUnsafeChunk(String reason, int x, int z) { ++ // if any chunk coord is outside of 30 million blocks ++ if (x > 1875000 || z > 1875000 || x < -1875000 || z < -1875000) { ++ Plugin plugin = io.papermc.paper.util.StackWalkerUtil.getFirstPluginCaller(); ++ if (plugin != null) { ++ plugin.getLogger().warning("Plugin is %s at (%s, %s), this might cause issues.".formatted(reason, x, z)); ++ } ++ if (net.minecraft.server.MinecraftServer.getServer().isDebugging()) { ++ io.papermc.paper.util.TraceUtil.dumpTraceForThread("Dangerous chunk retrieval"); ++ } ++ } ++ } ++ // Paper end + + @Override + public Chunk getChunkAt(int x, int z) { ++ warnUnsafeChunk("getting a faraway chunk", x, z); // Paper + // Paper start - add ticket to hold chunk for a little while longer if plugin accesses it + net.minecraft.world.level.chunk.LevelChunk chunk = world.getChunkSource().getChunkAtIfLoadedImmediately(x, z); + if (chunk == null) { +@@ -432,6 +447,7 @@ public class CraftWorld extends CraftRegionAccessor implements World { + @Override + public boolean regenerateChunk(int x, int z) { + org.spigotmc.AsyncCatcher.catchOp("chunk regenerate"); // Spigot ++ warnUnsafeChunk("regenerating a faraway chunk", x, z); // Paper + // Paper start - implement regenerateChunk method + final ServerLevel serverLevel = this.world; + final net.minecraft.server.level.ServerChunkCache serverChunkCache = serverLevel.getChunkSource(); +@@ -525,6 +541,7 @@ public class CraftWorld extends CraftRegionAccessor implements World { + @Override + public boolean loadChunk(int x, int z, boolean generate) { + org.spigotmc.AsyncCatcher.catchOp("chunk load"); // Spigot ++ warnUnsafeChunk("loading a faraway chunk", x, z); // Paper + // Paper start - Optimize this method + ChunkPos chunkPos = new ChunkPos(x, z); + ChunkAccess immediate = world.getChunkSource().getChunkAtIfLoadedImmediately(x, z); // Paper +@@ -589,6 +606,7 @@ public class CraftWorld extends CraftRegionAccessor implements World { + + @Override + public boolean addPluginChunkTicket(int x, int z, Plugin plugin) { ++ warnUnsafeChunk("adding a faraway chunk ticket", x, z); // Paper + Preconditions.checkArgument(plugin != null, "null plugin"); + Preconditions.checkArgument(plugin.isEnabled(), "plugin is not enabled"); + +@@ -670,6 +688,7 @@ public class CraftWorld extends CraftRegionAccessor implements World { + + @Override + public void setChunkForceLoaded(int x, int z, boolean forced) { ++ warnUnsafeChunk("forceloading a faraway chunk", x, z); // Paper + this.getHandle().setChunkForced(x, z, forced); + } + +@@ -981,6 +1000,7 @@ public class CraftWorld extends CraftRegionAccessor implements World { + + @Override + public int getHighestBlockYAt(int x, int z, org.bukkit.HeightMap heightMap) { ++ warnUnsafeChunk("getting a faraway chunk", x >> 4, z >> 4); // Paper + // Transient load for this tick + return this.world.getChunk(x >> 4, z >> 4).getHeight(CraftHeightMap.toNMS(heightMap), x, z); + } +@@ -2238,6 +2258,7 @@ public class CraftWorld extends CraftRegionAccessor implements World { + // Paper start + @Override + public java.util.concurrent.CompletableFuture getChunkAtAsync(int x, int z, boolean gen, boolean urgent) { ++ warnUnsafeChunk("getting a faraway chunk async", x, z); // Paper + if (Bukkit.isPrimaryThread()) { + net.minecraft.world.level.chunk.LevelChunk immediate = this.world.getChunkSource().getChunkAtIfLoadedImmediately(x, z); + if (immediate != null) { diff --git a/patches/server/0924-Custom-Chat-Completion-Suggestions-API.patch b/patches/server/0924-Custom-Chat-Completion-Suggestions-API.patch new file mode 100644 index 0000000000..560a26bd5c --- /dev/null +++ b/patches/server/0924-Custom-Chat-Completion-Suggestions-API.patch @@ -0,0 +1,33 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Owen1212055 <23108066+Owen1212055@users.noreply.github.com> +Date: Sat, 30 Jul 2022 11:23:05 -0400 +Subject: [PATCH] Custom Chat Completion Suggestions API + + +diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +index e6411d8293c36f41b790cf17ecc507507f04d604..743b6e51817ffa1b7e602b1ac82eb1017841b691 100644 +--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java ++++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +@@ -654,6 +654,22 @@ public class CraftPlayer extends CraftHumanEntity implements Player { + + this.getHandle().getServer().getPlayerList().sendPlayerPermissionLevel(this.getHandle(), level, false); + } ++ ++ @Override ++ public void addAdditionalChatCompletions(@NotNull Collection completions) { ++ this.getHandle().connection.send(new net.minecraft.network.protocol.game.ClientboundCustomChatCompletionsPacket( ++ net.minecraft.network.protocol.game.ClientboundCustomChatCompletionsPacket.Action.ADD, ++ new ArrayList<>(completions) ++ )); ++ } ++ ++ @Override ++ public void removeAdditionalChatCompletions(@NotNull Collection completions) { ++ this.getHandle().connection.send(new net.minecraft.network.protocol.game.ClientboundCustomChatCompletionsPacket( ++ net.minecraft.network.protocol.game.ClientboundCustomChatCompletionsPacket.Action.REMOVE, ++ new ArrayList<>(completions) ++ )); ++ } + // Paper end + + @Override diff --git a/patches/server/0924-Dont-fire-preview-event-for-console.patch b/patches/server/0924-Dont-fire-preview-event-for-console.patch deleted file mode 100644 index a693965b23..0000000000 --- a/patches/server/0924-Dont-fire-preview-event-for-console.patch +++ /dev/null @@ -1,22 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: Nassim Jahnke -Date: Thu, 28 Jul 2022 01:57:24 +0200 -Subject: [PATCH] Dont fire preview event for console - - -diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index 6a81076239080ae6457308ca2e3628c3d32691bf..e7d1ccffd4b783518a7b200d440f6f12f2ed0c86 100644 ---- a/src/main/java/net/minecraft/server/MinecraftServer.java -+++ b/src/main/java/net/minecraft/server/MinecraftServer.java -@@ -2600,6 +2600,11 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop { -+ // Paper start - fix non-player sender -+ if (entityplayer == null) { -+ return CompletableFuture.completedFuture(ichatbasecomponent); -+ } -+ // Paper end - return CompletableFuture.supplyAsync(() -> { - AsyncPlayerChatPreviewEvent event = new AsyncPlayerChatPreviewEvent(true, entityplayer.getBukkitEntity(), CraftChatMessage.fromComponent(ichatbasecomponent), new LazyPlayerSet(this)); - String originalFormat = event.getFormat(), originalMessage = event.getMessage(); diff --git a/patches/server/0925-Add-missing-BlockFadeEvents.patch b/patches/server/0925-Add-missing-BlockFadeEvents.patch new file mode 100644 index 0000000000..6b887deccf --- /dev/null +++ b/patches/server/0925-Add-missing-BlockFadeEvents.patch @@ -0,0 +1,22 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Owen1212055 <23108066+Owen1212055@users.noreply.github.com> +Date: Thu, 21 Jul 2022 12:07:54 -0400 +Subject: [PATCH] Add missing BlockFadeEvents + + +diff --git a/src/main/java/net/minecraft/world/level/block/FrogspawnBlock.java b/src/main/java/net/minecraft/world/level/block/FrogspawnBlock.java +index e1d8ababdb992821cc0ac383c13f1f4d10b09107..d6232d6f14a195a0e3f8489f148eb8b44d0355c6 100644 +--- a/src/main/java/net/minecraft/world/level/block/FrogspawnBlock.java ++++ b/src/main/java/net/minecraft/world/level/block/FrogspawnBlock.java +@@ -84,6 +84,11 @@ public class FrogspawnBlock extends Block { + } + + private void hatchFrogspawn(ServerLevel world, BlockPos pos, RandomSource random) { ++ // Paper start - Call BlockFadeEvent ++ if (org.bukkit.craftbukkit.event.CraftEventFactory.callBlockFadeEvent(world, pos, Blocks.AIR.defaultBlockState()).isCancelled()) { ++ return; ++ } ++ // Paper end + this.destroyBlock(world, pos); + world.playSound((Player)null, pos, SoundEvents.FROGSPAWN_HATCH, SoundSource.BLOCKS, 1.0F, 1.0F); + this.spawnTadpoles(world, pos, random); diff --git a/patches/server/0926-Collision-API.patch b/patches/server/0926-Collision-API.patch new file mode 100644 index 0000000000..510fa23e1a --- /dev/null +++ b/patches/server/0926-Collision-API.patch @@ -0,0 +1,47 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Owen1212055 <23108066+Owen1212055@users.noreply.github.com> +Date: Wed, 6 Oct 2021 20:10:44 -0400 +Subject: [PATCH] Collision API + + +diff --git a/src/main/java/org/bukkit/craftbukkit/CraftRegionAccessor.java b/src/main/java/org/bukkit/craftbukkit/CraftRegionAccessor.java +index 6445c2e4c97860e1c98f5263188d309cf55936f0..62bca85da6c5d9877e21fecb702370506ddf671c 100644 +--- a/src/main/java/org/bukkit/craftbukkit/CraftRegionAccessor.java ++++ b/src/main/java/org/bukkit/craftbukkit/CraftRegionAccessor.java +@@ -962,5 +962,12 @@ public abstract class CraftRegionAccessor implements RegionAccessor { + + return this.getHandle().clip(new net.minecraft.world.level.ClipContext(vec3d, vec3d1, net.minecraft.world.level.ClipContext.Block.COLLIDER, net.minecraft.world.level.ClipContext.Fluid.NONE, null)).getType() == net.minecraft.world.phys.HitResult.Type.MISS; + } ++ ++ @Override ++ public boolean hasCollisionsIn(@org.jetbrains.annotations.NotNull org.bukkit.util.BoundingBox boundingBox) { ++ net.minecraft.world.phys.AABB aabb = new AABB(boundingBox.getMinX(), boundingBox.getMinY(), boundingBox.getMinZ(), boundingBox.getMaxX(), boundingBox.getMaxY(), boundingBox.getMaxZ(), false); ++ ++ return !this.getHandle().noCollision(aabb); ++ } + // Paper end + } +diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java +index b80cc0938b2b3928f4450f1314a9fbd7ea9c116b..6549ade8e19807c523e5a1dc68b66585aad438b1 100644 +--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java ++++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java +@@ -1340,4 +1340,19 @@ public abstract class CraftEntity implements org.bukkit.entity.Entity { + return getHandle().isInPowderSnow || getHandle().wasInPowderSnow; // depending on the location in the entity "tick" either could be needed. + } + // Paper end ++ // Paper Start - Collision API ++ @Override ++ public boolean collidesAt(@org.jetbrains.annotations.NotNull Location location) { ++ net.minecraft.world.phys.AABB aabb = this.getHandle().getBoundingBoxAt(location.getX(), location.getY(), location.getZ()); ++ ++ return !this.getHandle().level.noCollision(this.getHandle(), aabb); ++ } ++ ++ @Override ++ public boolean wouldCollideUsing(@org.jetbrains.annotations.NotNull BoundingBox boundingBox) { ++ net.minecraft.world.phys.AABB aabb = new AABB(boundingBox.getMinX(), boundingBox.getMinY(), boundingBox.getMinZ(), boundingBox.getMaxX(), boundingBox.getMaxY(), boundingBox.getMaxZ(), false); ++ ++ return !this.getHandle().level.noCollision(this.getHandle(), aabb); ++ } ++ // Paper End - Collision API + } diff --git a/patches/server/0927-Fix-suggest-command-message-for-brigadier-syntax-exc.patch b/patches/server/0927-Fix-suggest-command-message-for-brigadier-syntax-exc.patch new file mode 100644 index 0000000000..2d62b243ec --- /dev/null +++ b/patches/server/0927-Fix-suggest-command-message-for-brigadier-syntax-exc.patch @@ -0,0 +1,20 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: chickeneer +Date: Mon, 1 Aug 2022 20:13:02 -0500 +Subject: [PATCH] Fix suggest command message for brigadier syntax exceptions + +This is a bug accidentally introduced in upstream CB + +diff --git a/src/main/java/net/minecraft/commands/Commands.java b/src/main/java/net/minecraft/commands/Commands.java +index 584d2539d715fef26a2d01f014c7c3f4f8ce8fd9..135b341e5b975fc542f66ef9c52e29f4c6dd4a53 100644 +--- a/src/main/java/net/minecraft/commands/Commands.java ++++ b/src/main/java/net/minecraft/commands/Commands.java +@@ -314,7 +314,7 @@ public class Commands { + if (commandsyntaxexception.getInput() != null && commandsyntaxexception.getCursor() >= 0) { + int j = Math.min(commandsyntaxexception.getInput().length(), commandsyntaxexception.getCursor()); + MutableComponent ichatmutablecomponent = Component.empty().withStyle(ChatFormatting.GRAY).withStyle((chatmodifier) -> { +- return chatmodifier.withClickEvent(new ClickEvent(ClickEvent.Action.SUGGEST_COMMAND, label)); // CraftBukkit ++ return chatmodifier.withClickEvent(new ClickEvent(ClickEvent.Action.SUGGEST_COMMAND, "/" + label)); // CraftBukkit // Paper + }); + + if (j > 10) { diff --git a/patches/server/0928-Fix-command-preprocess-cancelling-and-command-changi.patch b/patches/server/0928-Fix-command-preprocess-cancelling-and-command-changi.patch new file mode 100644 index 0000000000..691f427e18 --- /dev/null +++ b/patches/server/0928-Fix-command-preprocess-cancelling-and-command-changi.patch @@ -0,0 +1,40 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Nassim Jahnke +Date: Tue, 2 Aug 2022 19:16:23 +0200 +Subject: [PATCH] Fix command preprocess cancelling and command changing + + +diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +index d030574fbd282c018898b64b6ced9749f54cb813..50d89accf52799de11ab0488e9353ca40f2de3dd 100644 +--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java ++++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +@@ -2264,13 +2264,24 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic + PlayerCommandPreprocessEvent event = new PlayerCommandPreprocessEvent(this.getCraftPlayer(), command, new LazyPlayerSet(this.server)); + this.cserver.getPluginManager().callEvent(event); + +- if (event.isCancelled()) { +- return; +- } + command = event.getMessage().substring(1); + +- ParseResults parseresults = this.parseCommand(command); +- Map map = (packet.command().equals(command)) ? this.collectSignedArguments(packet, PreviewableCommand.of(parseresults)) : Collections.emptyMap(); ++ // Paper start - send message headers for cancelled or changed commands ++ ParseResults parseresults = this.parseCommand(packet.command()); ++ Map map = this.collectSignedArguments(packet, PreviewableCommand.of(parseresults)); ++ if (event.isCancelled() || !packet.command().equals(command)) { ++ for (final PlayerChatMessage message : map.values()) { ++ player.server.getPlayerList().broadcastMessageHeader(message, Set.of()); ++ } ++ if (event.isCancelled()) { ++ return; ++ } ++ ++ // Remove signatures if the command was changed and use the changed command source stack ++ map.clear(); ++ parseresults = this.parseCommand(command); ++ } ++ // Paper end + // CraftBukkit end + Iterator iterator = map.values().iterator(); + diff --git a/patches/server/0929-Remove-invalid-signature-login-stacktrace.patch b/patches/server/0929-Remove-invalid-signature-login-stacktrace.patch new file mode 100644 index 0000000000..e51733ffdc --- /dev/null +++ b/patches/server/0929-Remove-invalid-signature-login-stacktrace.patch @@ -0,0 +1,19 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Nassim Jahnke +Date: Fri, 10 Jun 2022 16:02:35 +0200 +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 +index 51ff7ab5d8740e755cc893723f659c8481c1ec89..2f0b2d0f3a3dc02076cee9ab5e6dd6ab931143e3 100644 +--- a/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java ++++ b/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java +@@ -177,7 +177,7 @@ public class ServerLoginPacketListenerImpl implements TickablePacketListener, Se + + profilepublickey = ServerLoginPacketListenerImpl.validatePublicKey(this.profilePublicKeyData, this.gameProfile.getId(), signaturevalidator, this.server.enforceSecureProfile()); + } catch (ProfilePublicKey.ValidationException profilepublickey_b) { +- ServerLoginPacketListenerImpl.LOGGER.error("Failed to validate profile key: {}", profilepublickey_b.getMessage()); ++ // ServerLoginPacketListenerImpl.LOGGER.error("Failed to validate profile key: {}", profilepublickey_b.getMessage()); // Paper - unnecessary log + if (!this.connection.isMemoryConnection()) { + this.disconnect(profilepublickey_b.getComponent()); + return; diff --git a/patches/server/0930-Add-async-catcher-to-PlayerConnection-internalTelepo.patch b/patches/server/0930-Add-async-catcher-to-PlayerConnection-internalTelepo.patch new file mode 100644 index 0000000000..a78a24d0ac --- /dev/null +++ b/patches/server/0930-Add-async-catcher-to-PlayerConnection-internalTelepo.patch @@ -0,0 +1,18 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Spottedleaf +Date: Wed, 3 Aug 2022 12:57:36 -0700 +Subject: [PATCH] Add async catcher to PlayerConnection internalTeleport + + +diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +index 50d89accf52799de11ab0488e9353ca40f2de3dd..c3a5aa2cbfeef1d2841ef85d135a2f6e0a7a2f61 100644 +--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java ++++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +@@ -1763,6 +1763,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic + } + + public void internalTeleport(double d0, double d1, double d2, float f, float f1, Set set, boolean flag) { ++ org.spigotmc.AsyncCatcher.catchOp("teleport"); // Paper + // Paper start + if (player.isRemoved()) { + LOGGER.info("Attempt to teleport removed player {} restricted", player.getScoreboardName()); diff --git a/patches/server/0931-Block-Ticking-API.patch b/patches/server/0931-Block-Ticking-API.patch new file mode 100644 index 0000000000..43db29d605 --- /dev/null +++ b/patches/server/0931-Block-Ticking-API.patch @@ -0,0 +1,47 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Owen1212055 <23108066+Owen1212055@users.noreply.github.com> +Date: Sun, 26 Dec 2021 13:23:46 -0500 +Subject: [PATCH] Block Ticking API + + +diff --git a/src/main/java/org/bukkit/craftbukkit/block/CraftBlock.java b/src/main/java/org/bukkit/craftbukkit/block/CraftBlock.java +index bfe9dc935c87e01fb435d8b46ce413b84ca74856..0d47460494135d4ec4c95260de033e054c2f0404 100644 +--- a/src/main/java/org/bukkit/craftbukkit/block/CraftBlock.java ++++ b/src/main/java/org/bukkit/craftbukkit/block/CraftBlock.java +@@ -736,5 +736,21 @@ public class CraftBlock implements Block { + public boolean isValidTool(ItemStack itemStack) { + return getDrops(itemStack).size() != 0; + } ++ ++ @Override ++ public void tick() { ++ net.minecraft.world.level.block.state.BlockState blockData = this.getNMS(); ++ net.minecraft.server.level.ServerLevel level = this.world.getMinecraftWorld(); ++ ++ blockData.getBlock().tick(blockData, level, this.position, level.random); ++ } ++ ++ @Override ++ public void randomTick() { ++ net.minecraft.world.level.block.state.BlockState blockData = this.getNMS(); ++ net.minecraft.server.level.ServerLevel level = this.world.getMinecraftWorld(); ++ ++ blockData.getBlock().randomTick(blockData, level, this.position, level.random); ++ } + // Paper end + } +diff --git a/src/main/java/org/bukkit/craftbukkit/block/data/CraftBlockData.java b/src/main/java/org/bukkit/craftbukkit/block/data/CraftBlockData.java +index aae7f7ab4931db8f955c3055157fe01f99931ec7..e4c15fcbd21f70836c26133ef10f3d0da9b6c238 100644 +--- a/src/main/java/org/bukkit/craftbukkit/block/data/CraftBlockData.java ++++ b/src/main/java/org/bukkit/craftbukkit/block/data/CraftBlockData.java +@@ -614,4 +614,10 @@ public class CraftBlockData implements BlockData { + + return this.state.isFaceSturdy(EmptyBlockGetter.INSTANCE, BlockPos.ZERO, CraftBlock.blockFaceToNotch(face), CraftBlockSupport.toNMS(support)); + } ++ // Paper start - Block tick API ++ @Override ++ public boolean isRandomlyTicked() { ++ return this.state.isRandomlyTicking(); ++ } ++ // Paper end + } diff --git a/patches/server/0273-Add-Velocity-IP-Forwarding-Support.patch b/patches/server/0932-Add-Velocity-IP-Forwarding-Support.patch similarity index 85% rename from patches/server/0273-Add-Velocity-IP-Forwarding-Support.patch rename to patches/server/0932-Add-Velocity-IP-Forwarding-Support.patch index bb92695826..376b2d6d2a 100644 --- a/patches/server/0273-Add-Velocity-IP-Forwarding-Support.patch +++ b/patches/server/0932-Add-Velocity-IP-Forwarding-Support.patch @@ -15,10 +15,10 @@ login plugin message packet. diff --git a/src/main/java/com/destroystokyo/paper/proxy/VelocityProxy.java b/src/main/java/com/destroystokyo/paper/proxy/VelocityProxy.java new file mode 100644 -index 0000000000000000000000000000000000000000..980e2b4dc308adf9a6cb2596b28eaeee65d629a8 +index 0000000000000000000000000000000000000000..5de2dabbc076a9482b1d6c299f1cff74313af74e --- /dev/null +++ b/src/main/java/com/destroystokyo/paper/proxy/VelocityProxy.java -@@ -0,0 +1,68 @@ +@@ -0,0 +1,74 @@ +package com.destroystokyo.paper.proxy; + +import io.papermc.paper.configuration.GlobalConfiguration; @@ -29,6 +29,7 @@ index 0000000000000000000000000000000000000000..980e2b4dc308adf9a6cb2596b28eaeee +import java.security.InvalidKeyException; +import java.security.MessageDigest; +import java.security.NoSuchAlgorithmException; ++import java.util.UUID; + +import javax.crypto.Mac; +import javax.crypto.spec.SecretKeySpec; @@ -39,7 +40,8 @@ index 0000000000000000000000000000000000000000..980e2b4dc308adf9a6cb2596b28eaeee +public class VelocityProxy { + private static final int SUPPORTED_FORWARDING_VERSION = 1; + public static final int MODERN_FORWARDING_WITH_KEY = 2; -+ public static final byte MAX_SUPPORTED_FORWARDING_VERSION = 2; ++ public static final int MODERN_FORWARDING_WITH_KEY_V2 = 3; ++ public static final byte MAX_SUPPORTED_FORWARDING_VERSION = MODERN_FORWARDING_WITH_KEY_V2; + public static final ResourceLocation PLAYER_INFO_CHANNEL = new ResourceLocation("velocity", "player_info"); + + public static boolean checkIntegrity(final FriendlyByteBuf buf) { @@ -86,20 +88,24 @@ index 0000000000000000000000000000000000000000..980e2b4dc308adf9a6cb2596b28eaeee + public static ProfilePublicKey.Data readForwardedKey(FriendlyByteBuf buf) { + return new ProfilePublicKey.Data(buf); + } ++ ++ public static UUID readSignerUuidOrElse(FriendlyByteBuf buf, UUID orElse) { ++ return buf.readBoolean() ? buf.readUUID() : orElse; ++ } +} 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 2f0b2d0f3a3dc02076cee9ab5e6dd6ab931143e3..bf488013e45b9ab97568e587f4dad899498b2f73 100644 --- a/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 - @Nullable +@@ -67,6 +67,7 @@ public class ServerLoginPacketListenerImpl implements TickablePacketListener, Se private ProfilePublicKey.Data profilePublicKeyData; public String hostname = ""; // CraftBukkit - add field + public boolean iKnowThisMayNotBeTheBestIdeaButPleaseDisableUsernameValidation = false; // Paper - username validation overriding + private int velocityLoginMessageId = -1; // Paper - Velocity support public ServerLoginPacketListenerImpl(MinecraftServer server, Connection connection) { this.state = ServerLoginPacketListenerImpl.State.HELLO; -@@ -279,6 +280,16 @@ public class ServerLoginPacketListenerImpl implements TickablePacketListener, Se +@@ -300,6 +301,16 @@ public class ServerLoginPacketListenerImpl implements TickablePacketListener, Se this.state = ServerLoginPacketListenerImpl.State.KEY; this.connection.send(new ClientboundHelloPacket("", this.server.getKeyPair().getPublic().getEncoded(), this.nonce)); } else { @@ -116,7 +122,7 @@ index 7c3c76b7ef169e0c0832e26212775111deb505c0..63abdc84bbd8d3ef78e18ffe792f2f1e // Spigot start // Paper start - Cache authenticator threads authenticatorPool.execute(new Runnable() { -@@ -390,6 +401,12 @@ public class ServerLoginPacketListenerImpl implements TickablePacketListener, Se +@@ -413,6 +424,12 @@ public class ServerLoginPacketListenerImpl implements TickablePacketListener, Se public class LoginHandler { public void fireEvents() throws Exception { @@ -128,8 +134,8 @@ index 7c3c76b7ef169e0c0832e26212775111deb505c0..63abdc84bbd8d3ef78e18ffe792f2f1e + // Paper end String playerName = ServerLoginPacketListenerImpl.this.gameProfile.getName(); java.net.InetAddress address = ((java.net.InetSocketAddress) ServerLoginPacketListenerImpl.this.connection.getRemoteAddress()).getAddress(); - java.util.UUID uniqueId = ServerLoginPacketListenerImpl.this.gameProfile.getId(); -@@ -437,6 +454,59 @@ public class ServerLoginPacketListenerImpl implements TickablePacketListener, Se + java.net.InetAddress rawAddress = ((java.net.InetSocketAddress) connection.getRawAddress()).getAddress(); // Paper +@@ -461,6 +478,60 @@ public class ServerLoginPacketListenerImpl implements TickablePacketListener, Se // Spigot end public void handleCustomQueryPacket(ServerboundCustomQueryPacket packet) { @@ -162,13 +168,14 @@ index 7c3c76b7ef169e0c0832e26212775111deb505c0..63abdc84bbd8d3ef78e18ffe792f2f1e + + // We should already have this, but, we'll read it out anyway + //noinspection NonStrictComparisonCanBeEquality -+ if (version >= com.destroystokyo.paper.proxy.VelocityProxy.MODERN_FORWARDING_WITH_KEY) { -+ final ProfilePublicKey.Data forwardedKey = com.destroystokyo.paper.proxy.VelocityProxy.readForwardedKey(buf); ++ if (version >= com.destroystokyo.paper.proxy.VelocityProxy.MODERN_FORWARDING_WITH_KEY_V2) { ++ final ProfilePublicKey.Data forwardedKeyData = com.destroystokyo.paper.proxy.VelocityProxy.readForwardedKey(buf); ++ final UUID signer = com.destroystokyo.paper.proxy.VelocityProxy.readSignerUuidOrElse(buf, this.gameProfile.getId()); + if (this.profilePublicKeyData == null) { + try { -+ ProfilePublicKey.createValidated(this.server.getServiceSignatureValidator(), this.gameProfile.getId(), forwardedKey); -+ this.profilePublicKeyData = forwardedKey; -+ } catch (CryptException e) { ++ ServerLoginPacketListenerImpl.validatePublicKey(forwardedKeyData, signer, this.server.getServiceSignatureValidator(), this.server.enforceSecureProfile()); ++ this.profilePublicKeyData = forwardedKeyData; ++ } catch (ProfilePublicKey.ValidationException err) { + this.disconnect("Unable to validate forwarded player key"); + } + } @@ -190,10 +197,10 @@ index 7c3c76b7ef169e0c0832e26212775111deb505c0..63abdc84bbd8d3ef78e18ffe792f2f1e } diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -index 21f0e1a23d6e9c6c76abfa9af555642fadeba69c..59ce840dadcecf9c6aed77747a06519eca5fea90 100644 +index 32eb6efa94bc5ea3b516cbbd7e53f1460c23154d..964ec590ef5302576ecb3ba2b8ea95dbc2acf103 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -@@ -764,7 +764,7 @@ public final class CraftServer implements Server { +@@ -784,7 +784,7 @@ public final class CraftServer implements Server { @Override public long getConnectionThrottle() { // Spigot Start - Automatically set connection throttle for bungee configurations diff --git a/patches/server/0933-Use-thread-safe-random-in-ServerLoginPacketListenerI.patch b/patches/server/0933-Use-thread-safe-random-in-ServerLoginPacketListenerI.patch new file mode 100644 index 0000000000..81d6721a69 --- /dev/null +++ b/patches/server/0933-Use-thread-safe-random-in-ServerLoginPacketListenerI.patch @@ -0,0 +1,19 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Shane Freeder +Date: Thu, 11 Aug 2022 14:37:33 +0100 +Subject: [PATCH] Use thread safe random in ServerLoginPacketListenerImpl + + +diff --git a/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java +index bf488013e45b9ab97568e587f4dad899498b2f73..88a849a21d6e39fd70f6e7b554528da1a5a7dd57 100644 +--- a/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java ++++ b/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java +@@ -52,7 +52,7 @@ public class ServerLoginPacketListenerImpl implements TickablePacketListener, Se + private static final AtomicInteger UNIQUE_THREAD_ID = new AtomicInteger(0); + static final Logger LOGGER = LogUtils.getLogger(); + private static final int MAX_TICKS_BEFORE_LOGIN = 600; +- private static final RandomSource RANDOM = RandomSource.create(); ++ private static final RandomSource RANDOM = new org.bukkit.craftbukkit.util.RandomSourceWrapper(new java.util.Random()); // Paper - This is called across threads, make safe + private final byte[] nonce; + final MinecraftServer server; + public final Connection connection; diff --git a/patches/server/0934-Add-NamespacedKey-biome-methods.patch b/patches/server/0934-Add-NamespacedKey-biome-methods.patch new file mode 100644 index 0000000000..3266ac0fb2 --- /dev/null +++ b/patches/server/0934-Add-NamespacedKey-biome-methods.patch @@ -0,0 +1,31 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Josh Roy <10731363+JRoy@users.noreply.github.com> +Date: Sun, 14 Aug 2022 12:23:11 -0400 +Subject: [PATCH] Add NamespacedKey biome methods + +Co-authored-by: Thonk <30448663+ExcessiveAmountsOfZombies@users.noreply.github.com> + +diff --git a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java +index 0a4e9b0957c9b0abbb88d472b5b3d7946c256af2..1628913b1e9b91e68dcd942a38da4aed95b12d4a 100644 +--- a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java ++++ b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java +@@ -604,6 +604,19 @@ public final class CraftMagicNumbers implements UnsafeValues { + Preconditions.checkArgument(material.isBlock(), material + " is not a block"); + return getBlock(material).hasCollision; + } ++ ++ @Override ++ public org.bukkit.NamespacedKey getBiomeKey(org.bukkit.RegionAccessor accessor, int x, int y, int z) { ++ org.bukkit.craftbukkit.CraftRegionAccessor cra = (org.bukkit.craftbukkit.CraftRegionAccessor) accessor; ++ return org.bukkit.craftbukkit.util.CraftNamespacedKey.fromMinecraft(cra.getHandle().registryAccess().registryOrThrow(net.minecraft.core.Registry.BIOME_REGISTRY).getKey(cra.getHandle().getBiome(new net.minecraft.core.BlockPos(x, y, z)).value())); ++ } ++ ++ @Override ++ public void setBiomeKey(org.bukkit.RegionAccessor accessor, int x, int y, int z, org.bukkit.NamespacedKey biomeKey) { ++ org.bukkit.craftbukkit.CraftRegionAccessor cra = (org.bukkit.craftbukkit.CraftRegionAccessor) accessor; ++ net.minecraft.core.Holder biomeBase = cra.getHandle().registryAccess().registryOrThrow(net.minecraft.core.Registry.BIOME_REGISTRY).getHolderOrThrow(net.minecraft.resources.ResourceKey.create(net.minecraft.core.Registry.BIOME_REGISTRY, org.bukkit.craftbukkit.util.CraftNamespacedKey.toMinecraft(biomeKey))); ++ cra.setBiome(x, y, z, biomeBase); ++ } + // Paper end + + /** diff --git a/patches/server/0935-Fix-plugin-loggers-on-server-shutdown.patch b/patches/server/0935-Fix-plugin-loggers-on-server-shutdown.patch new file mode 100644 index 0000000000..96bd73a9dd --- /dev/null +++ b/patches/server/0935-Fix-plugin-loggers-on-server-shutdown.patch @@ -0,0 +1,67 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Jos=C3=A9=20Miguel=20Moreno?= +Date: Sat, 5 Jun 2021 13:45:15 +0200 +Subject: [PATCH] Fix plugin loggers on server shutdown + + +diff --git a/src/main/java/io/papermc/paper/log/CustomLogManager.java b/src/main/java/io/papermc/paper/log/CustomLogManager.java +new file mode 100644 +index 0000000000000000000000000000000000000000..c1d3bac79bb8b4796c013ff4472f75dcd79602dc +--- /dev/null ++++ b/src/main/java/io/papermc/paper/log/CustomLogManager.java +@@ -0,0 +1,26 @@ ++package io.papermc.paper.log; ++ ++import java.util.logging.LogManager; ++ ++public class CustomLogManager extends LogManager { ++ private static CustomLogManager instance; ++ ++ public CustomLogManager() { ++ instance = this; ++ } ++ ++ @Override ++ public void reset() { ++ // Ignore calls to this method ++ } ++ ++ private void superReset() { ++ super.reset(); ++ } ++ ++ public static void forceReset() { ++ if (instance != null) { ++ instance.superReset(); ++ } ++ } ++} +diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java +index dd9ab51e904be2f2f2a2981d4f0f6638a6895e8d..d2161a3c3b9a2b2d463ac778656c95167c10a49d 100644 +--- a/src/main/java/net/minecraft/server/MinecraftServer.java ++++ b/src/main/java/net/minecraft/server/MinecraftServer.java +@@ -1025,6 +1025,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop