Files
CatServer/patches/net/minecraft/advancements/Advancement.java.patch
2019-02-24 22:29:41 +08:00

55 lines
2.9 KiB
Diff

--- ../src-base/minecraft/net/minecraft/advancements/Advancement.java
+++ ../src-work/minecraft/net/minecraft/advancements/Advancement.java
@@ -32,6 +32,7 @@
private final String[][] requirements;
private final Set<Advancement> children = Sets.<Advancement>newLinkedHashSet();
private final ITextComponent displayText;
+ public final org.bukkit.advancement.Advancement bukkit = new org.bukkit.craftbukkit.advancement.CraftAdvancement(this);
public Advancement(ResourceLocation id, @Nullable Advancement parentIn, @Nullable DisplayInfo displayIn, AdvancementRewards rewardsIn, Map<String, Criterion> criteriaIn, String[][] requirementsIn)
{
@@ -68,9 +69,9 @@
}
}
- public Advancement.Builder copy()
+ public Builder copy()
{
- return new Advancement.Builder(this.parent == null ? null : this.parent.getId(), this.display, this.rewards, this.criteria, this.requirements);
+ return new Builder(this.parent == null ? null : this.parent.getId(), this.display, this.rewards, this.criteria, this.requirements);
}
@Nullable
@@ -230,7 +231,7 @@
return "Task Advancement{parentId=" + this.parentId + ", display=" + this.display + ", rewards=" + this.rewards + ", criteria=" + this.criteria + ", requirements=" + Arrays.deepToString(this.requirements) + '}';
}
- public static Advancement.Builder deserialize(JsonObject json, JsonDeserializationContext context)
+ public static Builder deserialize(JsonObject json, JsonDeserializationContext context)
{
ResourceLocation resourcelocation = json.has("parent") ? new ResourceLocation(JsonUtils.getString(json, "parent")) : null;
DisplayInfo displayinfo = json.has("display") ? DisplayInfo.deserialize(JsonUtils.getJsonObject(json, "display"), context) : null;
@@ -303,11 +304,11 @@
}
}
- return new Advancement.Builder(resourcelocation, displayinfo, advancementrewards, map, astring);
+ return new Builder(resourcelocation, displayinfo, advancementrewards, map, astring);
}
}
- public static Advancement.Builder readFrom(PacketBuffer buf) throws IOException
+ public static Builder readFrom(PacketBuffer buf) throws IOException
{
ResourceLocation resourcelocation = buf.readBoolean() ? buf.readResourceLocation() : null;
DisplayInfo displayinfo = buf.readBoolean() ? DisplayInfo.read(buf) : null;
@@ -324,7 +325,7 @@
}
}
- return new Advancement.Builder(resourcelocation, displayinfo, AdvancementRewards.EMPTY, map, astring);
+ return new Builder(resourcelocation, displayinfo, AdvancementRewards.EMPTY, map, astring);
}
}
}