From a36d7f64273674d013d0c0f8adc0f716f174fd86 Mon Sep 17 00:00:00 2001 From: Nassim Jahnke Date: Sun, 6 Mar 2022 09:08:26 +0100 Subject: [PATCH] Updated Upstream (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 CraftBukkit Changes: 808cb7ca PR-1023: Improve consistency of tag API --- .../0175-Fix-Spigot-annotation-mistakes.patch | 11 +------ patches/server/0004-Paper-config-files.patch | 6 ++-- patches/server/0008-Adventure.patch | 4 +-- patches/server/0012-Timings-v2.patch | 4 +-- ...026-Further-improve-server-tick-loop.patch | 4 +-- ...llow-Reloading-of-Custom-Permissions.patch | 4 +-- ...3-Allow-Reloading-of-Command-Aliases.patch | 4 +-- ...n-option-to-prevent-player-names-fro.patch | 6 ++-- .../server/0144-Basic-PlayerProfile-API.patch | 4 +-- ...ault-permission-message-configurable.patch | 6 ++-- ...332-Expose-the-internal-current-tick.patch | 4 +-- ...-Add-tick-times-API-and-mspt-command.patch | 6 ++-- ...382-Expose-MinecraftServer-isRunning.patch | 4 +-- .../server/0419-Implement-Mob-Goal-API.patch | 6 ++-- .../server/0654-Add-basic-Datapack-API.patch | 4 +-- patches/server/0864-Add-GameEvent-tags.patch | 33 ++++++++++--------- patches/server/0874-Custom-Potion-Mixes.patch | 4 +-- work/CraftBukkit | 2 +- 18 files changed, 55 insertions(+), 61 deletions(-) diff --git a/patches/api/0175-Fix-Spigot-annotation-mistakes.patch b/patches/api/0175-Fix-Spigot-annotation-mistakes.patch index 2c003d5e6e..37bddf2bab 100644 --- a/patches/api/0175-Fix-Spigot-annotation-mistakes.patch +++ b/patches/api/0175-Fix-Spigot-annotation-mistakes.patch @@ -62,7 +62,7 @@ index 88b3e0323dbc4f0fce31b147c7aaa08d65745852..23ca89dde7f6ac9082d4b97fce295942 if (this.world == null) { return null; diff --git a/src/main/java/org/bukkit/Server.java b/src/main/java/org/bukkit/Server.java -index f43720d07e80e3d2937f5b271664b5268d7af027..49bcc2edea32ef2b31b9ed5c3a62140bcc81ffc9 100644 +index f43720d07e80e3d2937f5b271664b5268d7af027..4cd7dae2e6f530a402de460f61d57a27f5763b73 100644 --- a/src/main/java/org/bukkit/Server.java +++ b/src/main/java/org/bukkit/Server.java @@ -1429,7 +1429,7 @@ public interface Server extends PluginMessageRecipient, net.kyori.adventure.audi @@ -73,15 +73,6 @@ index f43720d07e80e3d2937f5b271664b5268d7af027..49bcc2edea32ef2b31b9ed5c3a62140b + @NotNull // Paper ScoreboardManager getScoreboardManager(); - /** -@@ -1699,7 +1699,7 @@ public interface Server extends PluginMessageRecipient, net.kyori.adventure.audi - * @param clazz the class of the tag entries - * @return the tag or null - */ -- @Nullable -+ @UndefinedNullability // Paper - Tag getTag(@NotNull String registry, @NotNull NamespacedKey tag, @NotNull Class clazz); - /** diff --git a/src/main/java/org/bukkit/entity/LingeringPotion.java b/src/main/java/org/bukkit/entity/LingeringPotion.java index f124b35ec76e6cb6a1a0dc464005087043c3efd0..94a2fef0dc9e13c754cd31d5eabc1bde2dbbe6a5 100644 diff --git a/patches/server/0004-Paper-config-files.patch b/patches/server/0004-Paper-config-files.patch index 6be759aa38..a18a8baed9 100644 --- a/patches/server/0004-Paper-config-files.patch +++ b/patches/server/0004-Paper-config-files.patch @@ -629,7 +629,7 @@ index 9e4cca119722c2edc478fdd1a34af4370649aa5c..b49528d8a2c577def4f74ee694ffd53b 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 2a7a6a21d22bec6457845ec972f12321f534800f..8754e5899067bc5e8e83a6264c6fcc38846f6baa 100644 +index 9d38f78ba0db10578cfbcce29059e108272d0034..89522ebf7b11801cf8b9893a1bae50a1ee88ff79 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java @@ -603,6 +603,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop) new CraftEntityTag(Registry.ENTITY_TYPE, TagKey.create(Registry.ENTITY_TYPE_REGISTRY, key)); +@@ -2551,6 +2552,15 @@ public final class CraftServer implements Server { + return (org.bukkit.Tag) new CraftEntityTag(Registry.ENTITY_TYPE, entityTagKey); + } + } + // Paper start -+ case org.bukkit.Tag.REGISTRY_GAME_EVENTS: ++ case org.bukkit.Tag.REGISTRY_GAME_EVENTS -> { + Preconditions.checkArgument(clazz == org.bukkit.GameEvent.class, "Game Event namespace must have GameEvent type"); -+ -+ return (org.bukkit.Tag) new io.papermc.paper.CraftGameEventTag(Registry.GAME_EVENT, TagKey.create(Registry.GAME_EVENT_REGISTRY, key)); ++ TagKey gameEventTagKey = TagKey.create(Registry.GAME_EVENT_REGISTRY, key); ++ if (Registry.GAME_EVENT.isKnownTagName(gameEventTagKey)) { ++ return (org.bukkit.Tag) new io.papermc.paper.CraftGameEventTag(Registry.GAME_EVENT, gameEventTagKey); ++ } ++ } + // Paper end - default: - throw new IllegalArgumentException(); + default -> throw new IllegalArgumentException(); } -@@ -2565,6 +2572,13 @@ public final class CraftServer implements Server { +@@ -2583,6 +2593,13 @@ public final class CraftServer implements Server { Registry> entityTags = Registry.ENTITY_TYPE; return entityTags.getTags().map(pair -> (org.bukkit.Tag) new CraftEntityTag(entityTags, pair.getFirst())).collect(ImmutableList.toImmutableList()); + } + // Paper start -+ case org.bukkit.Tag.REGISTRY_GAME_EVENTS: ++ case org.bukkit.Tag.REGISTRY_GAME_EVENTS -> { + Preconditions.checkArgument(clazz == org.bukkit.GameEvent.class); -+ + Registry gameEvents = Registry.GAME_EVENT; + return gameEvents.getTags().map(pair -> (org.bukkit.Tag) new io.papermc.paper.CraftGameEventTag(gameEvents, pair.getFirst())).collect(ImmutableList.toImmutableList()); + // Paper end - default: - throw new IllegalArgumentException(); ++ } + default -> throw new IllegalArgumentException(); } + } diff --git a/patches/server/0874-Custom-Potion-Mixes.patch b/patches/server/0874-Custom-Potion-Mixes.patch index 24db733c51..31003aba09 100644 --- a/patches/server/0874-Custom-Potion-Mixes.patch +++ b/patches/server/0874-Custom-Potion-Mixes.patch @@ -164,7 +164,7 @@ index 287205bce7f655f9a6b815f40d349c3db4c1e788..5c0f1488c8a8100cd39a03adeccded99 @Override diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -index 5c6f70250339c83cd4f4af4d3ae4801000eab3a3..7343bd96a4a15f4abc081e565175db8df930a470 100644 +index 278a025f141b2011dc2b4e35e70a8013b918a33e..55c981f2c8070fc1bd9ecd4f4df140d9d0c68319 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java @@ -284,6 +284,7 @@ public final class CraftServer implements Server { @@ -184,7 +184,7 @@ index 5c6f70250339c83cd4f4af4d3ae4801000eab3a3..7343bd96a4a15f4abc081e565175db8d MobEffects.BLINDNESS.getClass(); PotionEffectType.stopAcceptingRegistrations(); // Ugly hack :( -@@ -2826,5 +2827,10 @@ public final class CraftServer implements Server { +@@ -2846,5 +2847,10 @@ public final class CraftServer implements Server { return datapackManager; } diff --git a/work/CraftBukkit b/work/CraftBukkit index 4ed5af5e63..808cb7ca5c 160000 --- a/work/CraftBukkit +++ b/work/CraftBukkit @@ -1 +1 @@ -Subproject commit 4ed5af5e63dea4884c9466901b4bfb0996455f7e +Subproject commit 808cb7ca5c135e65e2d23e8ab59ee891b5bc53dc