Files
OldSliceMC/patches/server/0014-ChunkStatusChangeEvent.patch
2024-11-13 08:31:35 -06:00

25 lines
1.7 KiB
Diff

From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Cryptite <cryptite@gmail.com>
Date: Wed, 13 Nov 2024 08:07:59 -0600
Subject: [PATCH] ChunkStatusChangeEvent
diff --git a/src/main/java/ca/spottedleaf/moonrise/patches/chunk_system/scheduling/NewChunkHolder.java b/src/main/java/ca/spottedleaf/moonrise/patches/chunk_system/scheduling/NewChunkHolder.java
index eafa4e6d55cd0f9314ac0f2b96a7f48fbb5e1a4c..1c39f73a10a05b792adf4d98b7db24edb2938030 100644
--- a/src/main/java/ca/spottedleaf/moonrise/patches/chunk_system/scheduling/NewChunkHolder.java
+++ b/src/main/java/ca/spottedleaf/moonrise/patches/chunk_system/scheduling/NewChunkHolder.java
@@ -1261,6 +1261,13 @@ public final class NewChunkHolder {
// note: currentChunk must be LevelChunk, as current != pending which means that at least one is not ACCESSIBLE
final LevelChunk chunk = (LevelChunk)this.currentChunk;
+ // Slice start
+ new com.destroystokyo.paper.event.chunk.ChunkStatusChangeEvent(new org.bukkit.craftbukkit.CraftChunk(chunk),
+ com.destroystokyo.paper.event.chunk.ChunkStatusChangeEvent.ChunkStatus.valueOf(currState.name()),
+ com.destroystokyo.paper.event.chunk.ChunkStatusChangeEvent.ChunkStatus.valueOf(nextState.name()))
+ .callEvent();
+ // Slice end
+
// Note: we assume that only load/unload contain plugin logic
// plugin logic is anything stupid enough to possibly change the chunk status while it is already
// being changed (i.e during load it is possible it will try to set to full ticking)