aboutsummaryrefslogtreecommitdiffhomepage
path: root/patch-remap/mache-vineflower/net/minecraft/advancements/AdvancementHolder.java.patch
blob: 947996e005344b2a37bb0181e7033a796295b2d5 (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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
--- a/net/minecraft/advancements/AdvancementHolder.java
+++ b/net/minecraft/advancements/AdvancementHolder.java
@@ -2,37 +2,53 @@
 
 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;
         } else {
-            if (object instanceof AdvancementHolder advancementHolder && this.id.equals(advancementHolder.id)) {
-                return true;
+            boolean flag;
+
+            if (object instanceof AdvancementHolder) {
+                AdvancementHolder advancementholder = (AdvancementHolder) object;
+
+                if (this.id.equals(advancementholder.id)) {
+                    flag = true;
+                    return flag;
+                }
             }
 
-            return false;
+            flag = false;
+            return flag;
         }
     }
 
-    @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
 }