1
0
mirror of https://github.com/Zrips/Jobs.git synced 2025-01-02 14:29:07 +01:00

Lets default condition to true if not provided otherwise

This commit is contained in:
Zrips 2018-06-21 12:31:15 +03:00
parent b5dad11233
commit 3499706018
2 changed files with 8 additions and 4 deletions

View File

@ -35,7 +35,6 @@ import com.gamingmesh.jobs.container.JobConditions;
import com.gamingmesh.jobs.container.JobPermission;
import com.gamingmesh.jobs.container.JobProgression;
import com.gamingmesh.jobs.container.JobsPlayer;
import com.gamingmesh.jobs.stuff.Debug;
public class PermissionHandler {
private Jobs plugin;

View File

@ -49,9 +49,14 @@ public class JobConditions {
for (String one : perform) {
if (!one.toLowerCase().contains("p:"))
continue;
String perm = one.toLowerCase().replace("p:", "").split("-")[0];
boolean n = one.toLowerCase().replace("p:", "").split("-")[1].equalsIgnoreCase("true") ? true : false;
performPerm.put(perm, n);
String clean = one.toLowerCase().substring("p:".length());
if (clean.contains("-")) {
String perm = clean.split("-")[0];
boolean n = clean.split("-")[1].equalsIgnoreCase("true") ? true : false;
performPerm.put(perm, n);
} else {
performPerm.put(clean, true);
}
}
}