Package net.minecraft.tags
Part 1/1
TagBuilder
- Full name:
net.minecraft.tags.TagBuilder - Package:
net.minecraft.tags - Source:
common—net/minecraft/tags/TagBuilder.java - Type:
class - Modifiers:
public
net.minecraft.tags.TagBuilder#add(TagEntry)
- Origin:
common - Source:
net/minecraft/tags/TagBuilder.java:18 - Modifiers:
public - Return:
TagBuilder
คืออะไร
เพิ่ม add
ทำงานยังไง
คืนค่า: this.
Parameters
TagEntry tagEntry
ตัวอย่างใช้งาน
net.minecraft.tags.TagBuilder#addElement(ResourceLocation)
- Origin:
common - Source:
net/minecraft/tags/TagBuilder.java:23 - Modifiers:
public - Return:
TagBuilder
คืออะไร
เพิ่ม Element
ทำงานยังไง
เรียกต่อ: add(), element(). คืนค่า: this.add(TagEntry.element(resourceLocation)).
Parameters
ResourceLocation resourceLocation
ตัวอย่างใช้งาน
TagBuilder instance = ...;
ResourceLocation resourceLocation = ...;
TagBuilder result = instance.addElement(resourceLocation);
net.minecraft.tags.TagBuilder#addOptionalElement(ResourceLocation)
- Origin:
common - Source:
net/minecraft/tags/TagBuilder.java:27 - Modifiers:
public - Return:
TagBuilder
คืออะไร
เพิ่ม Optional Element
ทำงานยังไง
เรียกต่อ: add(), optionalElement(). คืนค่า: this.add(TagEntry.optionalElement(resourceLocation)).
Parameters
ResourceLocation resourceLocation
ตัวอย่างใช้งาน
TagBuilder instance = ...;
ResourceLocation resourceLocation = ...;
TagBuilder result = instance.addOptionalElement(resourceLocation);
net.minecraft.tags.TagBuilder#addOptionalTag(ResourceLocation)
- Origin:
common - Source:
net/minecraft/tags/TagBuilder.java:35 - Modifiers:
public - Return:
TagBuilder
คืออะไร
เพิ่ม Optional Tag
ทำงานยังไง
เรียกต่อ: add(), optionalTag(). คืนค่า: this.add(TagEntry.optionalTag(resourceLocation)).
Parameters
ResourceLocation resourceLocation
ตัวอย่างใช้งาน
TagBuilder instance = ...;
ResourceLocation resourceLocation = ...;
TagBuilder result = instance.addOptionalTag(resourceLocation);
net.minecraft.tags.TagBuilder#addTag(ResourceLocation)
- Origin:
common - Source:
net/minecraft/tags/TagBuilder.java:31 - Modifiers:
public - Return:
TagBuilder
คืออะไร
เพิ่ม Tag
ทำงานยังไง
เรียกต่อ: add(), tag(). คืนค่า: this.add(TagEntry.tag(resourceLocation)).
Parameters
ResourceLocation resourceLocation
ตัวอย่างใช้งาน
TagBuilder instance = ...;
ResourceLocation resourceLocation = ...;
TagBuilder result = instance.addTag(resourceLocation);
net.minecraft.tags.TagBuilder#build()
- Origin:
common - Source:
net/minecraft/tags/TagBuilder.java:14 - Modifiers:
public - Return:
List<TagEntry>
คืออะไร
สร้าง build
ทำงานยังไง
เรียกต่อ: copyOf(). คืนค่า: List.copyOf(this.entries).
Parameters
- ไม่มี
ตัวอย่างใช้งาน
net.minecraft.tags.TagBuilder#create()
- Origin:
common - Source:
net/minecraft/tags/TagBuilder.java:10 - Modifiers:
public static - Return:
TagBuilder
คืออะไร
สร้าง create
ทำงานยังไง
สร้างออบเจ็กต์: TagBuilder. คืนค่า: new TagBuilder().
Parameters
- ไม่มี
ตัวอย่างใช้งาน
TagEntry
- Full name:
net.minecraft.tags.TagEntry - Package:
net.minecraft.tags - Source:
common—net/minecraft/tags/TagEntry.java - Type:
class - Modifiers:
public
net.minecraft.tags.TagEntry#build(TagEntry.Lookup<T>,Consumer<T>)
- Origin:
common - Source:
net/minecraft/tags/TagEntry.java:62 - Modifiers:
public - Return:
boolean
คืออะไร
สร้าง build
ทำงานยังไง
ตรวจเงื่อนไขด้วย if. เรียกต่อ: tag(), forEach(), element(), accept(). มีจุด return อย่างน้อย 3 จุด.
Parameters
TagEntry.Lookup<T> lookupConsumer<T> consumer
ตัวอย่างใช้งาน
TagEntry instance = ...;
TagEntry.Lookup<T> lookup = ...;
Consumer<T> consumer = ...;
boolean result = instance.build(lookup, consumer);
net.minecraft.tags.TagEntry#element(ResourceLocation)
- Origin:
common - Source:
net/minecraft/tags/TagEntry.java:46 - Modifiers:
public static - Return:
TagEntry
คืออะไร
ดำเนินการ element ตาม implementation ของ TagEntry
ทำงานยังไง
สร้างออบเจ็กต์: TagEntry. คืนค่า: new TagEntry(resourceLocation, false, true).
Parameters
ResourceLocation resourceLocation
ตัวอย่างใช้งาน
net.minecraft.tags.TagEntry#optionalElement(ResourceLocation)
- Origin:
common - Source:
net/minecraft/tags/TagEntry.java:50 - Modifiers:
public static - Return:
TagEntry
คืออะไร
ดำเนินการ optionalElement ตาม implementation ของ TagEntry
ทำงานยังไง
สร้างออบเจ็กต์: TagEntry. คืนค่า: new TagEntry(resourceLocation, false, false).
Parameters
ResourceLocation resourceLocation
ตัวอย่างใช้งาน
ResourceLocation resourceLocation = ...;
TagEntry result = TagEntry.optionalElement(resourceLocation);
net.minecraft.tags.TagEntry#optionalTag(ResourceLocation)
- Origin:
common - Source:
net/minecraft/tags/TagEntry.java:58 - Modifiers:
public static - Return:
TagEntry
คืออะไร
ดำเนินการ optionalTag ตาม implementation ของ TagEntry
ทำงานยังไง
สร้างออบเจ็กต์: TagEntry. คืนค่า: new TagEntry(resourceLocation, true, false).
Parameters
ResourceLocation resourceLocation
ตัวอย่างใช้งาน
net.minecraft.tags.TagEntry#tag(ResourceLocation)
- Origin:
common - Source:
net/minecraft/tags/TagEntry.java:54 - Modifiers:
public static - Return:
TagEntry
คืออะไร
ดำเนินการ tag ตาม implementation ของ TagEntry
ทำงานยังไง
สร้างออบเจ็กต์: TagEntry. คืนค่า: new TagEntry(resourceLocation, true, true).
Parameters
ResourceLocation resourceLocation
ตัวอย่างใช้งาน
net.minecraft.tags.TagEntry#toString()
- Origin:
common - Source:
net/minecraft/tags/TagEntry.java:98 - Modifiers:
public - Return:
String
คืออะไร
ดำเนินการ toString ตาม implementation ของ TagEntry
ทำงานยังไง
ตรวจเงื่อนไขด้วย if. เรียกต่อ: append(). สร้างออบเจ็กต์: StringBuilder. คืนค่า: stringBuilder.toString().
Parameters
- ไม่มี
ตัวอย่างใช้งาน
net.minecraft.tags.TagEntry#verifyIfPresent(Predicate<ResourceLocation>,Predicate<ResourceLocation>)
- Origin:
common - Source:
net/minecraft/tags/TagEntry.java:94 - Modifiers:
public - Return:
boolean
คืออะไร
ดำเนินการ verifyIfPresent ตาม implementation ของ TagEntry
ทำงานยังไง
เรียกต่อ: test(). คืนค่า: !this.required || (this.tag ? predicate2 : predicate).test(this.id).
Parameters
Predicate<ResourceLocation> predicatePredicate<ResourceLocation> predicate2
ตัวอย่างใช้งาน
TagEntry instance = ...;
Predicate<ResourceLocation> predicate = ...;
Predicate<ResourceLocation> predicate2 = ...;
boolean result = instance.verifyIfPresent(predicate, predicate2);
net.minecraft.tags.TagEntry#visitOptionalDependencies(Consumer<ResourceLocation>)
- Origin:
common - Source:
net/minecraft/tags/TagEntry.java:88 - Modifiers:
public - Return:
void
คืออะไร
เยี่ยมชม node Optional Dependencies
ทำงานยังไง
ตรวจเงื่อนไขด้วย if. เรียกต่อ: accept().
Parameters
Consumer<ResourceLocation> consumer
ตัวอย่างใช้งาน
TagEntry instance = ...;
Consumer<ResourceLocation> consumer = ...;
instance.visitOptionalDependencies(consumer);
net.minecraft.tags.TagEntry#visitRequiredDependencies(Consumer<ResourceLocation>)
- Origin:
common - Source:
net/minecraft/tags/TagEntry.java:82 - Modifiers:
public - Return:
void
คืออะไร
เยี่ยมชม node Required Dependencies
ทำงานยังไง
ตรวจเงื่อนไขด้วย if. เรียกต่อ: accept().
Parameters
Consumer<ResourceLocation> consumer
ตัวอย่างใช้งาน
TagEntry instance = ...;
Consumer<ResourceLocation> consumer = ...;
instance.visitRequiredDependencies(consumer);
TagEntry$Lookup
- Full name:
net.minecraft.tags.TagEntry$Lookup - Package:
net.minecraft.tags - Source:
common—net/minecraft/tags/TagEntry.java - Type:
interface - Modifiers:
public
net.minecraft.tags.TagEntry$Lookup#element(ResourceLocation,boolean)
- Origin:
common - Source:
net/minecraft/tags/TagEntry.java:114 - Modifiers: ``
- Return:
T
คืออะไร
ดำเนินการ element ตาม implementation ของ TagEntry$Lookup
ทำงานยังไง
ไม่มี body ใน source declaration นี้
Parameters
ResourceLocation resourceLocationboolean bl
ตัวอย่างใช้งาน
TagEntry.Lookup instance = ...;
ResourceLocation resourceLocation = ...;
T result = instance.element(resourceLocation, true);
net.minecraft.tags.TagEntry$Lookup#tag(ResourceLocation)
- Origin:
common - Source:
net/minecraft/tags/TagEntry.java:117 - Modifiers: ``
- Return:
Collection<T>
คืออะไร
ดำเนินการ tag ตาม implementation ของ TagEntry$Lookup
ทำงานยังไง
ไม่มี body ใน source declaration นี้
Parameters
ResourceLocation resourceLocation
ตัวอย่างใช้งาน
TagEntry.Lookup instance = ...;
ResourceLocation resourceLocation = ...;
Collection<T> result = instance.tag(resourceLocation);
TagKey
- Full name:
net.minecraft.tags.TagKey - Package:
net.minecraft.tags - Source:
common—net/minecraft/tags/TagKey.java - Type:
record - Modifiers:
public - Implements:
FabricTagKey
net.minecraft.tags.TagKey#cast(ResourceKey<? extends Registry<E>>)
- Origin:
common - Source:
net/minecraft/tags/TagKey.java:51 - Modifiers:
public - Return:
Optional<TagKey<E>>
คืออะไร
ดำเนินการ cast ตาม implementation ของ TagKey
ทำงานยังไง
เรียกต่อ: isFor(), of(), empty(). คืนค่า: this.isFor(resourceKey) ? Optional.of((TagKey<E>)this) : Optional.empty().
Parameters
ResourceKey<? extends Registry<E>> resourceKey
ตัวอย่างใช้งาน
TagKey instance = ...;
ResourceKey<? extends Registry<E>> resourceKey = ...;
Optional<TagKey<E>> result = instance.cast(resourceKey);
net.minecraft.tags.TagKey#codec(ResourceKey<? extends Registry<T>>)
- Origin:
common - Source:
net/minecraft/tags/TagKey.java:25 - Modifiers:
public static - Return:
Codec<TagKey<T>>
คืออะไร
ดำเนินการ codec ตาม implementation ของ TagKey
ทำงานยังไง
เรียกต่อ: xmap(), create(). คืนค่า: ResourceLocation.CODEC.xmap(resourceLocation -> create(resourceKey, resourceLocation), TagKey::location).
Parameters
ResourceKey<? extends Registry<T>> resourceKey
ตัวอย่างใช้งาน
ResourceKey<? extends Registry<T>> resourceKey = ...;
Codec<TagKey<T>> result = TagKey.codec(resourceKey);
net.minecraft.tags.TagKey#create(ResourceKey<? extends Registry<T>>,ResourceLocation)
- Origin:
common - Source:
net/minecraft/tags/TagKey.java:43 - Modifiers:
public static - Return:
TagKey<T>
คืออะไร
สร้าง create
ทำงานยังไง
เรียกต่อ: intern(). สร้างออบเจ็กต์: TagKey<>. คืนค่า: (TagKey<T>)VALUES.intern(new TagKey<>(resourceKey, resourceLocation)).
Parameters
ResourceKey<? extends Registry<T>> resourceKeyResourceLocation resourceLocation
ตัวอย่างใช้งาน
ResourceKey<? extends Registry<T>> resourceKey = ...;
ResourceLocation resourceLocation = ...;
TagKey<T> result = TagKey.create(resourceKey, resourceLocation);
net.minecraft.tags.TagKey#hashedCodec(ResourceKey<? extends Registry<T>>)
- Origin:
common - Source:
net/minecraft/tags/TagKey.java:29 - Modifiers:
public static - Return:
Codec<TagKey<T>>
คืออะไร
ดำเนินการ hashedCodec ตาม implementation ของ TagKey
ทำงานยังไง
เรียกต่อ: comapFlatMap(), startsWith(), read(), substring(), map(), create(), error().
Parameters
ResourceKey<? extends Registry<T>> resourceKey
ตัวอย่างใช้งาน
ResourceKey<? extends Registry<T>> resourceKey = ...;
Codec<TagKey<T>> result = TagKey.hashedCodec(resourceKey);
net.minecraft.tags.TagKey#isFor(ResourceKey<? extends Registry<?>>)
- Origin:
common - Source:
net/minecraft/tags/TagKey.java:47 - Modifiers:
public - Return:
boolean
คืออะไร
ตรวจสอบสถานะ For
ทำงานยังไง
แก้ state: registry. คืนค่า: this.registry == resourceKey.
Parameters
ResourceKey<? extends Registry<?>> resourceKey
ตัวอย่างใช้งาน
TagKey instance = ...;
ResourceKey<? extends Registry<?>> resourceKey = ...;
boolean result = instance.isFor(resourceKey);
net.minecraft.tags.TagKey#streamCodec(ResourceKey<? extends Registry<T>>)
- Origin:
common - Source:
net/minecraft/tags/TagKey.java:39 - Modifiers:
public static - Return:
StreamCodec<ByteBuf, TagKey<T>>
คืออะไร
ดำเนินการ streamCodec ตาม implementation ของ TagKey
ทำงานยังไง
เรียกต่อ: map(), create(). คืนค่า: ResourceLocation.STREAM_CODEC.map(resourceLocation -> create(resourceKey, resourceLocation), TagKey::location).
Parameters
ResourceKey<? extends Registry<T>> resourceKey
ตัวอย่างใช้งาน
ResourceKey<? extends Registry<T>> resourceKey = ...;
StreamCodec<ByteBuf, TagKey<T>> result = TagKey.streamCodec(resourceKey);
net.minecraft.tags.TagKey#TagKey(ResourceKey<? extends Registry<T>>,ResourceLocation)
- Origin:
common - Source:
net/minecraft/tags/TagKey.java:21 - Modifiers:
public - Kind: constructor
คืออะไร
สร้างออบเจ็กต์ TagKey ด้วยพารามิเตอร์ที่ระบุ
ทำงานยังไง
ทำงานตาม body โดยตรง (ประมาณ 1 statement).
Parameters
ResourceKey<? extends Registry<T>> registryResourceLocation location
ตัวอย่างใช้งาน
ResourceKey<? extends Registry<T>> registry = ...;
ResourceLocation location = ...;
TagKey instance = new TagKey(registry, location);
net.minecraft.tags.TagKey#toString()
- Origin:
common - Source:
net/minecraft/tags/TagKey.java:55 - Modifiers:
public - Return:
String
คืออะไร
ดำเนินการ toString ตาม implementation ของ TagKey
ทำงานยังไง
เรียกต่อ: location(). คืนค่า: "TagKey[" + this.registry.location() + " / " + this.location + "]".
Parameters
- ไม่มี
ตัวอย่างใช้งาน
TagLoader
- Full name:
net.minecraft.tags.TagLoader - Package:
net.minecraft.tags - Source:
common—net/minecraft/tags/TagLoader.java - Type:
class - Modifiers:
public
net.minecraft.tags.TagLoader#build(Map<ResourceLocation, List<TagLoader.EntryWithSource>>)
- Origin:
common - Source:
net/minecraft/tags/TagLoader.java:89 - Modifiers:
public - Return:
Map<ResourceLocation, List<T>>
คืออะไร
สร้าง build
ทำงานยังไง
เรียกต่อ: element(), get(), orElse(), tag(), forEach(), addEntry(), SortingEntry(), orderByDependencies(). สร้างออบเจ็กต์: HashMap<>, TagEntry.Lookup<T>, DependencySorter<>, TagLoader.SortingEntry. มีจุด return อย่างน้อย 3 จุด.
Parameters
Map<ResourceLocation, List<TagLoader.EntryWithSource>> map
ตัวอย่างใช้งาน
TagLoader instance = ...;
Map<ResourceLocation, List<TagLoader.EntryWithSource>> map = ...;
Map<ResourceLocation, List<T>> result = instance.build(map);
net.minecraft.tags.TagLoader#buildUpdatedLookups(RegistryAccess.Frozen,List<Registry.PendingTags<?>>)
- Origin:
common - Source:
net/minecraft/tags/TagLoader.java:151 - Modifiers:
public static - Return:
List<HolderLookup.RegistryLookup<?>>
คืออะไร
สร้าง Updated Lookups
ทำงานยังไง
เรียกต่อ: registries(), forEach(), findTagsForRegistry(), key(), add(), lookup(), value(). สร้างออบเจ็กต์: ArrayList<>. คืนค่า: list2.
Parameters
RegistryAccess.Frozen frozenList<Registry.PendingTags<?>> list
ตัวอย่างใช้งาน
RegistryAccess.Frozen frozen = ...;
List<Registry.PendingTags<?>> list = ...;
List<HolderLookup.RegistryLookup<?>> result = TagLoader.buildUpdatedLookups(frozen, list);
net.minecraft.tags.TagLoader#load(ResourceManager)
- Origin:
common - Source:
net/minecraft/tags/TagLoader.java:48 - Modifiers:
public - Return:
Map<ResourceLocation, List<TagLoader.EntryWithSource>>
คืออะไร
โหลด load
ทำงานยังไง
ตรวจเงื่อนไขด้วย if ; มีการวนลูป ; มีการจัดการ exception. เรียกต่อ: json(), listMatchingResourceStacks(), entrySet(), getKey(), fileToId(), getValue(), openAsReader(), parseReader(). สร้างออบเจ็กต์: HashMap<>, ArrayList<>, Dynamic<>, TagLoader.EntryWithSource. คืนค่า: map.
Parameters
ResourceManager resourceManager
ตัวอย่างใช้งาน
TagLoader instance = ...;
ResourceManager resourceManager = ...;
Map<ResourceLocation, List<TagLoader.EntryWithSource>> result = instance.load(resourceManager);
net.minecraft.tags.TagLoader#loadTagsForExistingRegistries(ResourceManager,RegistryAccess)
- Origin:
common - Source:
net/minecraft/tags/TagLoader.java:124 - Modifiers:
public static - Return:
List<Registry.PendingTags<?>>
คืออะไร
โหลด Tags For Existing Registries
ทำงานยังไง
เรียกต่อ: registries(), map(), loadPendingTags(), value(), flatMap(), collect(), toUnmodifiableList().
Parameters
ResourceManager resourceManagerRegistryAccess registryAccess
ตัวอย่างใช้งาน
ResourceManager resourceManager = ...;
RegistryAccess registryAccess = ...;
List<Registry.PendingTags<?>> result = TagLoader.loadTagsForExistingRegistries(resourceManager, registryAccess);
net.minecraft.tags.TagLoader#loadTagsForRegistry(ResourceManager,WritableRegistry<T>)
- Origin:
common - Source:
net/minecraft/tags/TagLoader.java:131 - Modifiers:
public static - Return:
void
คืออะไร
โหลด Tags For Registry
ทำงานยังไง
เรียกต่อ: key(), fromWritableRegistry(), tagsDirPath(), build(), load(), forEach(), bindTag(), create(). สร้างออบเจ็กต์: TagLoader<>.
Parameters
ResourceManager resourceManagerWritableRegistry<T> writableRegistry
ตัวอย่างใช้งาน
ResourceManager resourceManager = ...;
WritableRegistry<T> writableRegistry = ...;
TagLoader.loadTagsForRegistry(resourceManager, writableRegistry);
net.minecraft.tags.TagLoader#loadTagsFromNetwork(TagNetworkSerialization.NetworkPayload,WritableRegistry<T>)
- Origin:
common - Source:
net/minecraft/tags/TagLoader.java:120 - Modifiers:
public static - Return:
void
คืออะไร
โหลด Tags From Network
ทำงานยังไง
เรียกต่อ: resolve(), forEach().
Parameters
TagNetworkSerialization.NetworkPayload networkPayloadWritableRegistry<T> writableRegistry
ตัวอย่างใช้งาน
TagNetworkSerialization.NetworkPayload networkPayload = ...;
WritableRegistry<T> writableRegistry = ...;
TagLoader.loadTagsFromNetwork(networkPayload, writableRegistry);
net.minecraft.tags.TagLoader#TagLoader(TagLoader.ElementLookup<T>,String)
- Origin:
common - Source:
net/minecraft/tags/TagLoader.java:43 - Modifiers:
public - Kind: constructor
คืออะไร
สร้างออบเจ็กต์ TagLoader ด้วยพารามิเตอร์ที่ระบุ
ทำงานยังไง
แก้ state: elementLookup, directory.
Parameters
TagLoader.ElementLookup<T> elementLookupString string
ตัวอย่างใช้งาน
TagLoader.ElementLookup<T> elementLookup = ...;
TagLoader instance = new TagLoader(elementLookup, "value");
TagLoader$ElementLookup
- Full name:
net.minecraft.tags.TagLoader$ElementLookup - Package:
net.minecraft.tags - Source:
common—net/minecraft/tags/TagLoader.java - Type:
interface - Modifiers:
public
net.minecraft.tags.TagLoader$ElementLookup#fromFrozenRegistry(Registry<T>)
- Origin:
common - Source:
net/minecraft/tags/TagLoader.java:174 - Modifiers:
static - Return:
TagLoader.ElementLookup<? extends Holder<T>>
คืออะไร
ดำเนินการ fromFrozenRegistry ตาม implementation ของ TagLoader$ElementLookup
ทำงานยังไง
เรียกต่อ: get(). คืนค่า: (resourceLocation, bl) -> registry.get(resourceLocation).
Parameters
Registry<T> registry
ตัวอย่างใช้งาน
Registry<T> registry = ...;
TagLoader.ElementLookup<? extends Holder<T>> result = TagLoader.ElementLookup.fromFrozenRegistry(registry);
net.minecraft.tags.TagLoader$ElementLookup#fromWritableRegistry(WritableRegistry<T>)
- Origin:
common - Source:
net/minecraft/tags/TagLoader.java:178 - Modifiers:
static - Return:
TagLoader.ElementLookup<Holder<T>>
คืออะไร
ดำเนินการ fromWritableRegistry ตาม implementation ของ TagLoader$ElementLookup
ทำงานยังไง
เรียกต่อ: createRegistrationLookup(), get(), create(), key(). คืนค่า: (resourceLocation, bl) -> (bl ? holderGetter : writableRegistry).get(ResourceKey.create(writableRegistry.key(), resourceLocation)).
Parameters
WritableRegistry<T> writableRegistry
ตัวอย่างใช้งาน
WritableRegistry<T> writableRegistry = ...;
TagLoader.ElementLookup<Holder<T>> result = TagLoader.ElementLookup.fromWritableRegistry(writableRegistry);
net.minecraft.tags.TagLoader$ElementLookup#get(ResourceLocation,boolean)
- Origin:
common - Source:
net/minecraft/tags/TagLoader.java:172 - Modifiers: ``
- Return:
Optional<? extends T>
คืออะไร
อ่านค่า get
ทำงานยังไง
ไม่มี body ใน source declaration นี้
Parameters
ResourceLocation resourceLocationboolean bl
ตัวอย่างใช้งาน
TagLoader.ElementLookup instance = ...;
ResourceLocation resourceLocation = ...;
Optional<? extends T> result = instance.get(resourceLocation, true);
TagLoader$EntryWithSource
- Full name:
net.minecraft.tags.TagLoader$EntryWithSource - Package:
net.minecraft.tags - Source:
common—net/minecraft/tags/TagLoader.java - Type:
record - Modifiers:
public
net.minecraft.tags.TagLoader$EntryWithSource#toString()
- Origin:
common - Source:
net/minecraft/tags/TagLoader.java:186 - Modifiers:
public - Return:
String
คืออะไร
ดำเนินการ toString ตาม implementation ของ TagLoader$EntryWithSource
ทำงานยังไง
คืนค่า: this.entry + " (from " + this.source + ")".
Parameters
- ไม่มี
ตัวอย่างใช้งาน
TagNetworkSerialization
- Full name:
net.minecraft.tags.TagNetworkSerialization - Package:
net.minecraft.tags - Source:
common—net/minecraft/tags/TagNetworkSerialization.java - Type:
class - Modifiers:
public
net.minecraft.tags.TagNetworkSerialization#serializeTagsToNetwork(LayeredRegistryAccess<RegistryLayer>)
- Origin:
common - Source:
net/minecraft/tags/TagNetworkSerialization.java:21 - Modifiers:
public static - Return:
Map<ResourceKey<? extends Registry<?>>, TagNetworkSerialization.NetworkPayload>
คืออะไร
แปลงเป็นข้อมูลสำหรับบันทึก/ส่ง Tags To Network
ทำงานยังไง
เรียกต่อ: networkSafeRegistries(), map(), of(), key(), serializeToNetwork(), value(), filter(), getSecond().
Parameters
LayeredRegistryAccess<RegistryLayer> layeredRegistryAccess
ตัวอย่างใช้งาน
LayeredRegistryAccess<RegistryLayer> layeredRegistryAccess = ...;
Map<ResourceKey<? extends Registry<?>>, TagNetworkSerialization.NetworkPayload> result = TagNetworkSerialization.serializeTagsToNetwork(layeredRegistryAccess);
TagNetworkSerialization$NetworkPayload
- Full name:
net.minecraft.tags.TagNetworkSerialization$NetworkPayload - Package:
net.minecraft.tags - Source:
common—net/minecraft/tags/TagNetworkSerialization.java - Type:
class - Modifiers:
public static final
net.minecraft.tags.TagNetworkSerialization$NetworkPayload#isEmpty()
- Origin:
common - Source:
net/minecraft/tags/TagNetworkSerialization.java:75 - Modifiers:
public - Return:
boolean
คืออะไร
ตรวจสอบสถานะ Empty
ทำงานยังไง
คืนค่า: this.tags.isEmpty().
Parameters
- ไม่มี
ตัวอย่างใช้งาน
net.minecraft.tags.TagNetworkSerialization$NetworkPayload#read(FriendlyByteBuf)
- Origin:
common - Source:
net/minecraft/tags/TagNetworkSerialization.java:71 - Modifiers:
public static - Return:
TagNetworkSerialization.NetworkPayload
คืออะไร
อ่าน read
ทำงานยังไง
เรียกต่อ: NetworkPayload(), readMap(). สร้างออบเจ็กต์: TagNetworkSerialization.NetworkPayload. คืนค่า: new TagNetworkSerialization.NetworkPayload(friendlyByteBuf.readMap(FriendlyByteBuf::readResourceLocation, FriendlyByteBuf::readIntIdList)).
Parameters
FriendlyByteBuf friendlyByteBuf
ตัวอย่างใช้งาน
FriendlyByteBuf friendlyByteBuf = ...;
TagNetworkSerialization.NetworkPayload result = TagNetworkSerialization.NetworkPayload.read(friendlyByteBuf);
net.minecraft.tags.TagNetworkSerialization$NetworkPayload#resolve(Registry<T>)
- Origin:
common - Source:
net/minecraft/tags/TagNetworkSerialization.java:83 - Modifiers:
public - Return:
TagLoader.LoadResult<T>
คืออะไร
ดำเนินการ resolve ตาม implementation ของ TagNetworkSerialization$NetworkPayload
ทำงานยังไง
เรียกต่อ: deserializeTagsFromNetwork(). คืนค่า: TagNetworkSerialization.deserializeTagsFromNetwork(registry, this).
Parameters
Registry<T> registry
ตัวอย่างใช้งาน
TagNetworkSerialization.NetworkPayload instance = ...;
Registry<T> registry = ...;
TagLoader.LoadResult<T> result = instance.resolve(registry);
net.minecraft.tags.TagNetworkSerialization$NetworkPayload#size()
- Origin:
common - Source:
net/minecraft/tags/TagNetworkSerialization.java:79 - Modifiers:
public - Return:
int
คืออะไร
ดำเนินการ size ตาม implementation ของ TagNetworkSerialization$NetworkPayload
ทำงานยังไง
คืนค่า: this.tags.size().
Parameters
- ไม่มี
ตัวอย่างใช้งาน
net.minecraft.tags.TagNetworkSerialization$NetworkPayload#write(FriendlyByteBuf)
- Origin:
common - Source:
net/minecraft/tags/TagNetworkSerialization.java:67 - Modifiers:
public - Return:
void
คืออะไร
เขียน write
ทำงานยังไง
เรียกต่อ: writeMap().
Parameters
FriendlyByteBuf friendlyByteBuf
ตัวอย่างใช้งาน
TagNetworkSerialization.NetworkPayload instance = ...;
FriendlyByteBuf friendlyByteBuf = ...;
instance.write(friendlyByteBuf);