mirror of
https://github.com/TotalFreedomMC/TF-ProjectKorra.git
synced 2025-02-18 22:24:35 +00:00
Apply fix to API, AbstractMethodError
This commit is contained in:
parent
db0c691892
commit
de0b638a82
1 changed files with 81 additions and 66 deletions
|
@ -207,6 +207,7 @@ public class AbilityModuleManager {
|
|||
}
|
||||
}
|
||||
for (AbilityModule ab: ability) {
|
||||
try {
|
||||
//To check if EarthBlast == Earthblast or for example, EarthBlast == EARTHBLAST
|
||||
boolean succes = true;
|
||||
for(String enabledAbility : abilities){
|
||||
|
@ -275,6 +276,20 @@ public class AbilityModuleManager {
|
|||
// if (ab.isMetalbendingAbility()) metalbendingabilities.add(ab.getName());
|
||||
descriptions.put(ab.getName(), ab.getDescription());
|
||||
authors.put(ab.getName(), ab.getAuthor());
|
||||
} catch (AbstractMethodError e) { //If triggered means ability was made pre 1.6 BETA 8
|
||||
ProjectKorra.log.warning("The ability " + ab.getName() + " is either broken or outdated. Please remove it!");
|
||||
e.printStackTrace();
|
||||
ab.stop();
|
||||
abilities.remove(ab.getName());
|
||||
final AbilityModule skill = ab;
|
||||
//Bellow to avoid ConcurrentModificationException
|
||||
plugin.getServer().getScheduler().scheduleSyncDelayedTask(plugin, new Runnable() {
|
||||
public void run() {
|
||||
ability.remove(skill);
|
||||
}
|
||||
}, 10);
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
Collections.sort(airbendingabilities);
|
||||
|
|
Loading…
Reference in a new issue