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