Skip to content

SendCommonAssetsEvent

Package: com.hypixel.hytale.server.core.asset.common.events Implements: 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().

FieldTypeAccessorMutableNullable
packetHandlerPacketHandlergetPacketHandler()NoNo
assetsAsset[]getRequestedAssets()NoNo
  • packetHandler — The packet handler for the connecting client.
  • assets — The array of assets being sent to the client.

Dispatch location not identified in decompiled source. This event may be dispatched by game modules not yet mapped.

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;
});
});