1
0
mirror of https://github.com/Zrips/Jobs.git synced 2024-11-25 20:16:13 +01:00

Permission nodes should be for OP by default

This commit is contained in:
Zrips 2019-05-26 11:49:03 +03:00
parent efad176d17
commit 671f4ff15a
3 changed files with 21 additions and 19 deletions

View File

@ -102,6 +102,7 @@ import com.gamingmesh.jobs.listeners.JobsPaymentListener;
import com.gamingmesh.jobs.listeners.PistonProtectionListener;
import com.gamingmesh.jobs.selection.SelectionManager;
import com.gamingmesh.jobs.stuff.CMIScoreboardManager;
import com.gamingmesh.jobs.stuff.Debug;
import com.gamingmesh.jobs.stuff.FurnaceBrewingHandling;
import com.gamingmesh.jobs.stuff.Loging;
import com.gamingmesh.jobs.stuff.PageInfo;
@ -228,13 +229,13 @@ public class Jobs extends JavaPlugin {
if (!getServer().getPluginManager().isPluginEnabled("PlaceholderAPI"))
return false;
if (getVersionCheckManager().convertVersion(getServer().getPluginManager()
.getPlugin("PlaceholderAPI").getDescription().getVersion()) >= getVersionCheckManager().convertVersion("2.10.0")) {
.getPlugin("PlaceholderAPI").getDescription().getVersion()) >= getVersionCheckManager().convertVersion("2.10.0")) {
if ((new NewPlaceholderAPIHook(this)).register())
consoleMsg("&e[Jobs] PlaceholderAPI hooked.");
} else {
if ((new PlaceholderAPIHook(this)).hook())
consoleMsg("&e[Jobs] PlaceholderAPI hooked. This is a deprecated version. In the PlaceholderAPI"
+ " new version has removed the extension and we using the latest.");
+ " new version has removed the extension and we using the latest.");
}
return true;
}
@ -913,7 +914,8 @@ public class Jobs extends JavaPlugin {
@Override
public void onDisable() {
if (instance == null) return;
if (instance == null)
return;
try {
GUIManager.CloseInventories();
@ -1187,7 +1189,7 @@ public class Jobs extends JavaPlugin {
}
if (prog.addExperience(expAmount))
getPlayerManager().performLevelUp(jPlayer, prog.getJob(), oldLevel);
getPlayerManager().performLevelUp(jPlayer, prog.getJob(), oldLevel);
}
//need to update bp
@ -1339,7 +1341,7 @@ public class Jobs extends JavaPlugin {
}
if (prog.addExperience(payment.getExp()))
getPlayerManager().performLevelUp(jPlayer, prog.getJob(), oldLevel);
getPlayerManager().performLevelUp(jPlayer, prog.getJob(), oldLevel);
}
public static void consoleMsg(String msg) {
@ -1351,19 +1353,20 @@ public class Jobs extends JavaPlugin {
}
public static boolean hasPermission(Object sender, String perm, boolean rawEnable) {
if (sender instanceof Player) {
if (((Player) sender).hasPermission(perm))
return true;
if (!rawEnable) {
((Player) sender).sendMessage(lManager.getMessage("general.error.permission"));
return false;
}
RawMessage rm = new RawMessage();
rm.add(lManager.getMessage("general.error.permission"), "&2" + perm);
rm.show((Player) sender);
if (!(sender instanceof Player))
return true;
if (((Player) sender).hasPermission(perm))
return true;
if (!rawEnable) {
((Player) sender).sendMessage(lManager.getMessage("general.error.permission"));
return false;
}
return true;
RawMessage rm = new RawMessage();
rm.add(lManager.getMessage("general.error.permission"), "&2" + perm);
rm.show((Player) sender);
return false;
}
public void ShowPagination(CommandSender sender, PageInfo pi, String cmd) {

View File

@ -32,7 +32,6 @@ public class area implements Cmd {
if (args[0].equalsIgnoreCase("add")) {
if (!Jobs.hasPermission(player, "jobs.area.add", true))
return true;
String name = args[1];
double bonus = 0D;
try {

View File

@ -207,7 +207,7 @@ permissions:
default: op
jobs.area.add:
description: Grants access to the area add command
default: false
default: op
jobs.area.remove:
description: Grants access to the area remove command
default: false
default: op