13
0
geforkt von Mirrors/Paper

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
Dieser Commit ist enthalten in:
Nassim Jahnke 2022-06-05 10:43:06 +02:00
Ursprung 693f001b92
Commit bcde5dbffe
7 geänderte Dateien mit 39 neuen und 15 gelöschten Zeilen

Datei anzeigen

@ -32,7 +32,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
private net.kyori.adventure.text.Component leaveMessage; // Paper private net.kyori.adventure.text.Component leaveMessage; // Paper
private net.kyori.adventure.text.Component kickReason; // Paper private net.kyori.adventure.text.Component kickReason; // Paper
+ private final Cause cause; // Paper + private final Cause cause; // Paper
private Boolean cancel; private boolean cancel;
@Deprecated // Paper @Deprecated // Paper
@@ -0,0 +0,0 @@ public class PlayerKickEvent extends PlayerEvent implements Cancellable { @@ -0,0 +0,0 @@ public class PlayerKickEvent extends PlayerEvent implements Cancellable {

Datei anzeigen

@ -171,16 +171,18 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
--- a/src/main/java/org/bukkit/advancement/Advancement.java --- a/src/main/java/org/bukkit/advancement/Advancement.java
+++ b/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 { @@ -0,0 +0,0 @@ public interface Advancement extends Keyed {
*/
@NotNull @NotNull
Collection<String> getCriteria(); Collection<String> getCriteria();
+ // Paper start + // Paper start
+ /** /**
- * Returns the display information for this advancement.
+ * Get the display info of this advancement. + * Get the display info of this advancement.
+ * <p> + * <p>
+ * Will be {@code null} when totally hidden, for example with crafting + * Will be {@code null} when totally hidden, for example with crafting
+ * recipes. + * recipes.
+ * *
- * This includes it's name, description and other visible tags.
+ * @return the display info + * @return the display info
+ */ + */
+ @org.jetbrains.annotations.Nullable + @org.jetbrains.annotations.Nullable
@ -196,9 +198,12 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ +
+ /** + /**
+ * Gets all the direct children advancements. + * Gets all the direct children advancements.
+ * *
- * @return a AdvancementDisplay object, or null if not set.
+ * @return the children advancements + * @return the children advancements
+ */ */
- @Nullable
- AdvancementDisplay getDisplay();
+ @NotNull + @NotNull
+ @org.jetbrains.annotations.Unmodifiable + @org.jetbrains.annotations.Unmodifiable
+ Collection<Advancement> getChildren(); + Collection<Advancement> getChildren();
@ -212,3 +217,18 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ Advancement getRoot(); + Advancement getRoot();
+ // Paper end + // 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 {
/**

Datei anzeigen

@ -2697,7 +2697,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
- private String kickReason; - private String kickReason;
+ private net.kyori.adventure.text.Component leaveMessage; // Paper + private net.kyori.adventure.text.Component leaveMessage; // Paper
+ private net.kyori.adventure.text.Component kickReason; // Paper + private net.kyori.adventure.text.Component kickReason; // Paper
private Boolean cancel; private boolean cancel;
+ @Deprecated // Paper + @Deprecated // Paper
public PlayerKickEvent(@NotNull final Player playerKicked, @NotNull final String kickReason, @NotNull final String leaveMessage) { public PlayerKickEvent(@NotNull final Player playerKicked, @NotNull final String kickReason, @NotNull final String leaveMessage) {

Datei anzeigen

@ -90,11 +90,14 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
--- a/src/main/java/org/bukkit/craftbukkit/advancement/CraftAdvancement.java --- a/src/main/java/org/bukkit/craftbukkit/advancement/CraftAdvancement.java
+++ b/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 { @@ -0,0 +0,0 @@ public class CraftAdvancement implements org.bukkit.advancement.Advancement {
public Collection<String> getCriteria() {
return Collections.unmodifiableCollection(this.handle.getCriteria().keySet()); return Collections.unmodifiableCollection(this.handle.getCriteria().keySet());
} }
+ // Paper start + // Paper start
+ @Override @Override
- public AdvancementDisplay getDisplay() {
- if (this.handle.getDisplay() == null) {
- return null;
+ public io.papermc.paper.advancement.AdvancementDisplay getDisplay() { + public io.papermc.paper.advancement.AdvancementDisplay getDisplay() {
+ return this.handle.getDisplay() == null ? null : this.handle.getDisplay().paper; + 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.<org.bukkit.advancement.Advancement>builder(); + final var children = com.google.common.collect.ImmutableList.<org.bukkit.advancement.Advancement>builder();
+ for (Advancement advancement : this.handle.getChildren()) { + for (Advancement advancement : this.handle.getChildren()) {
+ children.add(advancement.bukkit); + children.add(advancement.bukkit);
+ } }
+ return children.build(); + return children.build();
+ } + }
+
- return new CraftAdvancementDisplay(this.handle.getDisplay());
+ @Override + @Override
+ public org.bukkit.advancement.Advancement getRoot() { + public org.bukkit.advancement.Advancement getRoot() {
+ Advancement advancement = this.handle; + Advancement advancement = this.handle;
@ -120,7 +124,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ advancement = advancement.getParent(); + advancement = advancement.getParent();
+ } + }
+ return advancement.bukkit; + return advancement.bukkit;
+ } }
+ // Paper end + // 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/src/test/java/io/papermc/paper/advancement/AdvancementFrameTest.java b/src/test/java/io/papermc/paper/advancement/AdvancementFrameTest.java

Datei anzeigen

@ -10,7 +10,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+++ b/src/main/java/net/minecraft/world/entity/monster/Drowned.java +++ b/src/main/java/net/minecraft/world/entity/monster/Drowned.java
@@ -0,0 +0,0 @@ public class Drowned extends Zombie implements RangedAttackMob { @@ -0,0 +0,0 @@ public class Drowned extends Zombie implements RangedAttackMob {
this.goalSelector.addGoal(7, new RandomStrollGoal(this, 1.0D)); 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(2, new NearestAttackableTargetGoal<>(this, Player.class, 10, true, false, this::okTarget));
- this.targetSelector.addGoal(3, new NearestAttackableTargetGoal<>(this, AbstractVillager.class, false)); - 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 + if (this.level.spigotConfig.zombieAggressiveTowardsVillager) this.targetSelector.addGoal(3, new NearestAttackableTargetGoal<>(this, AbstractVillager.class, false)); // Paper

@ -1 +1 @@
Subproject commit d565a710e0d16d31b6b7db8009a227aba68348fa Subproject commit 6a039faf7488beba29527a112404cbab84d0cbd3

@ -1 +1 @@
Subproject commit 9d46b56e26f3e91392572f6dccec7bfdbd5728c6 Subproject commit a59dc59e88299b03b52335d95f83a880f131e3a4