From d24a71e85db690870ec108c387c5b279c7c60483 Mon Sep 17 00:00:00 2001 From: Jake Potrebic Date: Fri, 10 Mar 2023 12:18:50 -0800 Subject: [PATCH] Updated Upstream (Bukkit/CraftBukkit/Spigot) (#8874) Upstream has released updates that appear to apply and compile correctly. This update has not been tested by PaperMC and as with ANY update, please do your own testing Bukkit Changes: 6b3c598b PR-814: Add a method to send multiple equipment changes 181a984b Update Maven shade version to align with CraftBukkit a5a36e32 Revert "Update Maven shade version to align with CraftBukkit" 7a8f4a42 Update Maven shade version to align with CraftBukkit 58327201 Add support for Java 20 CraftBukkit Changes: b56426c7a PR-1142: Calculate explosion damage separately for each affected EntityComplexPart fbe3410af PR-1140: Add a method to send multiple equipment changes 8434e3633 Add support for Java 20 c998a1d23 Increase outdated build delay 4a929b5d6 SPIGOT-7267: Fix EntityType#getTranslationKey() and add unit test 086d8dc8a SPIGOT-7268: CraftMetaPotion reads ShowParticles and ShowIcon properties incorrectly 8ba5e399e SPIGOT-7262: Improve visibility API Spigot Changes: a2190e30 Rebuild patches --- .../api/Add-Player-Client-Options-API.patch | 10 +---- ...d-Player-sendEquipmentChange-Map-API.patch | 33 ---------------- patches/api/Add-PlayerKickEvent-causes.patch | 2 +- .../api/Add-String-based-Action-Bar-API.patch | 30 ++------------- patches/api/Adventure.patch | 8 ++-- ...low-plugins-to-use-SLF4J-for-logging.patch | 4 +- patches/api/Convert-project-to-Gradle.patch | 8 ++-- patches/api/Fix-upstream-javadocs.patch | 2 +- patches/api/Multi-Block-Change-API.patch | 4 +- patches/api/Paper-Plugins.patch | 2 +- .../api/Player-Tab-List-and-Title-APIs.patch | 14 ++----- patches/api/Player-elytra-boost-API.patch | 2 +- patches/api/Timings-v2.patch | 2 +- patches/api/Use-ASM-for-event-executors.patch | 4 +- ...d-Player-sendEquipmentChange-Map-API.patch | 38 ------------------- .../Add-support-for-Proxy-Protocol.patch | 2 +- patches/server/Adventure.patch | 26 ------------- patches/server/Build-system-changes.patch | 6 +-- ...ktraces-in-log-messages-crash-report.patch | 2 +- patches/server/Fix-this-stupid-bullshit.patch | 2 +- ...n-prefixes-using-Log4J-configuration.patch | 2 +- patches/server/Paper-config-files.patch | 4 +- .../Remove-garbage-Java-version-check.patch | 4 +- patches/server/Setup-Gradle-project.patch | 18 ++------- ...ient-crashes-server-lists-and-Mojang.patch | 2 +- ...mp-fix-for-EntityType.translationKey.patch | 24 ------------ patches/server/Test-changes.patch | 4 +- ...oleAppender-for-console-improvements.patch | 4 +- work/Bukkit | 2 +- work/CraftBukkit | 2 +- work/Spigot | 2 +- 31 files changed, 49 insertions(+), 220 deletions(-) delete mode 100644 patches/api/Add-Player-sendEquipmentChange-Map-API.patch delete mode 100644 patches/server/Add-Player-sendEquipmentChange-Map-API.patch delete mode 100644 patches/server/Temp-fix-for-EntityType.translationKey.patch diff --git a/patches/api/Add-Player-Client-Options-API.patch b/patches/api/Add-Player-Client-Options-API.patch index 092a578bd4..ebda51994d 100644 --- a/patches/api/Add-Player-Client-Options-API.patch +++ b/patches/api/Add-Player-Client-Options-API.patch @@ -232,14 +232,6 @@ diff --git a/src/main/java/org/bukkit/entity/Player.java b/src/main/java/org/buk index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/main/java/org/bukkit/entity/Player.java +++ b/src/main/java/org/bukkit/entity/Player.java -@@ -0,0 +0,0 @@ package org.bukkit.entity; - import java.net.InetSocketAddress; - import java.util.Collection; - import java.util.UUID; -+import com.destroystokyo.paper.ClientOption; // Paper - import com.destroystokyo.paper.Title; // Paper - import net.kyori.adventure.text.Component; - import org.bukkit.DyeColor; @@ -0,0 +0,0 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM * Reset the cooldown counter to 0, effectively starting the cooldown period. */ @@ -249,7 +241,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + * @return the client option value of the player + */ + @NotNull -+ T getClientOption(@NotNull ClientOption option); ++ T getClientOption(@NotNull com.destroystokyo.paper.ClientOption option); // Paper end // Spigot start diff --git a/patches/api/Add-Player-sendEquipmentChange-Map-API.patch b/patches/api/Add-Player-sendEquipmentChange-Map-API.patch deleted file mode 100644 index df21c633ce..0000000000 --- a/patches/api/Add-Player-sendEquipmentChange-Map-API.patch +++ /dev/null @@ -1,33 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: Aya <31237389+tal5@users.noreply.github.com> -Date: Fri, 20 Jan 2023 13:49:35 +0000 -Subject: [PATCH] Add Player#sendEquipmentChange(Map) API - - -diff --git a/src/main/java/org/bukkit/entity/Player.java b/src/main/java/org/bukkit/entity/Player.java -index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 ---- a/src/main/java/org/bukkit/entity/Player.java -+++ b/src/main/java/org/bukkit/entity/Player.java -@@ -0,0 +0,0 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM - * @param slot The slot of the spoofed equipment change - * @param item The ItemStack to display for the player - */ -- public void sendEquipmentChange(@NotNull LivingEntity entity, @NotNull EquipmentSlot slot, @NotNull ItemStack item); -+ // Paper start -+ default void sendEquipmentChange(@NotNull LivingEntity entity, @NotNull EquipmentSlot slot, @NotNull ItemStack item) { -+ this.sendEquipmentChange(entity, java.util.Map.of(slot, item)); -+ }; -+ -+ /** -+ * Send an equipment change for an entity. This fakes the equipment change -+ * of an entity for a user. This will not actually change the inventory of -+ * the specified entity in any way. -+ * -+ * @param entity The entity that the player will see the change for -+ * @param equipmentChanges A map of slots to the items they will be changed to, cannot contain null values. -+ */ -+ void sendEquipmentChange(@NotNull LivingEntity entity, @NotNull java.util.Map equipmentChanges); -+ // Paper end - - // Paper start - /** diff --git a/patches/api/Add-PlayerKickEvent-causes.patch b/patches/api/Add-PlayerKickEvent-causes.patch index f720fb6c96..406316c463 100644 --- a/patches/api/Add-PlayerKickEvent-causes.patch +++ b/patches/api/Add-PlayerKickEvent-causes.patch @@ -19,7 +19,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + * @param message kick message + * @param cause kick cause + */ -+ void kick(final @Nullable Component message, @NotNull org.bukkit.event.player.PlayerKickEvent.Cause cause); ++ void kick(final @Nullable net.kyori.adventure.text.Component message, @NotNull org.bukkit.event.player.PlayerKickEvent.Cause cause); // Paper end /** diff --git a/patches/api/Add-String-based-Action-Bar-API.patch b/patches/api/Add-String-based-Action-Bar-API.patch index 4ba0a2cec6..cec074fe1f 100644 --- a/patches/api/Add-String-based-Action-Bar-API.patch +++ b/patches/api/Add-String-based-Action-Bar-API.patch @@ -8,14 +8,6 @@ diff --git a/src/main/java/org/bukkit/entity/Player.java b/src/main/java/org/buk index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/main/java/org/bukkit/entity/Player.java +++ b/src/main/java/org/bukkit/entity/Player.java -@@ -0,0 +0,0 @@ import java.net.InetSocketAddress; - import java.util.Collection; - import java.util.UUID; - import com.destroystokyo.paper.Title; // Paper -+import net.kyori.adventure.text.Component; - import org.bukkit.DyeColor; - import org.bukkit.Effect; - import org.bukkit.GameMode; @@ -0,0 +0,0 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM public void sendMap(@NotNull MapView map); @@ -27,7 +19,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + * Use Section symbols for legacy color codes to send formatting. + * + * @param message The message to send -+ * @deprecated use {@link #sendActionBar(Component)} ++ * @deprecated use {@link #sendActionBar(net.kyori.adventure.text.Component)} + */ + @Deprecated + public void sendActionBar(@NotNull String message); @@ -39,7 +31,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + * + * @param alternateChar Alternate symbol such as '&' + * @param message The message to send -+ * @deprecated use {@link #sendActionBar(Component)} ++ * @deprecated use {@link #sendActionBar(net.kyori.adventure.text.Component)} + */ + @Deprecated + public void sendActionBar(char alternateChar, @NotNull String message); @@ -48,7 +40,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + * Sends an Action Bar message to the client. + * + * @param message The components to send -+ * @deprecated use {@link #sendActionBar(Component)} ++ * @deprecated use {@link #sendActionBar(net.kyori.adventure.text.Component)} + */ + @Deprecated + public void sendActionBar(@NotNull net.md_5.bungee.api.chat.BaseComponent... message); @@ -68,19 +60,3 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 public default void sendMessage(net.md_5.bungee.api.ChatMessageType position, net.md_5.bungee.api.chat.BaseComponent... components) { spigot().sendMessage(position, components); } -@@ -0,0 +0,0 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM - /** - * Sends the component to the specified screen position of this player - * -+ * @deprecated This is unlikely the API you want to use. See {@link #sendActionBar(String)} for a more proper Action Bar API. This deprecated API may send unsafe items to the client. - * @param position the screen position - * @param component the components to send - * @deprecated use {@code sendMessage} methods that accept {@link net.kyori.adventure.text.Component} -@@ -0,0 +0,0 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM - /** - * Sends an array of components as a single message to the specified screen position of this player - * -+ * @deprecated This is unlikely the API you want to use. See {@link #sendActionBar(String)} for a more proper Action Bar API. This deprecated API may send unsafe items to the client. - * @param position the screen position - * @param components the components to send - * @deprecated use {@code sendMessage} methods that accept {@link net.kyori.adventure.text.Component} diff --git a/patches/api/Adventure.patch b/patches/api/Adventure.patch index cfa4cbaf7b..e3ac71fb6e 100644 --- a/patches/api/Adventure.patch +++ b/patches/api/Adventure.patch @@ -2116,7 +2116,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + // Paper start + /** + * Kicks the player with the default kick message. -+ * @see #kick(Component) ++ * @see #kick(net.kyori.adventure.text.Component) + */ + void kick(); + /** @@ -2132,7 +2132,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 * @@ -0,0 +0,0 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM */ - public void sendEquipmentChange(@NotNull LivingEntity entity, @NotNull EquipmentSlot slot, @NotNull ItemStack item); + public void sendEquipmentChange(@NotNull LivingEntity entity, @NotNull Map items); + // Paper start + /** @@ -2484,7 +2484,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + * @deprecated use {@code sendMessage} methods that accept {@link net.kyori.adventure.text.Component} */ + @Deprecated // Paper - public void sendMessage(@NotNull net.md_5.bungee.api.ChatMessageType position, @Nullable UUID sender, @NotNull net.md_5.bungee.api.chat.BaseComponent component) { + public void sendMessage(@NotNull net.md_5.bungee.api.ChatMessageType position, @Nullable java.util.UUID sender, @NotNull net.md_5.bungee.api.chat.BaseComponent component) { throw new UnsupportedOperationException("Not supported yet."); } @@ -0,0 +0,0 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM @@ -2494,7 +2494,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + * @deprecated use {@code sendMessage} methods that accept {@link net.kyori.adventure.text.Component} */ + @Deprecated // Paper - public void sendMessage(@NotNull net.md_5.bungee.api.ChatMessageType position, @Nullable UUID sender, @NotNull net.md_5.bungee.api.chat.BaseComponent... components) { + public void sendMessage(@NotNull net.md_5.bungee.api.ChatMessageType position, @Nullable java.util.UUID sender, @NotNull net.md_5.bungee.api.chat.BaseComponent... components) { throw new UnsupportedOperationException("Not supported yet."); } diff --git a/src/main/java/org/bukkit/entity/minecart/CommandMinecart.java b/src/main/java/org/bukkit/entity/minecart/CommandMinecart.java diff --git a/patches/api/Allow-plugins-to-use-SLF4J-for-logging.patch b/patches/api/Allow-plugins-to-use-SLF4J-for-logging.patch index 6e9d13a176..b5d69a3308 100644 --- a/patches/api/Allow-plugins-to-use-SLF4J-for-logging.patch +++ b/patches/api/Allow-plugins-to-use-SLF4J-for-logging.patch @@ -24,8 +24,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + api("org.apache.logging.log4j:log4j-api:2.17.1") + api("org.slf4j:slf4j-api:1.8.0-beta4") - implementation("org.ow2.asm:asm:9.2") - implementation("org.ow2.asm:asm-commons:9.2") + implementation("org.ow2.asm:asm:9.4") + implementation("org.ow2.asm:asm-commons:9.4") diff --git a/src/main/java/org/bukkit/plugin/Plugin.java b/src/main/java/org/bukkit/plugin/Plugin.java index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/main/java/org/bukkit/plugin/Plugin.java diff --git a/patches/api/Convert-project-to-Gradle.patch b/patches/api/Convert-project-to-Gradle.patch index 0b2e38e107..249c3990fb 100644 --- a/patches/api/Convert-project-to-Gradle.patch +++ b/patches/api/Convert-project-to-Gradle.patch @@ -59,7 +59,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + testImplementation("org.apache.commons:commons-lang3:3.12.0") + testImplementation("junit:junit:4.13.2") + testImplementation("org.hamcrest:hamcrest-library:1.3") -+ testImplementation("org.ow2.asm:asm-tree:9.3") ++ testImplementation("org.ow2.asm:asm-tree:9.4") +} + +configure { @@ -220,7 +220,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 - - org.ow2.asm - asm-tree -- 9.3 +- 9.4 - test - - @@ -274,7 +274,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 - - org.apache.maven.plugins - maven-shade-plugin -- 3.2.4 +- 3.4.1 - - - package @@ -294,6 +294,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 - - - true +- +- false - - - diff --git a/patches/api/Fix-upstream-javadocs.patch b/patches/api/Fix-upstream-javadocs.patch index 2ae9f582bc..e3643a5af3 100644 --- a/patches/api/Fix-upstream-javadocs.patch +++ b/patches/api/Fix-upstream-javadocs.patch @@ -164,7 +164,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 - * @param alternateChar Alternate symbol such as '&' + * @param alternateChar Alternate symbol such as '&' * @param message The message to send - * @deprecated use {@link #sendActionBar(Component)} + * @deprecated use {@link #sendActionBar(net.kyori.adventure.text.Component)} */ diff --git a/src/main/java/org/bukkit/entity/Slime.java b/src/main/java/org/bukkit/entity/Slime.java index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 diff --git a/patches/api/Multi-Block-Change-API.patch b/patches/api/Multi-Block-Change-API.patch index 7ed0f1f959..0a4716c374 100644 --- a/patches/api/Multi-Block-Change-API.patch +++ b/patches/api/Multi-Block-Change-API.patch @@ -34,5 +34,5 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + // Paper end + /** - * Send the equipment change of an entity. This fakes the equipment change - * of an entity for a user. This will not actually change the inventory of + * Send an equipment change for the target entity. This will not + * actually change the entity's equipment in any way. diff --git a/patches/api/Paper-Plugins.patch b/patches/api/Paper-Plugins.patch index 445a79a0c3..05a952c351 100644 --- a/patches/api/Paper-Plugins.patch +++ b/patches/api/Paper-Plugins.patch @@ -9,7 +9,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -0,0 +0,0 @@ dependencies { - implementation("org.ow2.asm:asm-commons:9.2") + implementation("org.ow2.asm:asm-commons:9.4") // Paper end - compileOnly("org.apache.maven:maven-resolver-provider:3.8.5") diff --git a/patches/api/Player-Tab-List-and-Title-APIs.patch b/patches/api/Player-Tab-List-and-Title-APIs.patch index 436d6416a6..e3cf07cf46 100644 --- a/patches/api/Player-Tab-List-and-Title-APIs.patch +++ b/patches/api/Player-Tab-List-and-Title-APIs.patch @@ -435,14 +435,6 @@ diff --git a/src/main/java/org/bukkit/entity/Player.java b/src/main/java/org/buk index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/main/java/org/bukkit/entity/Player.java +++ b/src/main/java/org/bukkit/entity/Player.java -@@ -0,0 +0,0 @@ package org.bukkit.entity; - import java.net.InetSocketAddress; - import java.util.Collection; - import java.util.UUID; -+import com.destroystokyo.paper.Title; // Paper - import org.bukkit.DyeColor; - import org.bukkit.Effect; - import org.bukkit.GameMode; @@ -0,0 +0,0 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM public default void sendMessage(net.md_5.bungee.api.ChatMessageType position, net.md_5.bungee.api.chat.BaseComponent... components) { spigot().sendMessage(position, components); @@ -544,14 +536,14 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + /** + * Show the title to the player, overriding any previously displayed title. + * -+ *

This method overrides any previous title, use {@link #updateTitle(Title)} to change the existing one.

++ *

This method overrides any previous title, use {@link #updateTitle(com.destroystokyo.paper.Title)} to change the existing one.

+ * + * @param title the title to send + * @throws NullPointerException if the title is null + * @deprecated Use {@link #showTitle(net.kyori.adventure.title.Title)} or {@link #sendTitlePart(net.kyori.adventure.title.TitlePart, Object)} + */ + @Deprecated -+ void sendTitle(@NotNull Title title); ++ void sendTitle(@NotNull com.destroystokyo.paper.Title title); + + /** + * Show the title to the player, overriding any previously displayed title. @@ -563,7 +555,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + * @deprecated Use {@link #showTitle(net.kyori.adventure.title.Title)} or {@link #sendTitlePart(net.kyori.adventure.title.TitlePart, Object)} + */ + @Deprecated -+ void updateTitle(@NotNull Title title); ++ void updateTitle(@NotNull com.destroystokyo.paper.Title title); + + /** + * Hide any title that is currently visible to the player diff --git a/patches/api/Player-elytra-boost-API.patch b/patches/api/Player-elytra-boost-API.patch index df4ab8a109..b2bcde8430 100644 --- a/patches/api/Player-elytra-boost-API.patch +++ b/patches/api/Player-elytra-boost-API.patch @@ -11,7 +11,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 @@ -0,0 +0,0 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM */ @NotNull - T getClientOption(@NotNull ClientOption option); + T getClientOption(@NotNull com.destroystokyo.paper.ClientOption option); + + /** + * Boost a Player that's {@link #isGliding()} using a {@link Firework}. diff --git a/patches/api/Timings-v2.patch b/patches/api/Timings-v2.patch index 8263714449..6b1c3bc64a 100644 --- a/patches/api/Timings-v2.patch +++ b/patches/api/Timings-v2.patch @@ -3397,7 +3397,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 +++ b/src/main/java/org/bukkit/entity/Player.java @@ -0,0 +0,0 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM @Deprecated // Paper - public void sendMessage(@NotNull net.md_5.bungee.api.ChatMessageType position, @Nullable UUID sender, @NotNull net.md_5.bungee.api.chat.BaseComponent... components) { + public void sendMessage(@NotNull net.md_5.bungee.api.ChatMessageType position, @Nullable java.util.UUID sender, @NotNull net.md_5.bungee.api.chat.BaseComponent... components) { throw new UnsupportedOperationException("Not supported yet."); + + } diff --git a/patches/api/Use-ASM-for-event-executors.patch b/patches/api/Use-ASM-for-event-executors.patch index 245cbad56f..888ff399f8 100644 --- a/patches/api/Use-ASM-for-event-executors.patch +++ b/patches/api/Use-ASM-for-event-executors.patch @@ -14,8 +14,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 apiAndDocs("net.kyori:adventure-text-serializer-plain") apiAndDocs("net.kyori:adventure-text-logger-slf4j") + -+ implementation("org.ow2.asm:asm:9.2") -+ implementation("org.ow2.asm:asm-commons:9.2") ++ implementation("org.ow2.asm:asm:9.4") ++ implementation("org.ow2.asm:asm-commons:9.4") // Paper end compileOnly("org.apache.maven:maven-resolver-provider:3.8.5") diff --git a/patches/server/Add-Player-sendEquipmentChange-Map-API.patch b/patches/server/Add-Player-sendEquipmentChange-Map-API.patch deleted file mode 100644 index 06bf46bd15..0000000000 --- a/patches/server/Add-Player-sendEquipmentChange-Map-API.patch +++ /dev/null @@ -1,38 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: Aya <31237389+tal5@users.noreply.github.com> -Date: Fri, 20 Jan 2023 13:49:59 +0000 -Subject: [PATCH] Add Player#sendEquipmentChange(Map) API - - -diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 ---- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -@@ -0,0 +0,0 @@ public class CraftPlayer extends CraftHumanEntity implements Player { - this.sendSignChange0(components, loc, dyeColor, hasGlowingText); // Paper - } - -+ // Paper start - @Override -- public void sendEquipmentChange(LivingEntity entity, EquipmentSlot slot, ItemStack item) { -+ public void sendEquipmentChange(LivingEntity entity, Map equipmentChanges) { - Preconditions.checkArgument(entity != null, "entity must not be null"); -- Preconditions.checkArgument(slot != null, "slot must not be null"); -- Preconditions.checkArgument(item != null, "item must not be null"); -+ Preconditions.checkNotNull(equipmentChanges, "equipmentChanges must not be null"); - - if (this.getHandle().connection == null) return; - -- List> equipment = Arrays.asList( -- new Pair<>(CraftEquipmentSlot.getNMS(slot), CraftItemStack.asNMSCopy(item)) -- ); -+ List> equipment = new ArrayList<>(equipmentChanges.size()); -+ for (Map.Entry entry : equipmentChanges.entrySet()) { -+ Preconditions.checkNotNull(entry.getKey(), "EquipmentSlot key must not be null"); -+ Preconditions.checkNotNull(entry.getValue(), "ItemStack value must not be null"); -+ equipment.add(new Pair<>(CraftEquipmentSlot.getNMS(entry.getKey()), CraftItemStack.asNMSCopy(entry.getValue()))); -+ } -+ // Paper end - - this.getHandle().connection.send(new ClientboundSetEquipmentPacket(entity.getEntityId(), equipment)); - } diff --git a/patches/server/Add-support-for-Proxy-Protocol.patch b/patches/server/Add-support-for-Proxy-Protocol.patch index cd9381c0f8..53cbfb7412 100644 --- a/patches/server/Add-support-for-Proxy-Protocol.patch +++ b/patches/server/Add-support-for-Proxy-Protocol.patch @@ -15,7 +15,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + implementation("io.netty:netty-codec-haproxy:4.1.87.Final") // Paper - Add support for proxy protocol // Paper end implementation("org.apache.logging.log4j:log4j-iostreams:2.19.0") // Paper - remove exclusion - implementation("org.ow2.asm:asm:9.3") + implementation("org.ow2.asm:asm:9.4") diff --git a/src/main/java/net/minecraft/server/network/ServerConnectionListener.java b/src/main/java/net/minecraft/server/network/ServerConnectionListener.java index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/main/java/net/minecraft/server/network/ServerConnectionListener.java diff --git a/patches/server/Adventure.patch b/patches/server/Adventure.patch index 411942b1fc..baea0ccec2 100644 --- a/patches/server/Adventure.patch +++ b/patches/server/Adventure.patch @@ -2305,19 +2305,6 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 } else { this.chat(s, message, true); } -@@ -0,0 +0,0 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic - } - - public void sendPlayerChatMessage(PlayerChatMessage message, ChatType.Bound params) { -+ // Paper start -+ if (!this.getCraftPlayer().canSee(message.link().sender())) { -+ this.sendDisguisedChatMessage(message.decoratedContent(), params); -+ return; -+ } -+ // Paper end - this.send(new ClientboundPlayerChatPacket(message.link().sender(), message.link().index(), message.signature(), message.signedBody().pack(this.messageSignatureCache), message.unsignedContent(), message.filterMask(), params.toNetwork(this.player.level.registryAccess()))); - this.addPendingMessage(message); - } @@ -0,0 +0,0 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic return; } @@ -3508,19 +3495,6 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 @Override @@ -0,0 +0,0 @@ public class CraftPlayer extends CraftHumanEntity implements Player { - return !this.hiddenEntities.containsKey(entity.getUniqueId()); - } - -+ // Paper start -+ public boolean canSee(UUID entityUUID) { -+ return !this.hiddenEntities.containsKey(entityUUID); -+ } -+ // Paper end -+ - @Override - public Map serialize() { - Map result = new LinkedHashMap(); -@@ -0,0 +0,0 @@ public class CraftPlayer extends CraftHumanEntity implements Player { @Override public void setResourcePack(String url) { diff --git a/patches/server/Build-system-changes.patch b/patches/server/Build-system-changes.patch index 9f0d4014c4..3d8da87d0e 100644 --- a/patches/server/Build-system-changes.patch +++ b/patches/server/Build-system-changes.patch @@ -16,8 +16,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 - exclude(group = "org.apache.logging.log4j", module = "log4j-api") - } + implementation("org.apache.logging.log4j:log4j-iostreams:2.19.0") // Paper - remove exclusion - implementation("org.ow2.asm:asm:9.3") -+ implementation("org.ow2.asm:asm-commons:9.3") // Paper - ASM event executor generation + implementation("org.ow2.asm:asm:9.4") ++ implementation("org.ow2.asm:asm-commons:9.4") // Paper - ASM event executor generation implementation("commons-lang:commons-lang:2.6") runtimeOnly("org.xerial:sqlite-jdbc:3.36.0.3") runtimeOnly("mysql:mysql-connector-java:8.0.29") @@ -78,7 +78,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + Date buildDate = new java.text.SimpleDateFormat("yyyy-MM-dd HH:mm:ss Z").parse(Main.class.getPackage().getImplementationVendor()); // Paper Calendar deadline = Calendar.getInstance(); - deadline.add(Calendar.DAY_OF_YEAR, -14); + deadline.add(Calendar.DAY_OF_YEAR, -28); diff --git a/src/main/java/org/bukkit/craftbukkit/util/Versioning.java b/src/main/java/org/bukkit/craftbukkit/util/Versioning.java index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/main/java/org/bukkit/craftbukkit/util/Versioning.java diff --git a/patches/server/Deobfuscate-stacktraces-in-log-messages-crash-report.patch b/patches/server/Deobfuscate-stacktraces-in-log-messages-crash-report.patch index 9e56a8c403..ddd1bbff1f 100644 --- a/patches/server/Deobfuscate-stacktraces-in-log-messages-crash-report.patch +++ b/patches/server/Deobfuscate-stacktraces-in-log-messages-crash-report.patch @@ -16,7 +16,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + annotationProcessor("org.apache.logging.log4j:log4j-core:2.14.1") // Paper - Needed to generate meta for our Log4j plugins // Paper end implementation("org.apache.logging.log4j:log4j-iostreams:2.19.0") // Paper - remove exclusion - implementation("org.ow2.asm:asm:9.3") + implementation("org.ow2.asm:asm:9.4") @@ -0,0 +0,0 @@ dependencies { testImplementation("org.mockito:mockito-core:4.9.0") // Paper - switch to mockito implementation("org.spongepowered:configurate-yaml:4.1.2") // Paper - config files diff --git a/patches/server/Fix-this-stupid-bullshit.patch b/patches/server/Fix-this-stupid-bullshit.patch index e16409d4a9..eb1fcfa21c 100644 --- a/patches/server/Fix-this-stupid-bullshit.patch +++ b/patches/server/Fix-this-stupid-bullshit.patch @@ -36,7 +36,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 +++ b/src/main/java/org/bukkit/craftbukkit/Main.java @@ -0,0 +0,0 @@ public class Main { Calendar deadline = Calendar.getInstance(); - deadline.add(Calendar.DAY_OF_YEAR, -14); + deadline.add(Calendar.DAY_OF_YEAR, -28); if (buildDate.before(deadline.getTime())) { - System.err.println("*** Error, this build is outdated ***"); + // Paper start - This is some stupid bullshit diff --git a/patches/server/Handle-plugin-prefixes-using-Log4J-configuration.patch b/patches/server/Handle-plugin-prefixes-using-Log4J-configuration.patch index 24fdaba277..150d84a271 100644 --- a/patches/server/Handle-plugin-prefixes-using-Log4J-configuration.patch +++ b/patches/server/Handle-plugin-prefixes-using-Log4J-configuration.patch @@ -26,7 +26,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + implementation("org.apache.logging.log4j:log4j-core:2.14.1") // Paper - implementation // Paper end implementation("org.apache.logging.log4j:log4j-iostreams:2.19.0") // Paper - remove exclusion - implementation("org.ow2.asm:asm:9.3") + implementation("org.ow2.asm:asm:9.4") diff --git a/src/main/java/org/spigotmc/SpigotConfig.java b/src/main/java/org/spigotmc/SpigotConfig.java index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/main/java/org/spigotmc/SpigotConfig.java diff --git a/patches/server/Paper-config-files.patch b/patches/server/Paper-config-files.patch index 30d2cec6f7..07918775b5 100644 --- a/patches/server/Paper-config-files.patch +++ b/patches/server/Paper-config-files.patch @@ -18,8 +18,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -0,0 +0,0 @@ dependencies { - implementation("org.ow2.asm:asm:9.3") - implementation("org.ow2.asm:asm-commons:9.3") // Paper - ASM event executor generation + implementation("org.ow2.asm:asm:9.4") + implementation("org.ow2.asm:asm-commons:9.4") // Paper - ASM event executor generation testImplementation("org.mockito:mockito-core:4.9.0") // Paper - switch to mockito + implementation("org.spongepowered:configurate-yaml:4.1.2") // Paper - config files implementation("commons-lang:commons-lang:2.6") diff --git a/patches/server/Remove-garbage-Java-version-check.patch b/patches/server/Remove-garbage-Java-version-check.patch index 422da8db0d..372159f7d1 100644 --- a/patches/server/Remove-garbage-Java-version-check.patch +++ b/patches/server/Remove-garbage-Java-version-check.patch @@ -12,8 +12,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 System.err.println("Unsupported Java detected (" + javaVersion + "). This version of Minecraft requires at least Java 17. Check your Java version with the command 'java -version'."); return; } -- if (javaVersion > 63.0) { -- System.err.println("Unsupported Java detected (" + javaVersion + "). Only up to Java 19 is supported."); +- if (javaVersion > 64.0) { +- System.err.println("Unsupported Java detected (" + javaVersion + "). Only up to Java 20 is supported."); - return; - } diff --git a/patches/server/Setup-Gradle-project.patch b/patches/server/Setup-Gradle-project.patch index d495c5d84d..f383dcc463 100644 --- a/patches/server/Setup-Gradle-project.patch +++ b/patches/server/Setup-Gradle-project.patch @@ -46,7 +46,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + implementation("org.apache.logging.log4j:log4j-iostreams:2.19.0") { + exclude(group = "org.apache.logging.log4j", module = "log4j-api") + } -+ implementation("org.ow2.asm:asm:9.3") ++ implementation("org.ow2.asm:asm:9.4") + implementation("commons-lang:commons-lang:2.6") + runtimeOnly("org.xerial:sqlite-jdbc:3.36.0.3") + runtimeOnly("mysql:mysql-connector-java:8.0.29") @@ -238,7 +238,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 - - org.ow2.asm - asm -- 9.3 +- 9.4 - compile - - @@ -559,19 +559,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 - - org.apache.maven.plugins - maven-shade-plugin -- 3.2.4 -- -- -- org.ow2.asm -- asm -- 9.3 -- -- -- org.ow2.asm -- asm-commons -- 9.3 -- -- +- 3.4.1 - - - package diff --git a/patches/server/Show-Paper-in-client-crashes-server-lists-and-Mojang.patch b/patches/server/Show-Paper-in-client-crashes-server-lists-and-Mojang.patch index 841458cff4..559e975483 100644 --- a/patches/server/Show-Paper-in-client-crashes-server-lists-and-Mojang.patch +++ b/patches/server/Show-Paper-in-client-crashes-server-lists-and-Mojang.patch @@ -36,7 +36,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 --- a/src/main/java/org/bukkit/craftbukkit/Main.java +++ b/src/main/java/org/bukkit/craftbukkit/Main.java @@ -0,0 +0,0 @@ public class Main { - deadline.add(Calendar.DAY_OF_YEAR, -14); + deadline.add(Calendar.DAY_OF_YEAR, -28); if (buildDate.before(deadline.getTime())) { System.err.println("*** Error, this build is outdated ***"); - System.err.println("*** Please download a new build as per instructions from https://www.spigotmc.org/go/outdated-spigot ***"); diff --git a/patches/server/Temp-fix-for-EntityType.translationKey.patch b/patches/server/Temp-fix-for-EntityType.translationKey.patch deleted file mode 100644 index ac71e9a899..0000000000 --- a/patches/server/Temp-fix-for-EntityType.translationKey.patch +++ /dev/null @@ -1,24 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: Shane Freeder -Date: Thu, 16 Feb 2023 03:19:19 +0000 -Subject: [PATCH] Temp fix for EntityType.translationKey() - - -diff --git a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java -index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 ---- a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java -+++ b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java -@@ -0,0 +0,0 @@ public final class CraftMagicNumbers implements UnsafeValues { - - @Override - public String getTranslationKey(EntityType entityType) { -- return net.minecraft.world.entity.EntityType.byString(entityType.name()).map(net.minecraft.world.entity.EntityType::getDescriptionId).orElseThrow(); -+ // Paper start -+ if (entityType.getName() == null || entityType == EntityType.UNKNOWN) { -+ throw new IllegalArgumentException("Cannot lookup translation key of entity type " + entityType); -+ } -+ return net.minecraft.world.entity.EntityType.byString(entityType.getName()).map(net.minecraft.world.entity.EntityType::getDescriptionId).orElseThrow(); -+ // Paper end - } - - @Override diff --git a/patches/server/Test-changes.patch b/patches/server/Test-changes.patch index a431c6e386..d5788c3d13 100644 --- a/patches/server/Test-changes.patch +++ b/patches/server/Test-changes.patch @@ -10,8 +10,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 +++ b/build.gradle.kts @@ -0,0 +0,0 @@ dependencies { implementation("org.apache.logging.log4j:log4j-iostreams:2.19.0") // Paper - remove exclusion - implementation("org.ow2.asm:asm:9.3") - implementation("org.ow2.asm:asm-commons:9.3") // Paper - ASM event executor generation + implementation("org.ow2.asm:asm:9.4") + implementation("org.ow2.asm:asm-commons:9.4") // Paper - ASM event executor generation + testImplementation("org.mockito:mockito-core:4.9.0") // Paper - switch to mockito implementation("commons-lang:commons-lang:2.6") runtimeOnly("org.xerial:sqlite-jdbc:3.36.0.3") diff --git a/patches/server/Use-TerminalConsoleAppender-for-console-improvements.patch b/patches/server/Use-TerminalConsoleAppender-for-console-improvements.patch index 5e2c595120..9db24f1c87 100644 --- a/patches/server/Use-TerminalConsoleAppender-for-console-improvements.patch +++ b/patches/server/Use-TerminalConsoleAppender-for-console-improvements.patch @@ -39,8 +39,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + runtimeOnly("org.apache.logging.log4j:log4j-core:2.14.1") + // Paper end implementation("org.apache.logging.log4j:log4j-iostreams:2.19.0") // Paper - remove exclusion - implementation("org.ow2.asm:asm:9.3") - implementation("org.ow2.asm:asm-commons:9.3") // Paper - ASM event executor generation + implementation("org.ow2.asm:asm:9.4") + implementation("org.ow2.asm:asm-commons:9.4") // Paper - ASM event executor generation diff --git a/src/main/java/com/destroystokyo/paper/console/PaperConsole.java b/src/main/java/com/destroystokyo/paper/console/PaperConsole.java new file mode 100644 index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 diff --git a/work/Bukkit b/work/Bukkit index 37262de84b..6b3c598b97 160000 --- a/work/Bukkit +++ b/work/Bukkit @@ -1 +1 @@ -Subproject commit 37262de84b9613e61809f31691e6f9db48dce0a8 +Subproject commit 6b3c598b975cca10e0027f624dc5115e0f32a0bc diff --git a/work/CraftBukkit b/work/CraftBukkit index a50301aa51..b56426c7ae 160000 --- a/work/CraftBukkit +++ b/work/CraftBukkit @@ -1 +1 @@ -Subproject commit a50301aa51aab7aa25869d921fa0c6a65eeda547 +Subproject commit b56426c7aeb086a363d7a8ee7f228b31249c7fb8 diff --git a/work/Spigot b/work/Spigot index 19641c7577..a2190e302d 160000 --- a/work/Spigot +++ b/work/Spigot @@ -1 +1 @@ -Subproject commit 19641c7577eefd3f47df12167c5e01f449bce47c +Subproject commit a2190e302dde05a08e245990d97fb09184815583