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.
This commit is contained in:
Aikar 2016-03-18 13:50:14 -04:00
parent acfd9a39a0
commit 2a04d23940

View file

@ -1005,8 +1005,16 @@ public final class CraftServer implements Server {
world.spigotConfig.init(); // Spigot
}
Plugin[] pluginClone = pluginManager.getPlugins().clone(); // Paper
this.pluginManager.clearPlugins();
this.commandMap.clearCommands();
// Paper start
for (Plugin plugin : pluginClone) {
entityMetadata.removeAll(plugin);
worldMetadata.removeAll(plugin);
playerMetadata.removeAll(plugin);
}
// Paper end
this.reloadData();
org.spigotmc.SpigotConfig.registerCommands(); // Spigot
io.papermc.paper.command.PaperCommands.registerCommands(this.console); // Paper