From bcde5dbffe8f310c51c99b7450795b2628544161 Mon Sep 17 00:00:00 2001 From: Nassim Jahnke Date: Sun, 5 Jun 2022 10:43:06 +0200 Subject: [PATCH] Updated Upstream (Bukkit/CraftBukkit) (#7875) 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: 6a039faf PR-745: Expose more information about advancements 52148c47 PR-749: Various javadoc improvements 23c2d841 PR-748: Remove permissible recalculation from Permission constructor CraftBukkit Changes: a59dc59e SPIGOT-7025: Use existing item in hand for ranged Drowned attack e4cca0ca PR-1050: Expose more information about advancements --- patches/api/Add-PlayerKickEvent-causes.patch | 2 +- patches/api/Add-advancement-display-API.patch | 30 +++++++++++++++---- patches/api/Adventure.patch | 2 +- .../server/Add-advancement-display-API.patch | 14 +++++---- ...owned-for-Villager-Aggression-Config.patch | 2 +- work/Bukkit | 2 +- work/CraftBukkit | 2 +- 7 files changed, 39 insertions(+), 15 deletions(-) diff --git a/patches/api/Add-PlayerKickEvent-causes.patch b/patches/api/Add-PlayerKickEvent-causes.patch index c0deac3bd7..bfc9033594 100644 --- a/patches/api/Add-PlayerKickEvent-causes.patch +++ b/patches/api/Add-PlayerKickEvent-causes.patch @@ -32,7 +32,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 private net.kyori.adventure.text.Component leaveMessage; // Paper private net.kyori.adventure.text.Component kickReason; // Paper + private final Cause cause; // Paper - private Boolean cancel; + private boolean cancel; @Deprecated // Paper @@ -0,0 +0,0 @@ public class PlayerKickEvent extends PlayerEvent implements Cancellable { diff --git a/patches/api/Add-advancement-display-API.patch b/patches/api/Add-advancement-display-API.patch index d6c1d872a2..37ad5824a9 100644 --- a/patches/api/Add-advancement-display-API.patch +++ b/patches/api/Add-advancement-display-API.patch @@ -171,16 +171,18 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 --- a/src/main/java/org/bukkit/advancement/Advancement.java +++ b/src/main/java/org/bukkit/advancement/Advancement.java @@ -0,0 +0,0 @@ public interface Advancement extends Keyed { - */ @NotNull Collection getCriteria(); + + // Paper start -+ /** + /** +- * Returns the display information for this advancement. + * Get the display info of this advancement. + *

+ * Will be {@code null} when totally hidden, for example with crafting + * recipes. -+ * + * +- * This includes it's name, description and other visible tags. + * @return the display info + */ + @org.jetbrains.annotations.Nullable @@ -196,9 +198,12 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + + /** + * Gets all the direct children advancements. -+ * + * +- * @return a AdvancementDisplay object, or null if not set. + * @return the children advancements -+ */ + */ +- @Nullable +- AdvancementDisplay getDisplay(); + @NotNull + @org.jetbrains.annotations.Unmodifiable + Collection getChildren(); @@ -212,3 +217,18 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + Advancement getRoot(); + // Paper end } +diff --git a/src/main/java/org/bukkit/advancement/AdvancementDisplay.java b/src/main/java/org/bukkit/advancement/AdvancementDisplay.java +index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 +--- a/src/main/java/org/bukkit/advancement/AdvancementDisplay.java ++++ b/src/main/java/org/bukkit/advancement/AdvancementDisplay.java +@@ -0,0 +0,0 @@ import org.jetbrains.annotations.NotNull; + + /** + * Holds information about how the advancement is displayed by the game. ++ * ++ * @deprecated use {@link io.papermc.paper.advancement.AdvancementDisplay} + */ ++@Deprecated(forRemoval = true) // Paper + public interface AdvancementDisplay { + + /** diff --git a/patches/api/Adventure.patch b/patches/api/Adventure.patch index e2e56b69c5..8b7e0e7679 100644 --- a/patches/api/Adventure.patch +++ b/patches/api/Adventure.patch @@ -2697,7 +2697,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 - private String kickReason; + private net.kyori.adventure.text.Component leaveMessage; // Paper + private net.kyori.adventure.text.Component kickReason; // Paper - private Boolean cancel; + private boolean cancel; + @Deprecated // Paper public PlayerKickEvent(@NotNull final Player playerKicked, @NotNull final String kickReason, @NotNull final String leaveMessage) { diff --git a/patches/server/Add-advancement-display-API.patch b/patches/server/Add-advancement-display-API.patch index e6c4bd3548..5a47c28bbb 100644 --- a/patches/server/Add-advancement-display-API.patch +++ b/patches/server/Add-advancement-display-API.patch @@ -90,11 +90,14 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 --- a/src/main/java/org/bukkit/craftbukkit/advancement/CraftAdvancement.java +++ b/src/main/java/org/bukkit/craftbukkit/advancement/CraftAdvancement.java @@ -0,0 +0,0 @@ public class CraftAdvancement implements org.bukkit.advancement.Advancement { - public Collection getCriteria() { return Collections.unmodifiableCollection(this.handle.getCriteria().keySet()); } + + // Paper start -+ @Override + @Override +- public AdvancementDisplay getDisplay() { +- if (this.handle.getDisplay() == null) { +- return null; + public io.papermc.paper.advancement.AdvancementDisplay getDisplay() { + return this.handle.getDisplay() == null ? null : this.handle.getDisplay().paper; + } @@ -109,10 +112,11 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + final var children = com.google.common.collect.ImmutableList.builder(); + for (Advancement advancement : this.handle.getChildren()) { + children.add(advancement.bukkit); -+ } + } + return children.build(); + } -+ + +- return new CraftAdvancementDisplay(this.handle.getDisplay()); + @Override + public org.bukkit.advancement.Advancement getRoot() { + Advancement advancement = this.handle; @@ -120,7 +124,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + advancement = advancement.getParent(); + } + return advancement.bukkit; -+ } + } + // Paper end } diff --git a/src/test/java/io/papermc/paper/advancement/AdvancementFrameTest.java b/src/test/java/io/papermc/paper/advancement/AdvancementFrameTest.java diff --git a/patches/server/Check-Drowned-for-Villager-Aggression-Config.patch b/patches/server/Check-Drowned-for-Villager-Aggression-Config.patch index c059c2d3e9..e43addaffe 100644 --- a/patches/server/Check-Drowned-for-Villager-Aggression-Config.patch +++ b/patches/server/Check-Drowned-for-Villager-Aggression-Config.patch @@ -10,7 +10,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 +++ b/src/main/java/net/minecraft/world/entity/monster/Drowned.java @@ -0,0 +0,0 @@ public class Drowned extends Zombie implements RangedAttackMob { this.goalSelector.addGoal(7, new RandomStrollGoal(this, 1.0D)); - this.targetSelector.addGoal(1, (new HurtByTargetGoal(this, Drowned.class)).setAlertOthers(ZombifiedPiglin.class)); + this.targetSelector.addGoal(1, (new HurtByTargetGoal(this, new Class[]{Drowned.class})).setAlertOthers(ZombifiedPiglin.class)); this.targetSelector.addGoal(2, new NearestAttackableTargetGoal<>(this, Player.class, 10, true, false, this::okTarget)); - this.targetSelector.addGoal(3, new NearestAttackableTargetGoal<>(this, AbstractVillager.class, false)); + if (this.level.spigotConfig.zombieAggressiveTowardsVillager) this.targetSelector.addGoal(3, new NearestAttackableTargetGoal<>(this, AbstractVillager.class, false)); // Paper diff --git a/work/Bukkit b/work/Bukkit index d565a710e0..6a039faf74 160000 --- a/work/Bukkit +++ b/work/Bukkit @@ -1 +1 @@ -Subproject commit d565a710e0d16d31b6b7db8009a227aba68348fa +Subproject commit 6a039faf7488beba29527a112404cbab84d0cbd3 diff --git a/work/CraftBukkit b/work/CraftBukkit index 9d46b56e26..a59dc59e88 160000 --- a/work/CraftBukkit +++ b/work/CraftBukkit @@ -1 +1 @@ -Subproject commit 9d46b56e26f3e91392572f6dccec7bfdbd5728c6 +Subproject commit a59dc59e88299b03b52335d95f83a880f131e3a4