mirror of
https://github.com/TotalFreedomMC/TF-ProjectKorra.git
synced 2024-09-11 04:39:32 +00:00
Merge pull request #416 from kingbirdy/master
Fix disabled abilities outputting multiple times
This commit is contained in:
commit
fe47af9630
|
@ -346,6 +346,7 @@ public abstract class CoreAbility implements Ability {
|
||||||
* @see #getAbility(String)
|
* @see #getAbility(String)
|
||||||
*/
|
*/
|
||||||
public static void registerPluginAbilities(JavaPlugin plugin, String packagePrefix) {
|
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) {
|
if (plugin == null) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -373,8 +374,9 @@ public abstract class CoreAbility implements Ability {
|
||||||
|
|
||||||
if (ability == null || ability.getName() == null) {
|
if (ability == null || ability.getName() == null) {
|
||||||
continue;
|
continue;
|
||||||
} else if (!ability.isEnabled()) {
|
} else if (!ability.isEnabled() && !disabled.contains(ability.getName())) {
|
||||||
plugin.getLogger().info(ability.getName() + " is disabled");
|
plugin.getLogger().info(ability.getName() + " is disabled");
|
||||||
|
disabled.add(ability.getName());
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue