mirror of
https://github.com/YatopiaMC/Yatopia.git
synced 2024-08-24 23:03:00 +02:00
51 lines
2.2 KiB
Diff
51 lines
2.2 KiB
Diff
From 567d1317da975eb4a4f63a3f0d4f29dd3e7648e7 Mon Sep 17 00:00:00 2001
|
|
From: Aikar <aikar@aikar.co>
|
|
Date: Fri, 8 May 2015 19:56:21 -0400
|
|
Subject: [PATCH] EMC ServerShutdownEvent and move disablePlugins
|
|
|
|
---
|
|
src/main/java/net/minecraft/server/MinecraftServer.java | 6 +++++-
|
|
1 file changed, 5 insertions(+), 1 deletion(-)
|
|
|
|
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
|
|
index f4a0104799..01c509dca0 100644
|
|
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
|
|
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
|
|
@@ -99,6 +99,7 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant<TickTas
|
|
private boolean A;
|
|
private boolean spawnAnimals;
|
|
private boolean spawnNPCs;
|
|
+ public String shutdownReason; // EMC
|
|
private boolean pvpMode;
|
|
private boolean allowFlight;
|
|
@Nullable
|
|
@@ -738,7 +739,8 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant<TickTas
|
|
MinecraftTimings.stopServer(); // Paper
|
|
// CraftBukkit start
|
|
if (this.server != null) {
|
|
- this.server.disablePlugins();
|
|
+ // this.server.disablePlugins(); // EMC - Moved below after everything has unloaded so plugins can get events
|
|
+ new com.empireminecraft.customevents.ServerShutdownEvent(shutdownReason).callEvent(); // EMC
|
|
}
|
|
// CraftBukkit end
|
|
if (this.getServerConnection() != null) {
|
|
@@ -777,6 +779,7 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant<TickTas
|
|
}
|
|
}
|
|
}
|
|
+ if (server != null) { this.server.disablePlugins(); } // EMC
|
|
|
|
if (this.snooper.d()) {
|
|
this.snooper.e();
|
|
@@ -819,6 +822,7 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant<TickTas
|
|
this.safeShutdown(flag, false);
|
|
}
|
|
public void safeShutdown(boolean flag, boolean isRestarting) {
|
|
+ if (shutdownReason == null) { shutdownReason = "Server Shutting Down"; } // EMC
|
|
this.isRunning = false;
|
|
this.isRestarting = isRestarting;
|
|
if (flag) {
|
|
--
|
|
2.25.1.windows.1
|
|
|