mirror of
https://github.com/PaperMC/Paper.git
synced 2025-03-09 13:19:25 +01:00
Expose MinecraftServer#isRunning
This allows for plugins to detect if the server is actually turning off in onDisable rather than just plugins reloading.
This commit is contained in:
parent
c0e42aed8a
commit
a690b2a859
@ -2575,6 +2575,15 @@ public final class Bukkit {
|
|||||||
public static int getCurrentTick() {
|
public static int getCurrentTick() {
|
||||||
return server.getCurrentTick();
|
return server.getCurrentTick();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Checks if the server is in the process of being shutdown.
|
||||||
|
*
|
||||||
|
* @return true if server is in the process of being shutdown
|
||||||
|
*/
|
||||||
|
public static boolean isStopping() {
|
||||||
|
return server.isStopping();
|
||||||
|
}
|
||||||
// Paper end
|
// Paper end
|
||||||
|
|
||||||
@NotNull
|
@NotNull
|
||||||
|
@ -2243,5 +2243,12 @@ public interface Server extends PluginMessageRecipient, net.kyori.adventure.audi
|
|||||||
* @return Current tick
|
* @return Current tick
|
||||||
*/
|
*/
|
||||||
int getCurrentTick();
|
int getCurrentTick();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Checks if the server is in the process of being shutdown.
|
||||||
|
*
|
||||||
|
* @return true if server is in the process of being shutdown
|
||||||
|
*/
|
||||||
|
boolean isStopping();
|
||||||
// Paper end
|
// Paper end
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user