Package net.minecraft.tag
Class Tag.Builder
java.lang.Object
net.minecraft.tag.Tag.Builder
public static class Tag.Builder extends Object
A builder class to ease the creation of tags. It can also be used as a
mutable form of a tag.
-
Field Summary
Fields Modifier and Type Field Description private List<Tag.TrackedEntry>
entries
-
Constructor Summary
Constructors Constructor Description Builder()
-
Method Summary
Modifier and Type Method Description Tag.Builder
add(Tag.Entry entry, String source)
Tag.Builder
add(Tag.TrackedEntry trackedEntry)
Tag.Builder
add(Identifier id, String source)
Tag.Builder
addTag(Identifier id, String source)
<T> Optional<Tag<T>>
build(Function<Identifier,Tag<T>> tagGetter, Function<Identifier,T> objectGetter)
static Tag.Builder
create()
Tag.Builder
read(JsonObject json, String source)
private static Tag.Entry
resolveEntry(JsonElement json)
Stream<Tag.TrackedEntry>
streamEntries()
<T> Stream<Tag.TrackedEntry>
streamUnresolvedEntries(Function<Identifier,Tag<T>> tagGetter, Function<Identifier,T> objectGetter)
JsonObject
toJson()
-
Field Details
-
entries
-
-
Constructor Details
-
Builder
public Builder()
-
-
Method Details
-
create
-
add
-
add
-
add
-
addTag
-
build
public <T> Optional<Tag<T>> build(Function<Identifier,Tag<T>> tagGetter, Function<Identifier,T> objectGetter) -
streamEntries
-
streamUnresolvedEntries
public <T> Stream<Tag.TrackedEntry> streamUnresolvedEntries(Function<Identifier,Tag<T>> tagGetter, Function<Identifier,T> objectGetter) -
read
-
resolveEntry
-
toJson
-