PaperMC/paper-server/nms-patches/net/minecraft/advancements/AdvancementHolder.patch

26 lines
797 B
Diff
Raw Normal View History

--- a/net/minecraft/advancements/AdvancementHolder.java
+++ b/net/minecraft/advancements/AdvancementHolder.java
@@ -3,6 +3,11 @@
import net.minecraft.network.PacketDataSerializer;
import net.minecraft.resources.MinecraftKey;
+// CraftBukkit start
+import org.bukkit.craftbukkit.advancement.CraftAdvancement;
+import org.bukkit.craftbukkit.util.CraftNamespacedKey;
+// CraftBukkit end
+
public record AdvancementHolder(MinecraftKey id, Advancement value) {
public void write(PacketDataSerializer packetdataserializer) {
@@ -41,4 +46,10 @@
public String toString() {
return this.id.toString();
}
+
+ // CraftBukkit start
+ public final org.bukkit.advancement.Advancement toBukkit() {
+ return new CraftAdvancement(this);
+ }
+ // CraftBukkit end
}