SteamWar/BauSystem2.0
Archiviert
12
0

Fix RegionCommand permission Stuff

Signed-off-by: yoyosource <yoyosource@nidido.de>
Dieser Commit ist enthalten in:
yoyosource 2021-07-04 20:58:22 +02:00
Ursprung 5d8ca09271
Commit 4f63adf749

Datei anzeigen

@ -86,7 +86,7 @@ public class RegionCommand extends SWCommand {
@Register("undo")
public void undoCommand(Player p) {
if(!permissionCheck(p)) return;
if(!permissionCheck(p, Permission.WORLDEDIT)) return;
Region region = Region.getRegion(p.getLocation());
if (checkGlobalRegion(region, p)) return;
@ -109,7 +109,7 @@ public class RegionCommand extends SWCommand {
@Register("redo")
public void redoCommand(Player p) {
if (!permissionCheck(p)) {
if (!permissionCheck(p, Permission.WORLDEDIT)) {
return;
}
Region region = Region.getRegion(p.getLocation());
@ -126,7 +126,7 @@ public class RegionCommand extends SWCommand {
@Register("restore")
public void genericRestoreCommand(Player p) {
if (!permissionCheck(p)) return;
if (!permissionCheck(p, Permission.WORLDEDIT)) return;
Region region = Region.getRegion(p.getLocation());
if(checkGlobalRegion(region, p)) return;
@ -146,7 +146,7 @@ public class RegionCommand extends SWCommand {
@Register("restore")
public void schematicRestoreCommand(Player p, String s) {
if (!permissionCheck(p)) return;
if (!permissionCheck(p, Permission.WORLDEDIT)) return;
Region region = Region.getRegion(p.getLocation());
if (checkGlobalRegion(region, p)) return;
@ -187,6 +187,7 @@ public class RegionCommand extends SWCommand {
@Register("changetype")
@Register("type")
public void changeTypeCommand(Player p, @Mapper("regionTypeMapper") String s) {
if (!permissionCheck(p, Permission.WORLD)) return;
Region region = Region.getRegion(p.getLocation());
if (checkGlobalRegion(region, p)) {
return;
@ -223,8 +224,8 @@ public class RegionCommand extends SWCommand {
};
}
private boolean permissionCheck(Player player) {
if (Permission.hasPermission(player, Permission.WORLDEDIT)) {
private boolean permissionCheck(Player player, Permission permission) {
if (Permission.hasPermission(player, permission)) {
return true;
}
BauSystem.MESSAGE.send("REGION_REGION_NO_PERMS", player);