Skip to content

Commit

Permalink
fix future errors for out-of-date MM hook
Browse files Browse the repository at this point in the history
  • Loading branch information
justEli committed Apr 14, 2022
1 parent 8998018 commit ea80af1
Showing 1 changed file with 10 additions and 7 deletions.
17 changes: 10 additions & 7 deletions src/main/java/me/justeli/coins/Coins.java
Original file line number Diff line number Diff line change
Expand Up @@ -92,15 +92,18 @@ public void onEnable ()
if (getServer().getPluginManager().isPluginEnabled("MythicMobs"))
{
Optional<Plugin> mm = Optional.ofNullable(getServer().getPluginManager().getPlugin("MythicMobs"));
if (mm.isPresent() && mm.get().getDescription().getVersion().startsWith("4."))
try
{
this.mmHook = new MythicMobsHook4(this);
if (mm.isPresent() && mm.get().getDescription().getVersion().startsWith("4."))
{
this.mmHook = new MythicMobsHook4(this);
}
else if (mm.isPresent())
{
this.mmHook = new MythicMobsHook5(this);
}
}
else if (mm.isPresent() && mm.get().getDescription().getVersion().startsWith("5."))
{
this.mmHook = new MythicMobsHook5(this);
}
else
catch (Exception | NoClassDefFoundError exception)
{
console(Level.WARNING, "Detected MythicMobs, but the version of MythicMobs you are using is not supported.");
}
Expand Down

0 comments on commit ea80af1

Please sign in to comment.