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:
parent
b5dad11233
commit
3499706018
@ -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;
|
||||
|
@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user