From 1b571414da3cdf126a4694507fc5a52c678b76cf Mon Sep 17 00:00:00 2001 From: Nassim Jahnke Date: Tue, 6 Jun 2023 11:09:19 +0200 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: 5dbedae1 PR-864: Fix Registry#match() failing namespaced inputs 49256865 PR-863: Fix boolean PersistentDataType 9f15450b SPIGOT-7195, SPIGOT-7197: Add DataPack API ebef5b6a Disable InterfaceIsType Checkstyle check 01d577f5 Slight tweak to boolean PersistentDataType javadoc d2b99e56 PR-857: Add boolean PersistentDataType CraftBukkit Changes: 2270366cd PR-1196: Test Registry instances more thoroughly 863dacb7a PR-1191: Do not start on pre-release Java 17 1f2dd8e12 SPIGOT-7362: Properly handle null in CraftBlock#blockFaceToNotch() dbc70bed5 SPIGOT-7195, SPIGOT-7197: Add DataPack API --- patches/api/Add-basic-Datapack-API.patch | 54 +++++++++++++++++++ .../Add-methods-to-get-translation-keys.patch | 7 ++- patches/api/Adventure.patch | 2 +- .../api/Get-entity-default-attributes.patch | 3 +- patches/api/Paper-Plugins.patch | 4 +- patches/server/Paper-Plugins.patch | 4 +- .../Remove-garbage-Java-version-check.patch | 6 +-- patches/server/Timings-v2.patch | 2 +- work/Bukkit | 2 +- work/CraftBukkit | 2 +- 10 files changed, 72 insertions(+), 14 deletions(-) diff --git a/patches/api/Add-basic-Datapack-API.patch b/patches/api/Add-basic-Datapack-API.patch index e8e7f31e11..fba79a422d 100644 --- a/patches/api/Add-basic-Datapack-API.patch +++ b/patches/api/Add-basic-Datapack-API.patch @@ -73,6 +73,18 @@ diff --git a/src/main/java/org/bukkit/Bukkit.java b/src/main/java/org/bukkit/Buk index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/main/java/org/bukkit/Bukkit.java +++ b/src/main/java/org/bukkit/Bukkit.java +@@ -0,0 +0,0 @@ public final class Bukkit { + /** + * Get the DataPack Manager. + * ++ * @deprecated use {@link #getDatapackManager()} + * @return the manager + */ + @NotNull ++ @Deprecated(forRemoval = true) + public static DataPackManager getDataPackManager() { + return server.getDataPackManager(); + } @@ -0,0 +0,0 @@ public final class Bukkit { public static com.destroystokyo.paper.entity.ai.MobGoals getMobGoals() { return server.getMobGoals(); @@ -92,6 +104,18 @@ diff --git a/src/main/java/org/bukkit/Server.java b/src/main/java/org/bukkit/Ser index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/main/java/org/bukkit/Server.java +++ b/src/main/java/org/bukkit/Server.java +@@ -0,0 +0,0 @@ public interface Server extends PluginMessageRecipient, net.kyori.adventure.audi + /** + * Get the DataPack Manager. + * ++ * @deprecated use {@link #getDatapackManager()} + * @return the manager + */ + @NotNull ++ @Deprecated(forRemoval = true) // Paper + public DataPackManager getDataPackManager(); + + /** @@ -0,0 +0,0 @@ public interface Server extends PluginMessageRecipient, net.kyori.adventure.audi */ @NotNull @@ -104,3 +128,33 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + io.papermc.paper.datapack.DatapackManager getDatapackManager(); // Paper end } +diff --git a/src/main/java/org/bukkit/packs/DataPack.java b/src/main/java/org/bukkit/packs/DataPack.java +index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 +--- a/src/main/java/org/bukkit/packs/DataPack.java ++++ b/src/main/java/org/bukkit/packs/DataPack.java +@@ -0,0 +0,0 @@ import org.jetbrains.annotations.NotNull; + + /** + * Represents a data pack. ++ * @deprecated use {@link io.papermc.paper.datapack.Datapack} + */ + @ApiStatus.Experimental ++@Deprecated(forRemoval = true) // Paper + public interface DataPack extends Keyed { + + /** +diff --git a/src/main/java/org/bukkit/packs/DataPackManager.java b/src/main/java/org/bukkit/packs/DataPackManager.java +index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 +--- a/src/main/java/org/bukkit/packs/DataPackManager.java ++++ b/src/main/java/org/bukkit/packs/DataPackManager.java +@@ -0,0 +0,0 @@ import org.jetbrains.annotations.Nullable; + + /** + * Manager of data packs. ++ * @deprecated use {@link io.papermc.paper.datapack.DatapackManager} + */ + @ApiStatus.Experimental ++@Deprecated(forRemoval = true) // Paper + public interface DataPackManager { + + /** diff --git a/patches/api/Add-methods-to-get-translation-keys.patch b/patches/api/Add-methods-to-get-translation-keys.patch index 0461e0fb1d..e8f7629ea9 100644 --- a/patches/api/Add-methods-to-get-translation-keys.patch +++ b/patches/api/Add-methods-to-get-translation-keys.patch @@ -331,7 +331,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 public String getTranslationKey() { return Bukkit.getUnsafe().getTranslationKey(this); } -+ + + // Paper start + /** + * @throws IllegalArgumentException if the entity does not have a translation key (is probably a custom entity) @@ -342,7 +342,10 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + return org.bukkit.Bukkit.getUnsafe().getTranslationKey(this); + } + // Paper end - } ++ + /** + * Gets if this EntityType is enabled by feature in a world. + * diff --git a/src/main/java/org/bukkit/entity/Villager.java b/src/main/java/org/bukkit/entity/Villager.java index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/main/java/org/bukkit/entity/Villager.java diff --git a/patches/api/Adventure.patch b/patches/api/Adventure.patch index 9c42b966a2..703d0ff3db 100644 --- a/patches/api/Adventure.patch +++ b/patches/api/Adventure.patch @@ -1429,7 +1429,7 @@ diff --git a/src/main/java/org/bukkit/UnsafeValues.java b/src/main/java/org/bukk index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/main/java/org/bukkit/UnsafeValues.java +++ b/src/main/java/org/bukkit/UnsafeValues.java -@@ -0,0 +0,0 @@ import org.bukkit.plugin.PluginDescriptionFile; +@@ -0,0 +0,0 @@ import org.jetbrains.annotations.Nullable; */ @Deprecated public interface UnsafeValues { diff --git a/patches/api/Get-entity-default-attributes.patch b/patches/api/Get-entity-default-attributes.patch index c963c456b3..8c4f5849f5 100644 --- a/patches/api/Get-entity-default-attributes.patch +++ b/patches/api/Get-entity-default-attributes.patch @@ -59,4 +59,5 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + return org.bukkit.Bukkit.getUnsafe().getDefaultEntityAttributes(this.key); + } // Paper end - } + + /** diff --git a/patches/api/Paper-Plugins.patch b/patches/api/Paper-Plugins.patch index 404ad7c49c..96b1fdc3a7 100644 --- a/patches/api/Paper-Plugins.patch +++ b/patches/api/Paper-Plugins.patch @@ -1322,9 +1322,9 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 --- a/src/main/java/org/bukkit/UnsafeValues.java +++ b/src/main/java/org/bukkit/UnsafeValues.java @@ -0,0 +0,0 @@ public interface UnsafeValues { - String getTranslationKey(EntityType entityType); - String getTranslationKey(ItemStack itemStack); + @Nullable + FeatureFlag getFeatureFlag(@NotNull NamespacedKey key); + + // Paper start + @Deprecated(forRemoval = true) diff --git a/patches/server/Paper-Plugins.patch b/patches/server/Paper-Plugins.patch index 784453d294..41d48746d9 100644 --- a/patches/server/Paper-Plugins.patch +++ b/patches/server/Paper-Plugins.patch @@ -6853,8 +6853,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + } + // Paper end - /** - * This helper class represents the different NBT Tags. + @Override + public FeatureFlag getFeatureFlag(NamespacedKey namespacedKey) { diff --git a/src/main/resources/META-INF/services/io.papermc.paper.plugin.entrypoint.classloader.ClassloaderBytecodeModifier b/src/main/resources/META-INF/services/io.papermc.paper.plugin.entrypoint.classloader.ClassloaderBytecodeModifier new file mode 100644 index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 diff --git a/patches/server/Remove-garbage-Java-version-check.patch b/patches/server/Remove-garbage-Java-version-check.patch index 372159f7d1..7141c6e0e0 100644 --- a/patches/server/Remove-garbage-Java-version-check.patch +++ b/patches/server/Remove-garbage-Java-version-check.patch @@ -16,6 +16,6 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 - System.err.println("Unsupported Java detected (" + javaVersion + "). Only up to Java 20 is supported."); - return; - } - - try { - // Paper start - Handled by TerminalConsoleAppender + String javaVersionName = System.getProperty("java.version"); + // J2SE SDK/JRE Version String Naming Convention + boolean isPreRelease = javaVersionName.contains("-"); diff --git a/patches/server/Timings-v2.patch b/patches/server/Timings-v2.patch index 8cf9dbc4d6..e6fb378632 100644 --- a/patches/server/Timings-v2.patch +++ b/patches/server/Timings-v2.patch @@ -2063,8 +2063,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 public static byte toLegacyData(BlockState data) { return CraftLegacy.toLegacyData(data); @@ -0,0 +0,0 @@ public final class CraftMagicNumbers implements UnsafeValues { + return CraftFeatureFlag.getFromNMS(namespacedKey); } - // Paper end + // Paper start + @Override diff --git a/work/Bukkit b/work/Bukkit index 4727d326da..5dbedae1cb 160000 --- a/work/Bukkit +++ b/work/Bukkit @@ -1 +1 @@ -Subproject commit 4727d326da2bcd87ae2a6e6d6dd0cc5249c0288f +Subproject commit 5dbedae1cbbc70791dcfc374c4c8da35db309a44 diff --git a/work/CraftBukkit b/work/CraftBukkit index b346a5f6dd..2270366cdd 160000 --- a/work/CraftBukkit +++ b/work/CraftBukkit @@ -1 +1 @@ -Subproject commit b346a5f6dd890c8ecfff2323082a8178c4fffa62 +Subproject commit 2270366cdd98ff02eaa62212b7881084feadd764