Added __on_chunk_unloaded scarpet event (#1451)

* Fixes #1403

* Use concrete type
This commit is contained in:
Luca Bertozzi authored and GitHub committed 2022-05-27 20:24:25 +02:00
1 parent d088ee477e
commit 8c7dfa133e
3 files changed
+27

No files matched your search

@@ -467,6 +467,18 @@ public class CarpetEventServer
}
};
public static final Event CHUNK_UNLOADED = new Event("chunk_unloaded", 2, true)
{
@Override
public void onChunkEvent(ServerLevel world, ChunkPos chPos, boolean generated)
{
handler.call(
() -> Arrays.asList(new NumericValue(chPos.x << 4), new NumericValue(chPos.z << 4)),
() -> CarpetServer.minecraft_server.createCommandSourceStack().withLevel(world)
);
}
};
public static final Event PLAYER_JUMPS = new Event("player_jumps", 1, false)
{
@Override