diff options
author | md_5 <git@md-5.net> | 2016-07-11 21:10:49 +1000 |
---|---|---|
committer | md_5 <git@md-5.net> | 2016-07-11 21:10:49 +1000 |
commit | 19b3d5ef4cd3cc4cef246dd9dba02199e19f5daf (patch) | |
tree | f9ca1eeeab05ef9faf93127d6c5d540f5d28663f /src/main/java/org | |
parent | a1760b6baec0db18f0eeda14e371a75fa6fc3d3b (diff) | |
download | bukkit-19b3d5ef4cd3cc4cef246dd9dba02199e19f5daf.tar bukkit-19b3d5ef4cd3cc4cef246dd9dba02199e19f5daf.tar.gz bukkit-19b3d5ef4cd3cc4cef246dd9dba02199e19f5daf.tar.lz bukkit-19b3d5ef4cd3cc4cef246dd9dba02199e19f5daf.tar.xz bukkit-19b3d5ef4cd3cc4cef246dd9dba02199e19f5daf.zip |
SPIGOT-113: Add save status to ChunkUnloadEvent
Diffstat (limited to 'src/main/java/org')
-rw-r--r-- | src/main/java/org/bukkit/event/world/ChunkUnloadEvent.java | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/src/main/java/org/bukkit/event/world/ChunkUnloadEvent.java b/src/main/java/org/bukkit/event/world/ChunkUnloadEvent.java index f59d0914..aa8573dc 100644 --- a/src/main/java/org/bukkit/event/world/ChunkUnloadEvent.java +++ b/src/main/java/org/bukkit/event/world/ChunkUnloadEvent.java @@ -10,9 +10,33 @@ import org.bukkit.event.HandlerList; public class ChunkUnloadEvent extends ChunkEvent implements Cancellable { private static final HandlerList handlers = new HandlerList(); private boolean cancel = false; + private boolean saveChunk; public ChunkUnloadEvent(final Chunk chunk) { + this(chunk, true); + } + + public ChunkUnloadEvent(Chunk chunk, boolean save) { super(chunk); + this.saveChunk = save; + } + + /** + * Return whether this chunk will be saved to disk. + * + * @return chunk save status + */ + public boolean isSaveChunk() { + return saveChunk; + } + + /** + * Set whether this chunk will be saved to disk. + * + * @param saveChunk chunk save status + */ + public void setSaveChunk(boolean saveChunk) { + this.saveChunk = saveChunk; } public boolean isCancelled() { |