-
Bug
-
Resolution: Unresolved
-
Minor
-
None
-
None
-
1.20.6-R0.1-SNAPSHOT
-
Yes
at org.bukkit.plugin.java.JavaPlugin.setEnabled(boolean enabled)
This code has a logical flaw.It should be
protected final void setEnabled(boolean enabled) { if (this.isEnabled != enabled) { if (enabled) { this.onEnable(); } else { this.onDisable(); } this.isEnabled = enabled; } }
Because when call method "onEnable()" it may throw an exception and not loaded successfully, but call method "isEnabled()" will get a fake status.This also cause some plugin work incorrect, for example, use PlugManX to load a plugin but throw an exception and loaded unsuccessfully, but call method "isEnabled()" will get a value that "true"!!!
However, I don't consider a condition that call method "onDisable()" but throw an exception!!!!!!!!