mirror of
https://github.com/PaperMC/Paper.git
synced 2025-08-01 12:42:05 -07:00
Remove, not invalidate, Metadata on reload
Objects loaded over different class loaders are not the same. Nasty dragons lie here. Also clean up the previous patch to no longer butcher imports.
This commit is contained in:
28
Spigot-Server-Patches/Remove-Metadata-on-reload.patch
Normal file
28
Spigot-Server-Patches/Remove-Metadata-on-reload.patch
Normal file
@@ -0,0 +1,28 @@
|
||||
From 0000000000000000000000000000000000000000 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
|
||||
|
||||
Metadata is not meant to persist reload as things break badly with non primitive types
|
||||
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 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
@@ -0,0 +0,0 @@ public final class CraftServer implements Server {
|
||||
world.paperConfig.init(); // Paper
|
||||
}
|
||||
|
||||
+ // Paper start
|
||||
+ for (Plugin plugin : pluginManager.getPlugins()) {
|
||||
+ entityMetadata.removeAll(plugin);
|
||||
+ worldMetadata.removeAll(plugin);
|
||||
+ playerMetadata.removeAll(plugin);
|
||||
+ }
|
||||
+ // Paper end
|
||||
+
|
||||
pluginManager.clearPlugins();
|
||||
commandMap.clearCommands();
|
||||
resetRecipes();
|
||||
--
|
Reference in New Issue
Block a user