Datagen addOptionalTag/s methods that allow passing the TagKey itself instead of passing the location (#9807)

This commit is contained in:
J.T. McQuigg authored and GitHub committed 2023-11-29 19:27:54 -08:00
1 parent e5580b84b7
commit 28909812bb
1 file changed
+13
@@ -25,6 +25,19 @@ public interface IForgeTagAppender<T>
return builder;
}
default TagsProvider.TagAppender<T> addOptionalTag(TagKey<T> value) {
return self().addOptionalTag(value.location());
}
@SuppressWarnings("unchecked")
default TagsProvider.TagAppender<T> addOptionalTags(TagKey<T>... values) {
TagsProvider.TagAppender<T> builder = self();
for (TagKey<T> value : values) {
builder.addOptionalTag(value.location());
}
return builder;
}
default TagsProvider.TagAppender<T> replace() {
return replace(true);
}