aboutsummaryrefslogtreecommitdiffhomepage
path: root/patch-remap/mache-spigotflower/net/minecraft/advancements/AdvancementHolder.java.patch
blob: d743aa95eaedbdeff6350f902376a938648e9d4d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
--- a/net/minecraft/advancements/AdvancementHolder.java
+++ b/net/minecraft/advancements/AdvancementHolder.java
@@ -2,19 +2,22 @@
 
 import net.minecraft.network.FriendlyByteBuf;
 import net.minecraft.resources.ResourceLocation;
+// CraftBukkit start
+import org.bukkit.craftbukkit.advancement.CraftAdvancement;
+import org.bukkit.craftbukkit.util.CraftNamespacedKey;
+// CraftBukkit end
 
 public record AdvancementHolder(ResourceLocation id, Advancement value) {
 
-    public void write(FriendlyByteBuf friendlybytebuf) {
-        friendlybytebuf.writeResourceLocation(this.id);
-        this.value.write(friendlybytebuf);
+    public void write(FriendlyByteBuf packetdataserializer) {
+        packetdataserializer.writeResourceLocation(this.id);
+        this.value.write(packetdataserializer);
     }
 
-    public static AdvancementHolder read(FriendlyByteBuf friendlybytebuf) {
-        return new AdvancementHolder(friendlybytebuf.readResourceLocation(), Advancement.read(friendlybytebuf));
+    public static AdvancementHolder read(FriendlyByteBuf packetdataserializer) {
+        return new AdvancementHolder(packetdataserializer.readResourceLocation(), Advancement.read(packetdataserializer));
     }
 
-    @Override
     public boolean equals(Object object) {
         if (this == object) {
             return true;
@@ -35,13 +38,17 @@
         }
     }
 
-    @Override
     public int hashCode() {
         return this.id.hashCode();
     }
 
-    @Override
     public String toString() {
         return this.id.toString();
     }
+
+    // CraftBukkit start
+    public final org.bukkit.advancement.Advancement toBukkit() {
+        return new CraftAdvancement(this);
+    }
+    // CraftBukkit end
 }