Class SessionLoadResourcePacksEvent
java.lang.Object
org.geysermc.geyser.api.event.connection.ConnectionEvent
org.geysermc.geyser.api.event.bedrock.SessionLoadResourcePacksEvent
- All Implemented Interfaces:
org.geysermc.event.Event
Called when Geyser initializes a session for a new Bedrock client and is in the process of sending
ResourcePack's.- Since:
- 2.1.1
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionabstract voidallowVibrantVisuals(boolean enabled) Whether to forcefully disable vibrant visuals for joining clients.abstract @Nullable ResourcePackOption<?>option(@NonNull UUID uuid, @NonNull ResourcePackOption.Type type) Returns the currentResourcePackOption, or null, for a givenResourcePackOption.Type.abstract Collection<ResourcePackOption<?>>Returns a collection ofResourcePackOption's for a registeredResourcePack.abstract booleanregister(@NonNull ResourcePack pack) Deprecated.abstract voidregister(@NonNull ResourcePack pack, @Nullable ResourcePackOption<?>... options) Registers aResourcePackto be sent to the client, optionally alongside specificResourcePackOption's specifying how it will be applied by the client.abstract voidregisterOptions(@NonNull UUID uuid, @NonNull ResourcePackOption<?>... options) SetsResourcePackOption's for aResourcePack.abstract @NonNull List<ResourcePack>Gets theResourcePack's that will be sent to thisGeyserConnection.abstract booleanunregister(@NonNull UUID uuid) Unregisters aResourcePackfrom the list of packs sent to thisGeyserConnection.Methods inherited from class org.geysermc.geyser.api.event.connection.ConnectionEvent
connection
-
Constructor Details
-
SessionLoadResourcePacksEvent
-
-
Method Details
-
resourcePacks
Gets theResourcePack's that will be sent to thisGeyserConnection. To remove packs, useunregister(UUID), as the list returned by this method is unmodifiable.- Returns:
- an unmodifiable list of
ResourcePack's - Since:
- 2.1.1
-
register
Deprecated.Use {register(ResourcePack, ResourcePackOption[])} instead -
register
public abstract void register(@NonNull ResourcePack pack, @Nullable ResourcePackOption<?>... options) Registers aResourcePackto be sent to the client, optionally alongside specificResourcePackOption's specifying how it will be applied by the client.- Parameters:
pack- theResourcePackthat will be sent to the clientoptions-ResourcePackOption's that specify how the client loads the pack- Throws:
ResourcePackException- if an issue occurred during pack registration- Since:
- 2.6.2
-
registerOptions
SetsResourcePackOption's for aResourcePack. This method can also be used to override options for resource packs already registered in theGeyserDefineResourcePacksEvent.- 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- 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 currentResourcePackOption, 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 thisGeyserConnection.- Parameters:
uuid- the UUID of theResourcePackto be removed- Since:
- 2.1.1
-
allowVibrantVisuals
public abstract void allowVibrantVisuals(boolean enabled) Whether to forcefully disable vibrant visuals for joining clients. While vibrant visuals are nice to look at, they can cause issues with some resource packs.- Parameters:
enabled- Whether vibrant visuals are allowed. This is true by default.- Since:
- 2.7.2
-
register(ResourcePack, ResourcePackOption[])} instead