mirror of
https://github.com/Zrips/Jobs.git
synced 2024-11-29 14:05:25 +01:00
Revert back to old permission check
This commit is contained in:
parent
e9187ad9fa
commit
7b55e161ea
@ -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;
|
||||
@ -65,7 +64,7 @@ public class PermissionHandler {
|
||||
}
|
||||
|
||||
// Permissions should only apply if we have permission to use jobs in this world
|
||||
if (hasWorldPermission2(player, player.getWorld().getName())) {
|
||||
if (hasWorldPermission(player, player.getWorld().getName())) {
|
||||
List<JobProgression> progression = jPlayer.getJobProgression();
|
||||
// calculate new permissions
|
||||
HashMap<String, Boolean> permissions = new HashMap<String, Boolean>();
|
||||
@ -252,26 +251,6 @@ public class PermissionHandler {
|
||||
return player.hasPermission("jobs.world." + world.toLowerCase());
|
||||
}
|
||||
|
||||
public boolean hasWorldPermission2(Player player, String world) {
|
||||
boolean foundMain = false;
|
||||
boolean foundWorld = false;
|
||||
for (PermissionAttachmentInfo one : player.getEffectivePermissions()) {
|
||||
if (one.getPermission().equalsIgnoreCase("jobs.use")) {
|
||||
foundMain = true;
|
||||
if (foundWorld)
|
||||
break;
|
||||
}
|
||||
if (one.getPermission().equalsIgnoreCase("jobs.world." + world.toLowerCase())) {
|
||||
foundWorld = true;
|
||||
if (foundMain)
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (!foundMain || !foundWorld)
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
public boolean hasWorldPermission(JobsPlayer player, String world) {
|
||||
if (!Jobs.getPermissionManager().hasPermission(player, "jobs.use")) {
|
||||
return false;
|
||||
|
@ -270,9 +270,6 @@ public class JobsPaymentListener implements Listener {
|
||||
if (!Jobs.getPermissionHandler().hasWorldPermission(player, player.getLocation().getWorld().getName()))
|
||||
return;
|
||||
|
||||
if (!Jobs.getPermissionHandler().hasWorldPermission2(player, player.getLocation().getWorld().getName()))
|
||||
return;
|
||||
|
||||
BlockActionInfo bInfo = new BlockActionInfo(block, ActionType.BREAK);
|
||||
FastPayment fp = Jobs.FastPayment.get(player.getName());
|
||||
if (fp != null) {
|
||||
|
Loading…
Reference in New Issue
Block a user