Class TagCache
java.lang.Object
org.geysermc.geyser.session.cache.TagCache
Manages information sent from the
ClientboundUpdateTagsPacket. If that packet is not sent, all lists here
will remain empty, matching Java Edition behavior. Looking up a tag that wasn't listed in that packet will return an empty array.
Only tags from suitable registries in JavaRegistries are stored. Read JavaRegistryKey for more information.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription<T> List<T>int[]<T> booleanis(@Nullable GeyserHolderSet<T> holderSet, @Nullable T object) booleanis(Tag<Item> tag, GeyserItemStack itemStack) <T> booleanbooleanisBlock(@Nullable org.geysermc.mcprotocollib.protocol.data.game.item.component.HolderSet holderSet, @NonNull Block block) booleanisItem(@Nullable org.geysermc.mcprotocollib.protocol.data.game.item.component.HolderSet holderSet, @NonNull Item item) voidloadPacket(GeyserSession session, org.geysermc.mcprotocollib.protocol.packet.common.clientbound.ClientboundUpdateTagsPacket packet) static <T> List<T>mapRawArray(GeyserSession session, int[] array, JavaRegistryKey<T> registry) Maps a raw array of network IDs to their respective objects.
-
Constructor Details
-
TagCache
-
-
Method Details
-
loadPacket
public void loadPacket(GeyserSession session, org.geysermc.mcprotocollib.protocol.packet.common.clientbound.ClientboundUpdateTagsPacket packet) -
is
-
is
- Returns:
- true if the item tag is present and contains this item stack's Java ID.
-
is
- Returns:
- true if the specified network ID is in the given holder set.
-
isItem
public boolean isItem(@Nullable org.geysermc.mcprotocollib.protocol.data.game.item.component.HolderSet holderSet, @NonNull Item item) -
isBlock
public boolean isBlock(@Nullable org.geysermc.mcprotocollib.protocol.data.game.item.component.HolderSet holderSet, @NonNull Block block) -
get
-
getRaw
- Returns:
- the network IDs in the given tag. This can be an empty list.
-
mapRawArray
public static <T> List<T> mapRawArray(GeyserSession session, int[] array, JavaRegistryKey<T> registry) Maps a raw array of network IDs to their respective objects.
-