From ec93ec97e67b5c3a4539804fd3c8f4e3bad488e8 Mon Sep 17 00:00:00 2001 From: Nassim Jahnke <nassim@njahnke.dev> Date: Sat, 9 Nov 2024 17:01:35 +0100 Subject: [PATCH] Updated Upstream (Bukkit/CraftBukkit) 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: a6aba46f PR-1078: Improve Javadocs of Player#loadData() and Player#saveData() 1e2e6a18 SPIGOT-7946: API for server pause when empty seconds 54a36938 SPIGOT-7944, PR-1077: Allow nullable fields in DamageTypeTags CraftBukkit Changes: 2702c5c8e SPIGOT-7946: API for server pause when empty seconds 485f910fc SPIGOT-7947: addPassenger doesn't work if the vehicle is a player ecf3dff0e SPIGOT-7949: Registering a new scoreboard objective with an empty display name throws a NPE 9b048cc84 SPIGOT-7948: `Bukkit#dispatchCommand` uses the wrong `CommandListenerWrapper` for Players 7b44d4640 SPIGOT-7931: Fix sync in Anvil View when result item is taken --- patches/api/Fix-upstream-javadocs.patch | 26 ++++++++++++++++--- patches/api/fix-DamageTypeTags-init.patch | 21 --------------- patches/server/Adventure.patch | 2 +- .../server/Brigadier-based-command-API.patch | 4 +-- work/Bukkit | 2 +- work/CraftBukkit | 2 +- 6 files changed, 27 insertions(+), 30 deletions(-) delete mode 100644 patches/api/fix-DamageTypeTags-init.patch diff --git a/patches/api/Fix-upstream-javadocs.patch b/patches/api/Fix-upstream-javadocs.patch index 38105436ab..e0091fb9d4 100644 --- a/patches/api/Fix-upstream-javadocs.patch +++ b/patches/api/Fix-upstream-javadocs.patch @@ -61,6 +61,15 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 * * @return an array containing all previous players */ +@@ -0,0 +0,0 @@ public final class Bukkit { + * server will pause most functions after this time if there are no players + * online. + * <p> +- * A value of less than 0 will disable the setting ++ * A value of less than 1 will disable the setting + * + * @param seconds the pause threshold in seconds + */ diff --git a/src/main/java/org/bukkit/ChunkSnapshot.java b/src/main/java/org/bukkit/ChunkSnapshot.java index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/main/java/org/bukkit/ChunkSnapshot.java @@ -168,6 +177,15 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 * * @return an array containing all previous players */ +@@ -0,0 +0,0 @@ public interface Server extends PluginMessageRecipient, net.kyori.adventure.audi + * Sets the pause when empty threshold seconds. To save resources, the + * pause most functions after this time if there are no players online. + * <p> +- * A value of less than 0 will disable the setting ++ * A value of less than 1 will disable the setting + * + * @param seconds the pause threshold in seconds + */ diff --git a/src/main/java/org/bukkit/World.java b/src/main/java/org/bukkit/World.java index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/main/java/org/bukkit/World.java @@ -507,8 +525,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 /** * Saves the players current location, health, inventory, motion, and -- * other information into the username.dat file, in the world/player -- * folder +- * other information into the uuid.dat file, in the <main +- * world>/playerdata folder. + * other information into the <uuid>.dat file, in the + * <level-name>/playerdata/ folder. */ @@ -516,8 +534,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 /** * Loads the players current location, health, inventory, motion, and -- * other information from the username.dat file, in the world/player -- * folder. +- * other information from the uuid.dat file, in the <main +- * world>/playerdata folder. + * other information from the <uuid>.dat file, in the + * <level-name>/playerdata/ folder. * <p> diff --git a/patches/api/fix-DamageTypeTags-init.patch b/patches/api/fix-DamageTypeTags-init.patch deleted file mode 100644 index a570fe0b56..0000000000 --- a/patches/api/fix-DamageTypeTags-init.patch +++ /dev/null @@ -1,21 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: Lulu13022002 <41980282+Lulu13022002@users.noreply.github.com> -Date: Sat, 26 Oct 2024 19:29:41 +0200 -Subject: [PATCH] fix DamageTypeTags init - - -diff --git a/src/main/java/org/bukkit/tag/DamageTypeTags.java b/src/main/java/org/bukkit/tag/DamageTypeTags.java -index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 ---- a/src/main/java/org/bukkit/tag/DamageTypeTags.java -+++ b/src/main/java/org/bukkit/tag/DamageTypeTags.java -@@ -0,0 +0,0 @@ public final class DamageTypeTags { - @ApiStatus.Internal - public static final String REGISTRY_DAMAGE_TYPES = "damage_types"; - -- @NotNull - private static Tag<DamageType> getTag(String key) { -- return Objects.requireNonNull(Bukkit.getTag(REGISTRY_DAMAGE_TYPES, NamespacedKey.minecraft(key), DamageType.class)); -+ return Bukkit.getTag(REGISTRY_DAMAGE_TYPES, NamespacedKey.minecraft(key), DamageType.class); // Paper - bypasses_cooldown is not defined in vanilla - } - - private DamageTypeTags() { diff --git a/patches/server/Adventure.patch b/patches/server/Adventure.patch index a3802a51b8..48750ba305 100644 --- a/patches/server/Adventure.patch +++ b/patches/server/Adventure.patch @@ -5518,7 +5518,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 - Preconditions.checkArgument(name.length() <= Short.MAX_VALUE, "The name '%s' is longer than the limit of 32767 characters (%s)", name, name.length()); - Preconditions.checkArgument(this.board.getObjective(name) == null, "An objective of name '%s' already exists", name); - -- net.minecraft.world.scores.Objective objective = this.board.addObjective(name, ((CraftCriteria) criteria).criteria, CraftChatMessage.fromStringOrNull(displayName), CraftScoreboardTranslations.fromBukkitRender(renderType), true, null); +- net.minecraft.world.scores.Objective objective = this.board.addObjective(name, ((CraftCriteria) criteria).criteria, CraftChatMessage.fromStringOrEmpty(displayName), CraftScoreboardTranslations.fromBukkitRender(renderType), true, null); - return new CraftObjective(this, objective); + return this.registerNewObjective(name, criteria, net.kyori.adventure.text.serializer.legacy.LegacyComponentSerializer.legacySection().deserialize(displayName), renderType); // Paper - Adventure } diff --git a/patches/server/Brigadier-based-command-API.patch b/patches/server/Brigadier-based-command-API.patch index d97916ff36..1c16b26585 100644 --- a/patches/server/Brigadier-based-command-API.patch +++ b/patches/server/Brigadier-based-command-API.patch @@ -2562,8 +2562,8 @@ diff --git a/src/main/java/org/bukkit/craftbukkit/command/VanillaCommandWrapper. index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/main/java/org/bukkit/craftbukkit/command/VanillaCommandWrapper.java +++ b/src/main/java/org/bukkit/craftbukkit/command/VanillaCommandWrapper.java -@@ -0,0 +0,0 @@ import org.bukkit.craftbukkit.entity.CraftEntity; - import org.bukkit.craftbukkit.entity.CraftMinecartCommand; +@@ -0,0 +0,0 @@ import org.bukkit.craftbukkit.entity.CraftMinecartCommand; + import org.bukkit.craftbukkit.entity.CraftPlayer; import org.bukkit.entity.minecart.CommandMinecart; -public final class VanillaCommandWrapper extends BukkitCommand { diff --git a/work/Bukkit b/work/Bukkit index b9df8e9f23..a6aba46fe6 160000 --- a/work/Bukkit +++ b/work/Bukkit @@ -1 +1 @@ -Subproject commit b9df8e9f23bd025e9f99e9ebe0d46deff75717a5 +Subproject commit a6aba46fe6679624f7c9cbeb6c2d1be63156e6bb diff --git a/work/CraftBukkit b/work/CraftBukkit index df1efc0bbf..2702c5c8e5 160000 --- a/work/CraftBukkit +++ b/work/CraftBukkit @@ -1 +1 @@ -Subproject commit df1efc0bbfc40d10132d440345c8b28aa7130909 +Subproject commit 2702c5c8e5e1a9e3d231d9006afa80333c84caa4