aboutsummaryrefslogtreecommitdiffhomepage
path: root/patches/server/0715-Add-advancement-display-API.patch
diff options
context:
space:
mode:
Diffstat (limited to 'patches/server/0715-Add-advancement-display-API.patch')
-rw-r--r--patches/server/0715-Add-advancement-display-API.patch18
1 files changed, 11 insertions, 7 deletions
diff --git a/patches/server/0715-Add-advancement-display-API.patch b/patches/server/0715-Add-advancement-display-API.patch
index c2bd6b94c0..472e3067ae 100644
--- a/patches/server/0715-Add-advancement-display-API.patch
+++ b/patches/server/0715-Add-advancement-display-API.patch
@@ -86,15 +86,18 @@ index db939a754e9308ad68f1b09a970f7a1b00a673bf..538f19f15b553d14ad95f09b1c81359f
public DisplayInfo(ItemStack icon, Component title, Component description, @Nullable ResourceLocation background, FrameType frame, boolean showToast, boolean announceToChat, boolean hidden) {
this.title = title;
diff --git a/src/main/java/org/bukkit/craftbukkit/advancement/CraftAdvancement.java b/src/main/java/org/bukkit/craftbukkit/advancement/CraftAdvancement.java
-index 20d51358b4b47cbf43c3d172765243e96aa1966c..fd42cf61699337acde751249131c016555fd1ea5 100644
+index c47cae84f3b6970247d78382f48ae8ddbc202b59..0a46eeefa7d704350321828166f0049d497e3e41 100644
--- a/src/main/java/org/bukkit/craftbukkit/advancement/CraftAdvancement.java
+++ b/src/main/java/org/bukkit/craftbukkit/advancement/CraftAdvancement.java
-@@ -27,4 +27,33 @@ public class CraftAdvancement implements org.bukkit.advancement.Advancement {
- public Collection<String> getCriteria() {
+@@ -29,12 +29,33 @@ public class CraftAdvancement implements org.bukkit.advancement.Advancement {
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 20d51358b4b47cbf43c3d172765243e96aa1966c..fd42cf61699337acde751249131c0165
+ final var children = com.google.common.collect.ImmutableList.<org.bukkit.advancement.Advancement>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 20d51358b4b47cbf43c3d172765243e96aa1966c..fd42cf61699337acde751249131c0165
+ 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