SPIGOT-113: Add save status to ChunkUnloadEvent

By: md_5 <git@md-5.net>
This commit is contained in:
CraftBukkit/Spigot 2016-07-11 21:10:56 +10:00
parent a63680b107
commit b38424139e

View File

@ -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++) {