60 lines
2.2 KiB
Diff
60 lines
2.2 KiB
Diff
--- a/net/minecraft/tags/ITag.java
|
|
+++ b/net/minecraft/tags/ITag.java
|
|
@@ -46,6 +46,7 @@
|
|
|
|
public static class Builder {
|
|
private final List<ITag.Proxy> field_232953_a_ = Lists.newArrayList();
|
|
+ private boolean replace = false;
|
|
|
|
public static ITag.Builder func_200047_a() {
|
|
return new ITag.Builder();
|
|
@@ -68,6 +69,15 @@
|
|
return this.func_232955_a_(new ITag.TagEntry(p_232964_1_), p_232964_2_);
|
|
}
|
|
|
|
+ public ITag.Builder replace(boolean value) {
|
|
+ this.replace = value;
|
|
+ return this;
|
|
+ }
|
|
+
|
|
+ public ITag.Builder replace() {
|
|
+ return replace(true);
|
|
+ }
|
|
+
|
|
public <T> Optional<ITag<T>> func_232959_a_(Function<ResourceLocation, ITag<T>> p_232959_1_, Function<ResourceLocation, T> p_232959_2_) {
|
|
ImmutableSet.Builder<T> builder = ImmutableSet.builder();
|
|
|
|
@@ -103,6 +113,7 @@
|
|
this.field_232953_a_.clear();
|
|
}
|
|
|
|
+ net.minecraftforge.common.ForgeHooks.deserializeTagAdditions(list, p_232956_1_, field_232953_a_);
|
|
list.forEach((p_232958_2_) -> {
|
|
this.field_232953_a_.add(new ITag.Proxy(p_232958_2_, p_232956_2_));
|
|
});
|
|
@@ -138,7 +149,7 @@
|
|
itag$proxy.func_232968_a_().func_230237_a_(jsonarray);
|
|
}
|
|
|
|
- jsonobject.addProperty("replace", false);
|
|
+ jsonobject.addProperty("replace", replace);
|
|
jsonobject.add("values", jsonarray);
|
|
return jsonobject;
|
|
}
|
|
@@ -178,6 +189,7 @@
|
|
public String toString() {
|
|
return this.field_232969_a_.toString();
|
|
}
|
|
+ @Override public boolean equals(Object o) { return o == this || (o instanceof ITag.ItemEntry && java.util.Objects.equals(this.field_232969_a_, ((ITag.ItemEntry) o).field_232969_a_)); }
|
|
}
|
|
|
|
public static class OptionalItemEntry implements ITag.ITagEntry {
|
|
@@ -278,5 +290,7 @@
|
|
public String toString() {
|
|
return "#" + this.field_200163_a;
|
|
}
|
|
+ @Override public boolean equals(Object o) { return o == this || (o instanceof ITag.TagEntry && java.util.Objects.equals(this.field_200163_a, ((ITag.TagEntry) o).field_200163_a)); }
|
|
+ public ResourceLocation getId() { return field_200163_a; }
|
|
}
|
|
}
|