0
0
mirror of https://hub.spigotmc.org/stash/scm/spigot/craftbukkit.git synced 2024-11-27 21:44:49 +00:00
craftbukkit/nms-patches/net/minecraft/advancements/AdvancementHolder.patch
2024-04-24 01:15:00 +10:00

26 lines
971 B
Diff

--- a/net/minecraft/advancements/AdvancementHolder.java
+++ b/net/minecraft/advancements/AdvancementHolder.java
@@ -6,6 +6,11 @@
import net.minecraft.network.codec.StreamCodec;
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 static final StreamCodec<RegistryFriendlyByteBuf, AdvancementHolder> STREAM_CODEC = StreamCodec.composite(MinecraftKey.STREAM_CODEC, AdvancementHolder::id, Advancement.STREAM_CODEC, AdvancementHolder::value, AdvancementHolder::new);
@@ -38,4 +43,10 @@
public String toString() {
return this.id.toString();
}
+
+ // CraftBukkit start
+ public final org.bukkit.advancement.Advancement toBukkit() {
+ return new CraftAdvancement(this);
+ }
+ // CraftBukkit end
}