1
0
mirror of https://github.com/Zrips/Jobs.git synced 2025-02-08 08:21:41 +01:00

Properly handle subTypes for "all" identifier

- Fix build
This commit is contained in:
montlikadani 2020-10-22 13:10:37 +02:00
parent b00a8762f3
commit f1194bfd32
2 changed files with 8 additions and 28 deletions

View File

@ -387,6 +387,7 @@ public class ConfigManager {
String type = null,
subType = "",
meta = "";
final String finalMyKey = myKey;
int id = 0;
if (myKey.contains("-")) {
@ -397,6 +398,7 @@ public class ConfigManager {
} else if (myKey.contains(":")) { // when we uses tipped arrow effect types
String[] split = myKey.split(":");
meta = split.length > 1 ? split[1] : myKey;
subType = ":all";
myKey = split[0];
}
@ -609,12 +611,12 @@ public class ConfigManager {
if (myKey.contains(":")) {
subType = myKey.split(":")[1];
}
} else if (actionType == ActionType.SHEAR) {
if (myKey.startsWith("color") && (myKey.endsWith("-all") || myKey.endsWith(":all"))) {
type = myKey.split(":|-")[0];
} else {
type = myKey;
}
} else if (actionType == ActionType.SHEAR && !myKey.startsWith("color")) {
type = myKey;
}
if (finalMyKey.endsWith("-all") || finalMyKey.endsWith(":all")) {
type = finalMyKey.split(":|-")[0];
}
if (type == null) {

View File

@ -1,22 +0,0 @@
package com.gamingmesh.jobs.hooks.Boss;
import org.bukkit.entity.Entity;
import org.mineacademy.boss.api.Boss;
import org.mineacademy.boss.api.BossAPI;
public class BossManager {
public String getName(Entity entity) {
return BossAPI.isBoss(entity) ? BossAPI.getBoss(entity).getName() : "";
}
public String getName(String name) {
for (Boss boss : BossAPI.getBosses()) {
if (boss.getName().equalsIgnoreCase(name)) {
return boss.getName();
}
}
return "";
}
}