dev.polymodloader.api.event.world
This page is generated from the source's Javadoc by ./gradlew apiReference. Do not edit it; fix the source comment and generate it again.
| Type | Kind | Description |
|---|---|---|
ChunkListener | functional interface | Listener for WorldEvents.CHUNK_LOADED and WorldEvents.CHUNK_UNLOADED. |
WorldEvents | class | Server-side dimension events. |
WorldListener | functional interface | Listener for WorldEvents.LOADED, WorldEvents.UNLOADED, and WorldEvents.SAVING. |
WorldReadyListener | functional interface | Listener for WorldEvents.READY. |
ChunkListener
functional interface · Stability PREVIEW · Since 0.1.0-alpha.4 or earlier
public interface ChunkListener
Listener for WorldEvents.CHUNK_LOADED and WorldEvents.CHUNK_UNLOADED.
onChunk(WorldView, int, int)
void onChunk(WorldView world, int chunkX, int chunkZ)
Since 0.1.0-alpha.4 or earlier
A chunk of world; coordinates are chunk coordinates. Keep it cheap: chunks load often.
| Parameter | Type | Description |
|---|---|---|
world | WorldView | — |
chunkX | int | — |
chunkZ | int | — |
WorldEvents
class · Stability PREVIEW · Since 0.1.0-alpha.4 or earlier
public final class WorldEvents
Server-side dimension events. Per dimension and server start the order is LOADED, READY, SAVING (on every save), UNLOADED. Fabric API: ServerWorldEvents; NeoForge: LevelEvent.Load, Unload, Save.
| Constant or field | Type | Description |
|---|---|---|
LOADED | EventKey<WorldListener> | The server created every dimension of the world; fired for each, before spawn chunks are prepared and before the first tick. Dimensions are not saved or ticking yet. |
SAVING | EventKey<WorldListener> | A dimension is about to be saved (autosave, /save-all, or stopping), before its chunks and level data are written; changes made now are saved with it. |
UNLOADED | EventKey<WorldListener> | The stopping server is about to close a dimension, after it was saved; the last moment to read it. Changes are not saved any more. |
READY | EventKey<WorldReadyListener> | A dimension ticks for the first time after it was loaded or created; a good moment to read WorldView.storage. Fired once per dimension per server start. |
CHUNK_LOADED | EventKey<ChunkListener> | A chunk finished loading (from disk or newly generated) on the server. |
CHUNK_UNLOADED | EventKey<ChunkListener> | A chunk is about to be unloaded on the server; it has been saved. |
WorldListener
functional interface · Stability PREVIEW · Since 0.1.0-alpha.4 or earlier
public interface WorldListener
Listener for WorldEvents.LOADED, WorldEvents.UNLOADED, and WorldEvents.SAVING.
onWorld(WorldView)
void onWorld(WorldView world)
Since 0.1.0-alpha.4 or earlier
Called on the server thread; world is valid only during the call.
| Parameter | Type | Description |
|---|---|---|
world | WorldView | — |
WorldReadyListener
functional interface · Stability PREVIEW · Since 0.1.0-alpha.4 or earlier
public interface WorldReadyListener
Listener for WorldEvents.READY.
onWorldReady(WorldView)
void onWorldReady(WorldView world)
Since 0.1.0-alpha.4 or earlier
Called on the server thread at the start of the dimension's first tick.
| Parameter | Type | Description |
|---|---|---|
world | WorldView | — |