mirror of
https://github.com/PaperMC/Paper.git
synced 2024-12-24 01:47:42 +01:00
SPIGOT-113: Add save status to ChunkUnloadEvent
This commit is contained in:
parent
a625e4567d
commit
0df416d679
@ -140,17 +140,18 @@
|
||||
++i;
|
||||
}
|
||||
}
|
||||
@@ -197,6 +270,39 @@
|
||||
@@ -197,6 +270,40 @@
|
||||
return false;
|
||||
}
|
||||
|
||||
+ // CraftBukkit start
|
||||
+ public boolean unloadChunk(Chunk chunk, boolean save) {
|
||||
+ ChunkUnloadEvent event = new ChunkUnloadEvent(chunk.bukkitChunk);
|
||||
+ ChunkUnloadEvent event = new ChunkUnloadEvent(chunk.bukkitChunk, save);
|
||||
+ this.world.getServer().getPluginManager().callEvent(event);
|
||||
+ if (event.isCancelled()) {
|
||||
+ return false;
|
||||
+ }
|
||||
+ save = event.isSaveChunk();
|
||||
+
|
||||
+ // Update neighbor counts
|
||||
+ for (int x = -2; x < 3; x++) {
|
||||
|
Loading…
Reference in New Issue
Block a user