mirror of
https://github.com/TotalFreedomMC/TF-ProjectKorra.git
synced 2024-08-16 08:26:29 +00:00
Fix disabled abilities outputting multiple times
This commit is contained in:
parent
16e546a5b8
commit
20ae458d57
|
@ -346,6 +346,7 @@ public abstract class CoreAbility implements Ability {
|
|||
* @see #getAbility(String)
|
||||
*/
|
||||
public static void registerPluginAbilities(JavaPlugin plugin, String packagePrefix) {
|
||||
List<String> disabled = new ArrayList<String>(); //this way multiple classes with the same name only show once
|
||||
if (plugin == null) {
|
||||
return;
|
||||
}
|
||||
|
@ -373,8 +374,9 @@ public abstract class CoreAbility implements Ability {
|
|||
|
||||
if (ability == null || ability.getName() == null) {
|
||||
continue;
|
||||
} else if (!ability.isEnabled()) {
|
||||
} else if (!ability.isEnabled() && !disabled.contains(ability.getName())) {
|
||||
plugin.getLogger().info(ability.getName() + " is disabled");
|
||||
disabled.add(ability.getName());
|
||||
continue;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue