mirror of
https://github.com/PaperMC/Paper.git
synced 2025-01-09 19:49:35 +01:00
SPIGOT-113: Add save status to ChunkUnloadEvent
By: md_5 <git@md-5.net>
This commit is contained in:
parent
0c42c407cf
commit
86e3aea9ba
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…
Reference in a new issue