Class GeyserDefineResourcePacksEvent
java.lang.Object
org.geysermc.geyser.api.event.lifecycle.GeyserDefineResourcePacksEvent
- All Implemented Interfaces:
org.geysermc.event.Event
public abstract class GeyserDefineResourcePacksEvent
extends Object
implements org.geysermc.event.Event
Called when
ResourcePack's are loaded within Geyser.- Since:
- 2.6.2
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionabstract @Nullable ResourcePackOption<?> option(@NonNull UUID uuid, @NonNull ResourcePackOption.Type type) Returns the current option, or null, for a givenResourcePackOption.Type.abstract Collection<ResourcePackOption<?>> Returns a collection ofResourcePackOption's for a registeredResourcePack.abstract voidregister(@NonNull ResourcePack pack, @Nullable ResourcePackOption<?>... options) Registers aResourcePackto be sent to the client, optionally alongsideResourcePackOption's specifying how it will be applied on clients.abstract voidregisterOptions(@NonNull UUID uuid, @NonNull ResourcePackOption<?>... options) SetsResourcePackOption's for aResourcePack.abstract @NonNull List<ResourcePack> Gets theResourcePack's that will be sent to connecting Bedrock clients.abstract voidunregister(@NonNull UUID uuid) Unregisters aResourcePackfrom the list of packs sent to connecting Bedrock clients.
-
Constructor Details
-
GeyserDefineResourcePacksEvent
public GeyserDefineResourcePacksEvent()
-
-
Method Details
-
resourcePacks
Gets theResourcePack's that will be sent to connecting Bedrock clients. To remove packs, useunregister(UUID), as the list returned by this method is unmodifiable.- Returns:
- an unmodifiable list of
ResourcePack's - Since:
- 2.6.2
-
register
public abstract void register(@NonNull ResourcePack pack, @Nullable ResourcePackOption<?>... options) Registers aResourcePackto be sent to the client, optionally alongsideResourcePackOption's specifying how it will be applied on clients.- Parameters:
pack- a resource pack that will be sent to the clientoptions-ResourcePackOption's that specify how clients load the pack- Throws:
ResourcePackException- if an issue occurred during pack registration- Since:
- 2.6.2
-
registerOptions
SetsResourcePackOption's for aResourcePack.- Parameters:
uuid- the uuid of the resource pack to register the options foroptions- theResourcePackOption's to register for the resource pack- Throws:
ResourcePackException- if an issue occurred duringResourcePackOptionregistration- Since:
- 2.6.2
-
options
Returns a collection ofResourcePackOption's for a registeredResourcePack. The collection returned here is not modifiable.- Parameters:
uuid- the uuid of theResourcePackfor which the options are set- Returns:
- a collection of
ResourcePackOption's - Throws:
ResourcePackException- if the pack was not registered- Since:
- 2.6.2
-
option
public abstract @Nullable ResourcePackOption<?> option(@NonNull UUID uuid, @NonNull ResourcePackOption.Type type) Returns the current option, or null, for a givenResourcePackOption.Type.- Parameters:
uuid- theResourcePackfor which to query this option typetype- theResourcePackOption.Typeof the option to query- Throws:
ResourcePackException- if the queried option is invalid or not present on the resource pack- Since:
- 2.6.2
-
unregister
Unregisters aResourcePackfrom the list of packs sent to connecting Bedrock clients.- Parameters:
uuid- the UUID of theResourcePackto be removed- Since:
- 2.6.2
-