SendCommonAssetsEvent
Package:
com.hypixel.hytale.server.core.asset.common.eventsImplements:IAsyncEvent<Void>Cancellable: No Async: Yes
Asynchronous event dispatched when common assets are being sent to a connecting client. This is one of the few async events in the Hytale event system, allowing listeners to perform I/O operations during asset transfer.
Note: The accessor for the assets array is named getRequestedAssets() in the decompiled source, not getAssets().
Fields / Accessors
Section titled “Fields / Accessors”| Field | Type | Accessor | Mutable | Nullable |
|---|---|---|---|---|
packetHandler | PacketHandler | getPacketHandler() | No | No |
assets | Asset[] | getRequestedAssets() | No | No |
- packetHandler — The packet handler for the connecting client.
- assets — The array of assets being sent to the client.
Fired By
Section titled “Fired By”Dispatch location not identified in decompiled source. This event may be dispatched by game modules not yet mapped.
Listening
Section titled “Listening”Because SendCommonAssetsEvent implements IAsyncEvent, use registerAsync for async handling.
getEventRegistry().registerAsync(SendCommonAssetsEvent.class, future -> { return future.thenApply(event -> { PacketHandler handler = event.getPacketHandler(); Asset[] assets = event.getRequestedAssets();
// Perform async operations during asset transfer return event; });});Related Events
Section titled “Related Events”AssetPackRegisterEvent— Fired when asset packs are registered.LoadAssetEvent— Fired during the boot asset loading phase.