mirror of
https://github.com/IntellectualSites/PlotSquared.git
synced 2024-11-22 05:06:44 +01:00
Finished updating to new permissions system.
This commit is contained in:
parent
d2df275000
commit
8f2de99001
@ -152,7 +152,7 @@ public class Plot implements Cloneable {
|
|||||||
* @return true if the player is added as a helper or is the owner
|
* @return true if the player is added as a helper or is the owner
|
||||||
*/
|
*/
|
||||||
public boolean hasRights(Player player) {
|
public boolean hasRights(Player player) {
|
||||||
return player.hasPermission("plots.admin")
|
return PlotMain.hasPermission(player, "plots.admin")
|
||||||
|| ((this.helpers != null) && this.helpers.contains(DBFunc.everyone))
|
|| ((this.helpers != null) && this.helpers.contains(DBFunc.everyone))
|
||||||
|| ((this.helpers != null) && this.helpers.contains(player.getUniqueId()))
|
|| ((this.helpers != null) && this.helpers.contains(player.getUniqueId()))
|
||||||
|| ((this.owner != null) && this.owner.equals(player.getUniqueId()))
|
|| ((this.owner != null) && this.owner.equals(player.getUniqueId()))
|
||||||
|
@ -99,7 +99,7 @@ public class Auto extends SubCommand {
|
|||||||
sendMessage(plr, C.SCHEMATIC_INVALID, "non-existent: " + schematic);
|
sendMessage(plr, C.SCHEMATIC_INVALID, "non-existent: " + schematic);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
if (!plr.hasPermission("plots.claim." + schematic) && !plr.hasPermission("plots.admin")) {
|
if (!PlotMain.hasPermission(plr,"plots.claim." + schematic) && !plr.hasPermission("plots.admin")) {
|
||||||
PlayerFunctions.sendMessage(plr, C.NO_SCHEMATIC_PERMISSION, schematic);
|
PlayerFunctions.sendMessage(plr, C.NO_SCHEMATIC_PERMISSION, schematic);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -70,7 +70,7 @@ public class Claim extends SubCommand {
|
|||||||
sendMessage(plr, C.SCHEMATIC_INVALID, "non-existent: " + schematic);
|
sendMessage(plr, C.SCHEMATIC_INVALID, "non-existent: " + schematic);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
if (!plr.hasPermission("plots.claim." + schematic) && !plr.hasPermission("plots.admin")) {
|
if (!PlotMain.hasPermission(plr,"plots.claim." + schematic) && !plr.hasPermission("plots.admin")) {
|
||||||
PlayerFunctions.sendMessage(plr, C.NO_SCHEMATIC_PERMISSION, schematic);
|
PlayerFunctions.sendMessage(plr, C.NO_SCHEMATIC_PERMISSION, schematic);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -13,6 +13,7 @@ import org.bukkit.entity.Player;
|
|||||||
import com.intellectualcrafters.plot.C;
|
import com.intellectualcrafters.plot.C;
|
||||||
import com.intellectualcrafters.plot.PlayerFunctions;
|
import com.intellectualcrafters.plot.PlayerFunctions;
|
||||||
import com.intellectualcrafters.plot.Plot;
|
import com.intellectualcrafters.plot.Plot;
|
||||||
|
import com.intellectualcrafters.plot.PlotMain;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Created by Citymonstret on 2014-08-01.
|
* Created by Citymonstret on 2014-08-01.
|
||||||
@ -38,7 +39,7 @@ public class Clear extends SubCommand {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if (((plot == null) || !plot.hasOwner() || !plot.getOwner().equals(plr.getUniqueId()))
|
if (((plot == null) || !plot.hasOwner() || !plot.getOwner().equals(plr.getUniqueId()))
|
||||||
&& !plr.hasPermission("plots.admin")) {
|
&& !PlotMain.hasPermission(plr,"plots.admin")) {
|
||||||
PlayerFunctions.sendMessage(plr, C.NO_PLOT_PERMS);
|
PlayerFunctions.sendMessage(plr, C.NO_PLOT_PERMS);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@ -29,7 +29,7 @@ public class Copy extends SubCommand {
|
|||||||
}
|
}
|
||||||
Plot plot = PlayerFunctions.getCurrentPlot(plr);
|
Plot plot = PlayerFunctions.getCurrentPlot(plr);
|
||||||
if (((plot == null) || !plot.hasOwner() || !plot.getOwner().equals(plr.getUniqueId()))
|
if (((plot == null) || !plot.hasOwner() || !plot.getOwner().equals(plr.getUniqueId()))
|
||||||
&& !plr.hasPermission("plots.admin")) {
|
&& !PlotMain.hasPermission(plr,"plots.admin")) {
|
||||||
PlayerFunctions.sendMessage(plr, C.NO_PLOT_PERMS);
|
PlayerFunctions.sendMessage(plr, C.NO_PLOT_PERMS);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@ -41,7 +41,7 @@ public class Delete extends SubCommand {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if ((((plot == null) || !plot.hasOwner() || !plot.getOwner().equals(plr.getUniqueId())))
|
if ((((plot == null) || !plot.hasOwner() || !plot.getOwner().equals(plr.getUniqueId())))
|
||||||
&& !plr.hasPermission("plots.admin")) {
|
&& !PlotMain.hasPermission(plr,"plots.admin")) {
|
||||||
PlayerFunctions.sendMessage(plr, C.NO_PLOT_PERMS);
|
PlayerFunctions.sendMessage(plr, C.NO_PLOT_PERMS);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@ -14,6 +14,7 @@ import org.bukkit.entity.Player;
|
|||||||
import com.intellectualcrafters.plot.C;
|
import com.intellectualcrafters.plot.C;
|
||||||
import com.intellectualcrafters.plot.PlayerFunctions;
|
import com.intellectualcrafters.plot.PlayerFunctions;
|
||||||
import com.intellectualcrafters.plot.Plot;
|
import com.intellectualcrafters.plot.Plot;
|
||||||
|
import com.intellectualcrafters.plot.PlotMain;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Created by Citymonstret on 2014-08-01.
|
* Created by Citymonstret on 2014-08-01.
|
||||||
@ -32,7 +33,7 @@ public class Kick extends SubCommand {
|
|||||||
}
|
}
|
||||||
Plot plot = PlayerFunctions.getCurrentPlot(plr);
|
Plot plot = PlayerFunctions.getCurrentPlot(plr);
|
||||||
if (((plot == null) || !plot.hasOwner() || !plot.getOwner().equals(plr.getUniqueId()))
|
if (((plot == null) || !plot.hasOwner() || !plot.getOwner().equals(plr.getUniqueId()))
|
||||||
&& !plr.hasPermission("plots.admin")) {
|
&& !PlotMain.hasPermission(plr,"plots.admin")) {
|
||||||
PlayerFunctions.sendMessage(plr, C.NO_PLOT_PERMS);
|
PlayerFunctions.sendMessage(plr, C.NO_PLOT_PERMS);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@ -21,7 +21,7 @@ public class Paste extends SubCommand {
|
|||||||
}
|
}
|
||||||
Plot plot = PlayerFunctions.getCurrentPlot(plr);
|
Plot plot = PlayerFunctions.getCurrentPlot(plr);
|
||||||
if (((plot == null) || !plot.hasOwner() || !plot.getOwner().equals(plr.getUniqueId()))
|
if (((plot == null) || !plot.hasOwner() || !plot.getOwner().equals(plr.getUniqueId()))
|
||||||
&& !plr.hasPermission("plots.admin")) {
|
&& !PlotMain.hasPermission(plr,"plots.admin")) {
|
||||||
PlayerFunctions.sendMessage(plr, C.NO_PLOT_PERMS);
|
PlayerFunctions.sendMessage(plr, C.NO_PLOT_PERMS);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@ -50,7 +50,7 @@ public class Set extends SubCommand {
|
|||||||
sendMessage(plr, C.PLOT_NOT_CLAIMED);
|
sendMessage(plr, C.PLOT_NOT_CLAIMED);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if (!plot.hasRights(plr) && !plr.hasPermission("plots.admin")) {
|
if (!plot.hasRights(plr) && !PlotMain.hasPermission(plr,"plots.admin")) {
|
||||||
PlayerFunctions.sendMessage(plr, C.NO_PLOT_PERMS);
|
PlayerFunctions.sendMessage(plr, C.NO_PLOT_PERMS);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@ -70,7 +70,7 @@ public class Set extends SubCommand {
|
|||||||
/* TODO: Implement option */
|
/* TODO: Implement option */
|
||||||
boolean advanced_permissions = true;
|
boolean advanced_permissions = true;
|
||||||
if (advanced_permissions) {
|
if (advanced_permissions) {
|
||||||
if (!plr.hasPermission("plots.set." + args[0].toLowerCase())) {
|
if (!PlotMain.hasPermission(plr,"plots.set." + args[0].toLowerCase())) {
|
||||||
PlayerFunctions.sendMessage(plr, C.NO_PERMISSION, "plots.set."+args[0].toLowerCase());
|
PlayerFunctions.sendMessage(plr, C.NO_PERMISSION, "plots.set."+args[0].toLowerCase());
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@ -43,7 +43,7 @@ public class Unlink extends SubCommand {
|
|||||||
}
|
}
|
||||||
Plot plot = PlayerFunctions.getCurrentPlot(plr);
|
Plot plot = PlayerFunctions.getCurrentPlot(plr);
|
||||||
if (((plot == null) || !plot.hasOwner() || !plot.getOwner().equals(plr.getUniqueId()))
|
if (((plot == null) || !plot.hasOwner() || !plot.getOwner().equals(plr.getUniqueId()))
|
||||||
&& !plr.hasPermission("plots.admin")) {
|
&& !PlotMain.hasPermission(plr,"plots.admin")) {
|
||||||
PlayerFunctions.sendMessage(plr, C.NO_PLOT_PERMS);
|
PlayerFunctions.sendMessage(plr, C.NO_PLOT_PERMS);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -10,8 +10,9 @@ database: false
|
|||||||
commands:
|
commands:
|
||||||
plots:
|
plots:
|
||||||
description: PlotMain PlotSquared command.
|
description: PlotMain PlotSquared command.
|
||||||
aliases: [p,plotme,plot,ps]
|
aliases: [p,plotme,plot,ps,plotsquared,p2]
|
||||||
permission: plots.use
|
permission: plots.use
|
||||||
|
permission-message: "You are lacking the permission node 'plots.use'"
|
||||||
permissions:
|
permissions:
|
||||||
plots.use:
|
plots.use:
|
||||||
default: op
|
default: op
|
||||||
|
Loading…
Reference in New Issue
Block a user