mirror of
https://hub.spigotmc.org/stash/scm/spigot/bukkit.git
synced 2025-08-21 05:44:17 +00:00
SPIGOT-113: Add save status to ChunkUnloadEvent
This commit is contained in:
parent
a1760b6bae
commit
19b3d5ef4c
1 changed files with 24 additions and 0 deletions
|
@ -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() {
|
||||
|
|
Loading…
Add table
Reference in a new issue