Fix missing patch that left TagBuilder#replace unused (#9354)

This commit is contained in:
Su5eD authored and GitHub committed 2023-02-24 10:49:37 -08:00
1 parent 183d43f5f8
commit 62ce55d8d7
2 files changed
+8 -2

No files matched your search

@@ -63,8 +63,9 @@
if (!list1.isEmpty()) {
throw new IllegalArgumentException(String.format(Locale.ROOT, "Couldn't define tag %s as it is missing following references: %s", resourcelocation, list1.stream().map(Objects::toString).collect(Collectors.joining(","))));
} else {
JsonElement jsonelement = TagFile.f_215958_.encodeStart(JsonOps.INSTANCE, new TagFile(list, false)).getOrThrow(false, f_126541_::error);
- JsonElement jsonelement = TagFile.f_215958_.encodeStart(JsonOps.INSTANCE, new TagFile(list, false)).getOrThrow(false, f_126541_::error);
- Path path = this.f_236439_.m_245731_(resourcelocation);
+ JsonElement jsonelement = TagFile.f_215958_.encodeStart(JsonOps.INSTANCE, new TagFile(list, tagbuilder.isReplace())).getOrThrow(false, f_126541_::error);
+ Path path = this.getPath(resourcelocation);
+ if (path == null) return CompletableFuture.completedFuture(null); // Forge: Allow running this data provider without writing it. Recipe provider needs valid tags.
return DataProvider.m_253162_(p_253684_, jsonelement, path);
@@ -19,7 +19,7 @@
private final List<TagEntry> f_215897_ = new ArrayList<>();
public static TagBuilder m_215899_() {
@@ -34,5 +_,16 @@
@@ -34,5 +_,21 @@
public TagBuilder m_215909_(ResourceLocation p_215910_) {
return this.m_215902_(TagEntry.m_215953_(p_215910_));
@@ -34,5 +34,10 @@
+ // FORGE: Shorthand version of replace(true)
+ public TagBuilder replace() {
+ return replace(true);
+ }
+
+ // FORGE: Is this tag set to replace or not?
+ public boolean isReplace() {
+ return this.replace;
}
}