Class JavaRegistryTagCache
java.lang.Object
org.geysermc.geyser.session.cache.registry.JavaRegistryTagCache
- All Implemented Interfaces:
JavaRegistryProvider
A
JavaRegistryProvider for a GeyserSession, accessed through GeyserSession.javaRegistries().
This class builds on top of BuiltInJavaRegistries.PROVIDER, and as such works with both built-in and networked registries.
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.geysermc.geyser.registry.java.JavaRegistryProvider
JavaRegistryProvider.Provider -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidvoidclear()voidfreeze()voidloadRegistryData(org.geysermc.mcprotocollib.protocol.packet.configuration.clientbound.ClientboundRegistryDataPacket registryData) voidloadTags(Optional<GeyserSession> session, org.geysermc.mcprotocollib.protocol.packet.common.clientbound.ClientboundUpdateTagsPacket tagsPacket) it.unimi.dsi.fastutil.ints.IntListProvides a list of raw network IDs for the giventag.<T> JavaRegistry<T> registry(JavaRegistryKey<T> registryKey) Provides aJavaRegistryfor the givenregistryKey.Collection<Tag<?>> tags()Returns a collection of all currently loaded tags, across all loaded registries.
-
Constructor Details
-
JavaRegistryTagCache
public JavaRegistryTagCache()
-
-
Method Details
-
registry
Description copied from interface:JavaRegistryProviderProvides aJavaRegistryfor the givenregistryKey.- Specified by:
registryin interfaceJavaRegistryProvider- Type Parameters:
T- the type of the registry- Parameters:
registryKey- the registry key to get aJavaRegistryfor- Returns:
- the
JavaRegistryfor theregistryKey
-
rawTag
Description copied from interface:JavaRegistryProviderProvides a list of raw network IDs for the giventag. This can be an empty list.Generally, prefer using
JavaRegistryProvider.tag(Tag)as it maps the network IDs into a list of objects.- Specified by:
rawTagin interfaceJavaRegistryProvider- Parameters:
tag- the tag to look up- Returns:
- the list of raw network IDs the tag holds
-
tags
Description copied from interface:JavaRegistryProviderReturns a collection of all currently loaded tags, across all loaded registries.- Specified by:
tagsin interfaceJavaRegistryProvider- Returns:
- a collection of all currently loaded tags
-
clear
public void clear() -
loadRegistryData
public void loadRegistryData(org.geysermc.mcprotocollib.protocol.packet.configuration.clientbound.ClientboundRegistryDataPacket registryData) -
loadTags
public void loadTags(Optional<GeyserSession> session, org.geysermc.mcprotocollib.protocol.packet.common.clientbound.ClientboundUpdateTagsPacket tagsPacket) -
freeze
public void freeze() -
bootstrap
public static void bootstrap()
-