9
0
mirror of https://github.com/Auxilor/EcoMobs.git synced 2025-12-21 16:09:24 +00:00

Updated how mythic mob fetcher works

This commit is contained in:
_OfTeN_
2021-09-19 23:01:40 +03:00
parent a2c8b73dbc
commit 203bec560e
2 changed files with 17 additions and 12 deletions

View File

@@ -27,22 +27,24 @@ public class BossEntityUtils {
*/ */
public static BossType getBossType(@NotNull String id) { public static BossType getBossType(@NotNull String id) {
if (mythicMobs && id.startsWith("mythicmobs_")) { if (id.startsWith("mythicmobs_")) {
int level; if (mythicMobs) {
int level;
try { try {
level = Integer.parseInt(Arrays.stream(id.split("_")).toList().get(id.split("_").length-1)); level = Integer.parseInt(Arrays.stream(id.split("_")).toList().get(id.split("_").length-1));
} catch (NumberFormatException exception) { } catch (NumberFormatException exception) {
level = 1; level = 1;
} }
MythicMob mob = MythicMobs.inst().getMobManager().getMythicMob(id.replace("mythicmobs_", "").replace("_"+level, "")); MythicMob mob = MythicMobs.inst().getMobManager().getMythicMob(id.replace("mythicmobs_", "").replace("_"+level, ""));
if (mob != null) { if (mob != null) {
return new MythicMobsBossType(mob, level); return new MythicMobsBossType(mob, level);
} }
else id = "zombie";
} else id = "zombie";
else id = "zombie";
} }
try { try {

View File

@@ -5,6 +5,9 @@ api-version: 1.16
authors: [Auxilor] authors: [Auxilor]
website: willfp.com website: willfp.com
load: STARTUP load: STARTUP
softdepend:
- MythicMobs
- LevelledMobs
depend: depend:
- eco - eco