aboutsummaryrefslogtreecommitdiffhomepage
path: root/patch-remap/mache-vineflower/net/minecraft/advancements/AdvancementHolder.java.patch
diff options
context:
space:
mode:
Diffstat (limited to 'patch-remap/mache-vineflower/net/minecraft/advancements/AdvancementHolder.java.patch')
-rw-r--r--patch-remap/mache-vineflower/net/minecraft/advancements/AdvancementHolder.java.patch67
1 files changed, 67 insertions, 0 deletions
diff --git a/patch-remap/mache-vineflower/net/minecraft/advancements/AdvancementHolder.java.patch b/patch-remap/mache-vineflower/net/minecraft/advancements/AdvancementHolder.java.patch
new file mode 100644
index 0000000000..947996e005
--- /dev/null
+++ b/patch-remap/mache-vineflower/net/minecraft/advancements/AdvancementHolder.java.patch
@@ -0,0 +1,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
+ }