mirror of
https://github.com/Zrips/Jobs.git
synced 2025-01-04 23:37:49 +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.JobPermission;
|
||||||
import com.gamingmesh.jobs.container.JobProgression;
|
import com.gamingmesh.jobs.container.JobProgression;
|
||||||
import com.gamingmesh.jobs.container.JobsPlayer;
|
import com.gamingmesh.jobs.container.JobsPlayer;
|
||||||
import com.gamingmesh.jobs.stuff.Debug;
|
|
||||||
|
|
||||||
public class PermissionHandler {
|
public class PermissionHandler {
|
||||||
private Jobs plugin;
|
private Jobs plugin;
|
||||||
|
@ -49,9 +49,14 @@ public class JobConditions {
|
|||||||
for (String one : perform) {
|
for (String one : perform) {
|
||||||
if (!one.toLowerCase().contains("p:"))
|
if (!one.toLowerCase().contains("p:"))
|
||||||
continue;
|
continue;
|
||||||
String perm = one.toLowerCase().replace("p:", "").split("-")[0];
|
String clean = one.toLowerCase().substring("p:".length());
|
||||||
boolean n = one.toLowerCase().replace("p:", "").split("-")[1].equalsIgnoreCase("true") ? true : false;
|
if (clean.contains("-")) {
|
||||||
performPerm.put(perm, n);
|
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