Clear plugin metadata only after onDisable()

Fixes GH-776
This commit is contained in:
Zach Brown 2017-07-15 14:38:16 -05:00
parent 00c64f7fb7
commit fd624f502d
No known key found for this signature in database
GPG Key ID: CC9DA35FC5450B76
6 changed files with 50 additions and 46 deletions

View File

@ -1,4 +1,4 @@
From 536719157e98b638ededac2d4783d28c71c713a3 Mon Sep 17 00:00:00 2001
From b64a5f23a1d7d7c6346ff839899a30cc9cfb72b4 Mon Sep 17 00:00:00 2001
From: Aikar <aikar@aikar.co>
Date: Fri, 18 Mar 2016 13:50:14 -0400
Subject: [PATCH] Remove Metadata on reload
@ -7,24 +7,28 @@ Metadata is not meant to persist reload as things break badly with non primitive
This will remove metadata on reload so it does not crash everything if a plugin uses it.
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
index b8f907038..f7aa5fb8a 100644
index b8f90703..d4de72c8 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
@@ -740,6 +740,14 @@ public final class CraftServer implements Server {
@@ -740,8 +740,18 @@ public final class CraftServer implements Server {
world.paperConfig.init(); // Paper
}
+ Plugin[] pluginClone = pluginManager.getPlugins().clone(); // Paper
pluginManager.clearPlugins();
commandMap.clearCommands();
+
+ // Paper start
+ for (Plugin plugin : pluginManager.getPlugins()) {
+ for (Plugin plugin : pluginClone) {
+ entityMetadata.removeAll(plugin);
+ worldMetadata.removeAll(plugin);
+ playerMetadata.removeAll(plugin);
+ }
+ // Paper end
+
pluginManager.clearPlugins();
commandMap.clearCommands();
resetRecipes();
reloadData();
org.spigotmc.SpigotConfig.registerCommands(); // Spigot
--
2.13.2
2.13.3.windows.1

View File

@ -1,4 +1,4 @@
From bc1bd2b258d075727eeb9f44efa05655e2c83ca1 Mon Sep 17 00:00:00 2001
From aedee6bcb11dca6b91ee4c4093b90e8485e837e7 Mon Sep 17 00:00:00 2001
From: Aikar <aikar@aikar.co>
Date: Sat, 13 Sep 2014 23:14:43 -0400
Subject: [PATCH] Configurable Keep Spawn Loaded range per world
@ -6,7 +6,7 @@ Subject: [PATCH] Configurable Keep Spawn Loaded range per world
This lets you disable it for some worlds and lower it for others.
diff --git a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
index 74a49a5fb..3a942c763 100644
index 74a49a5f..3a942c76 100644
--- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
+++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
@@ -284,4 +284,10 @@ public class PaperWorldConfig {
@ -21,7 +21,7 @@ index 74a49a5fb..3a942c763 100644
+ }
}
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
index 6e11ba5b6..71b66bbdf 100644
index 6e11ba5b..71b66bbd 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
@@ -356,8 +356,11 @@ public abstract class MinecraftServer implements ICommandListener, Runnable, IAs
@ -39,7 +39,7 @@ index 6e11ba5b6..71b66bbdf 100644
if (i1 - j > 1000L) {
diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java
index 553d9724b..e9446b9ce 100644
index 553d9724..e9446b9c 100644
--- a/src/main/java/net/minecraft/server/World.java
+++ b/src/main/java/net/minecraft/server/World.java
@@ -3208,8 +3208,9 @@ public abstract class World implements IBlockAccess {
@ -54,10 +54,10 @@ index 553d9724b..e9446b9ce 100644
public void a(Packet<?> packet) {
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
index f7aa5fb8a..d77a43e8f 100644
index d4de72c8..8b77440d 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
@@ -956,7 +956,7 @@ public final class CraftServer implements Server {
@@ -958,7 +958,7 @@ public final class CraftServer implements Server {
System.out.print("Preparing start region for level " + (console.worlds.size() - 1) + " (Seed: " + internal.getSeed() + ")");
if (internal.getWorld().getKeepSpawnInMemory()) {
@ -67,7 +67,7 @@ index f7aa5fb8a..d77a43e8f 100644
for (int j = -short1; j <= short1; j += 16) {
for (int k = -short1; k <= short1; k += 16) {
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
index 843a3415f..24b4a7ea7 100644
index 843a3415..24b4a7ea 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
@@ -1275,8 +1275,9 @@ public class CraftWorld implements World {
@ -83,5 +83,5 @@ index 843a3415f..24b4a7ea7 100644
loadChunk(chunkCoordX + x, chunkCoordZ + z);
} else {
--
2.13.2
2.13.3.windows.1

View File

@ -1,11 +1,11 @@
From 05b5ca2521bedfd517b8b9db8acb1c9a6ea49b61 Mon Sep 17 00:00:00 2001
From d75b758b043fe5cf40c2c26f7b4715297dcf345b Mon Sep 17 00:00:00 2001
From: Gabriele C <sgdc3.mail@gmail.com>
Date: Fri, 5 Aug 2016 01:03:08 +0200
Subject: [PATCH] Add setting for proxy online mode status
diff --git a/src/main/java/com/destroystokyo/paper/PaperConfig.java b/src/main/java/com/destroystokyo/paper/PaperConfig.java
index 011cbf5e3..cf06f8ac3 100644
index 011cbf5e..cf06f8ac 100644
--- a/src/main/java/com/destroystokyo/paper/PaperConfig.java
+++ b/src/main/java/com/destroystokyo/paper/PaperConfig.java
@@ -230,4 +230,9 @@ public class PaperConfig {
@ -19,7 +19,7 @@ index 011cbf5e3..cf06f8ac3 100644
+ }
}
diff --git a/src/main/java/net/minecraft/server/NameReferencingFileConverter.java b/src/main/java/net/minecraft/server/NameReferencingFileConverter.java
index b943a9b20..8f3b93dc1 100644
index b943a9b2..8f3b93dc 100644
--- a/src/main/java/net/minecraft/server/NameReferencingFileConverter.java
+++ b/src/main/java/net/minecraft/server/NameReferencingFileConverter.java
@@ -66,7 +66,8 @@ public class NameReferencingFileConverter {
@ -33,10 +33,10 @@ index b943a9b20..8f3b93dc1 100644
} else {
String[] astring1 = astring;
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
index d77a43e8f..40ca66d7a 100644
index 8b77440d..7c872ce6 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
@@ -1321,7 +1321,8 @@ public final class CraftServer implements Server {
@@ -1323,7 +1323,8 @@ public final class CraftServer implements Server {
// Spigot Start
GameProfile profile = null;
// Only fetch an online UUID in online mode
@ -47,5 +47,5 @@ index d77a43e8f..40ca66d7a 100644
profile = console.getUserCache().getProfile( name );
}
--
2.13.2
2.13.3.windows.1

View File

@ -1,4 +1,4 @@
From 81074d51eae9926f704a4facbea5f98280898746 Mon Sep 17 00:00:00 2001
From ada39c2911337be94248c5c3bef16570c7374c0f Mon Sep 17 00:00:00 2001
From: willies952002 <admin@domnian.com>
Date: Mon, 28 Nov 2016 10:21:52 -0500
Subject: [PATCH] Allow Reloading of Command Aliases
@ -6,10 +6,10 @@ Subject: [PATCH] Allow Reloading of Command Aliases
Reload the aliases stored in commands.yml
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
index 40ca66d7a..93fbb306e 100644
index 7c872ce6..ee526e91 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
@@ -1855,5 +1855,24 @@ public final class CraftServer implements Server {
@@ -1857,5 +1857,24 @@ public final class CraftServer implements Server {
});
}
}
@ -35,5 +35,5 @@ index 40ca66d7a..93fbb306e 100644
// Paper end
}
--
2.13.2
2.13.3.windows.1

View File

@ -1,4 +1,4 @@
From 8982d7162a827470fa89bb9fe0154bb3a10ce7f8 Mon Sep 17 00:00:00 2001
From 7162c39f12cc2d8229abd388d7c1fcbbf8a0ef5e Mon Sep 17 00:00:00 2001
From: kashike <kashike@vq.lc>
Date: Fri, 9 Jun 2017 07:24:34 -0700
Subject: [PATCH] Add configuration option to prevent player names from being
@ -6,7 +6,7 @@ Subject: [PATCH] Add configuration option to prevent player names from being
diff --git a/src/main/java/com/destroystokyo/paper/PaperConfig.java b/src/main/java/com/destroystokyo/paper/PaperConfig.java
index 28917f63d..f4b237034 100644
index 28917f63..f4b23703 100644
--- a/src/main/java/com/destroystokyo/paper/PaperConfig.java
+++ b/src/main/java/com/destroystokyo/paper/PaperConfig.java
@@ -265,4 +265,9 @@ public class PaperConfig {
@ -20,10 +20,10 @@ index 28917f63d..f4b237034 100644
+ }
}
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
index 93fbb306e..d079de0fe 100644
index ee526e91..dbb44d63 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
@@ -1874,5 +1874,10 @@ public final class CraftServer implements Server {
@@ -1876,5 +1876,10 @@ public final class CraftServer implements Server {
commandMap.registerServerAliases();
return true;
}
@ -35,5 +35,5 @@ index 93fbb306e..d079de0fe 100644
// Paper end
}
--
2.13.2
2.13.3.windows.1

View File

@ -1,4 +1,4 @@
From 96eae4e755730fed1cfb3a9de9e02102c83c00c8 Mon Sep 17 00:00:00 2001
From fc1189eaba170bf32e11dc12d0c07a1903e83f5f Mon Sep 17 00:00:00 2001
From: Minecrell <dev@minecrell.net>
Date: Fri, 9 Jun 2017 19:03:43 +0200
Subject: [PATCH] Use TerminalConsoleAppender for console improvements
@ -20,7 +20,7 @@ Other changes:
configuration
diff --git a/pom.xml b/pom.xml
index 1ddfe7f4b..63a1ae2b0 100644
index 1ddfe7f4..63a1ae2b 100644
--- a/pom.xml
+++ b/pom.xml
@@ -47,12 +47,6 @@
@ -96,7 +96,7 @@ index 1ddfe7f4b..63a1ae2b0 100644
<groupId>org.apache.maven.plugins</groupId>
diff --git a/src/main/java/com/destroystokyo/paper/console/TerminalConsoleCommandSender.java b/src/main/java/com/destroystokyo/paper/console/TerminalConsoleCommandSender.java
new file mode 100644
index 000000000..685deaa0e
index 00000000..685deaa0
--- /dev/null
+++ b/src/main/java/com/destroystokyo/paper/console/TerminalConsoleCommandSender.java
@@ -0,0 +1,17 @@
@ -119,7 +119,7 @@ index 000000000..685deaa0e
+}
diff --git a/src/main/java/com/destroystokyo/paper/console/TerminalHandler.java b/src/main/java/com/destroystokyo/paper/console/TerminalHandler.java
new file mode 100644
index 000000000..d5bc61490
index 00000000..d5bc6149
--- /dev/null
+++ b/src/main/java/com/destroystokyo/paper/console/TerminalHandler.java
@@ -0,0 +1,60 @@
@ -184,7 +184,7 @@ index 000000000..d5bc61490
+
+}
diff --git a/src/main/java/net/minecraft/server/DedicatedServer.java b/src/main/java/net/minecraft/server/DedicatedServer.java
index 2feeb855b..3266df1f5 100644
index 2feeb855..3266df1f 100644
--- a/src/main/java/net/minecraft/server/DedicatedServer.java
+++ b/src/main/java/net/minecraft/server/DedicatedServer.java
@@ -73,7 +73,10 @@ public class DedicatedServer extends MinecraftServer implements IMinecraftServer
@ -237,7 +237,7 @@ index 2feeb855b..3266df1f5 100644
System.setOut(new PrintStream(new LoggerOutputStream(logger, Level.INFO), true));
System.setErr(new PrintStream(new LoggerOutputStream(logger, Level.WARN), true));
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
index d84f59da1..8ca8fdceb 100644
index d84f59da..8ca8fdce 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
@@ -41,7 +41,6 @@ import org.apache.commons.lang3.Validate;
@ -296,7 +296,7 @@ index d84f59da1..8ca8fdceb 100644
public boolean a(int i, String s) {
diff --git a/src/main/java/net/minecraft/server/PlayerList.java b/src/main/java/net/minecraft/server/PlayerList.java
index c3c82f1f1..9a4357d19 100644
index c3c82f1f..9a4357d1 100644
--- a/src/main/java/net/minecraft/server/PlayerList.java
+++ b/src/main/java/net/minecraft/server/PlayerList.java
@@ -76,8 +76,7 @@ public abstract class PlayerList {
@ -310,7 +310,7 @@ index c3c82f1f1..9a4357d19 100644
this.k = new GameProfileBanList(PlayerList.a);
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
index d079de0fe..a4b6f4be1 100644
index dbb44d63..12f1bdfc 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
@@ -127,7 +127,6 @@ import io.netty.buffer.ByteBuf;
@ -321,7 +321,7 @@ index d079de0fe..a4b6f4be1 100644
import org.apache.commons.lang.StringUtils;
import org.bukkit.NamespacedKey;
import org.bukkit.craftbukkit.util.CraftNamespacedKey;
@@ -1089,9 +1088,13 @@ public final class CraftServer implements Server {
@@ -1091,9 +1090,13 @@ public final class CraftServer implements Server {
return logger;
}
@ -336,7 +336,7 @@ index d079de0fe..a4b6f4be1 100644
@Override
public PluginCommand getPluginCommand(String name) {
diff --git a/src/main/java/org/bukkit/craftbukkit/Main.java b/src/main/java/org/bukkit/craftbukkit/Main.java
index ec9508e90..d3d848f8c 100644
index ec9508e9..d3d848f8 100644
--- a/src/main/java/org/bukkit/craftbukkit/Main.java
+++ b/src/main/java/org/bukkit/craftbukkit/Main.java
@@ -14,7 +14,7 @@ import java.util.logging.Logger;
@ -378,7 +378,7 @@ index ec9508e90..d3d848f8c 100644
if (Main.class.getPackage().getImplementationVendor() != null && System.getProperty("IReallyKnowWhatIAmDoingISwear") == null) {
diff --git a/src/main/java/org/bukkit/craftbukkit/command/ColouredConsoleSender.java b/src/main/java/org/bukkit/craftbukkit/command/ColouredConsoleSender.java
deleted file mode 100644
index 26a2fb894..000000000
index 26a2fb89..00000000
--- a/src/main/java/org/bukkit/craftbukkit/command/ColouredConsoleSender.java
+++ /dev/null
@@ -1,74 +0,0 @@
@ -457,7 +457,7 @@ index 26a2fb894..000000000
- }
-}
diff --git a/src/main/java/org/bukkit/craftbukkit/command/ConsoleCommandCompleter.java b/src/main/java/org/bukkit/craftbukkit/command/ConsoleCommandCompleter.java
index 33e8ea02c..1e3aae3b8 100644
index 33e8ea02..1e3aae3b 100644
--- a/src/main/java/org/bukkit/craftbukkit/command/ConsoleCommandCompleter.java
+++ b/src/main/java/org/bukkit/craftbukkit/command/ConsoleCommandCompleter.java
@@ -8,17 +8,27 @@ import java.util.logging.Level;
@ -536,7 +536,7 @@ index 33e8ea02c..1e3aae3b8 100644
}
}
diff --git a/src/main/java/org/bukkit/craftbukkit/util/ServerShutdownThread.java b/src/main/java/org/bukkit/craftbukkit/util/ServerShutdownThread.java
index a0cdd2317..0a1812883 100644
index a0cdd231..0a181288 100644
--- a/src/main/java/org/bukkit/craftbukkit/util/ServerShutdownThread.java
+++ b/src/main/java/org/bukkit/craftbukkit/util/ServerShutdownThread.java
@@ -19,7 +19,7 @@ public class ServerShutdownThread extends Thread {
@ -550,7 +550,7 @@ index a0cdd2317..0a1812883 100644
}
diff --git a/src/main/java/org/bukkit/craftbukkit/util/TerminalConsoleWriterThread.java b/src/main/java/org/bukkit/craftbukkit/util/TerminalConsoleWriterThread.java
deleted file mode 100644
index b64097113..000000000
index b6409711..00000000
--- a/src/main/java/org/bukkit/craftbukkit/util/TerminalConsoleWriterThread.java
+++ /dev/null
@@ -1,54 +0,0 @@
@ -609,7 +609,7 @@ index b64097113..000000000
- }
-}
diff --git a/src/main/resources/log4j2.xml b/src/main/resources/log4j2.xml
index 5cee8f00e..08b6bb7f9 100644
index 5cee8f00..08b6bb7f 100644
--- a/src/main/resources/log4j2.xml
+++ b/src/main/resources/log4j2.xml
@@ -1,12 +1,11 @@
@ -639,5 +639,5 @@ index 5cee8f00e..08b6bb7f9 100644
<AppenderRef ref="TerminalConsole" level="info"/>
</Root>
--
2.13.2
2.13.3.windows.1