geforkt von Mirrors/Paper
SPIGOT-113: Add save status to ChunkUnloadEvent
By: md_5 <git@md-5.net>
Dieser Commit ist enthalten in:
Ursprung
0c42c407cf
Commit
86e3aea9ba
@ -10,9 +10,33 @@ import org.bukkit.event.HandlerList;
|
|||||||
public class ChunkUnloadEvent extends ChunkEvent implements Cancellable {
|
public class ChunkUnloadEvent extends ChunkEvent implements Cancellable {
|
||||||
private static final HandlerList handlers = new HandlerList();
|
private static final HandlerList handlers = new HandlerList();
|
||||||
private boolean cancel = false;
|
private boolean cancel = false;
|
||||||
|
private boolean saveChunk;
|
||||||
|
|
||||||
public ChunkUnloadEvent(final Chunk chunk) {
|
public ChunkUnloadEvent(final Chunk chunk) {
|
||||||
|
this(chunk, true);
|
||||||
|
}
|
||||||
|
|
||||||
|
public ChunkUnloadEvent(Chunk chunk, boolean save) {
|
||||||
super(chunk);
|
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() {
|
public boolean isCancelled() {
|
||||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren