Wolvereness/PhysicalShop — Issue #3: Changing extended-names from false to true and reloading fails
Author: AgentME
Created: 2012-02-15 10:43:16+00:00
State: open

If you run the plugin with extended-names set to false, change it to true in the config.yml file, and then run "physicalshop reload", you get a nice stacktrace:

2012-02-15 10:29:45 [WARNING] Unexpected exception while parsing console command org.bukkit.command.CommandException: Unhandled exception executing command 'physicalshop' in plugin PhysicalShop v9.0.1
at org.bukkit.command.PluginCommand.execute(PluginCommand.java:42)
at org.bukkit.command.SimpleCommandMap.dispatch(SimpleCommandMap.java:168)
at org.bukkit.craftbukkit.CraftServer.dispatchCommand(CraftServer.java:402)
at org.bukkit.craftbukkit.CraftServer.dispatchCommand(CraftServer.java:398)
at net.minecraft.server.MinecraftServer.b(MinecraftServer.java:574)
at net.minecraft.server.MinecraftServer.w(MinecraftServer.java:551)
at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:435)
at net.minecraft.server.ThreadServerApplication.run(SourceFile:465)
Caused by: java.lang.IllegalArgumentException: PhysicalShop v9.0.1 not registered.
at com.wolvereness.util.NameCollection.unregisterPlugin(NameCollection.java:172)
at com.wolvereness.physicalshop.PhysicalShop.reloadConfig(PhysicalShop.java:182)
at com.wolvereness.util.CommandHandler$Reload.go(CommandHandler.java:39)
at com.wolvereness.util.CommandHandler$ShortCommand.onCommand(CommandHandler.java:104)
at com.wolvereness.physicalshop.PhysicalShop.onCommand(PhysicalShop.java:131)
at org.bukkit.command.PluginCommand.execute(PluginCommand.java:40)
... 7 more

It seems to be because the config is reloaded before deciding whether to call NameCollection.unregisterPlugin() in PhysicalShop.reloadConfig(). I imagine moving the possible call to NameCollection.unregisterPlugin() to before the config reload should fix it.