RegionFix #240
@ -2,9 +2,9 @@ package de.steamwar.bausystem.commands;
|
|||||||
|
|
||||||
import de.steamwar.bausystem.BauSystem;
|
import de.steamwar.bausystem.BauSystem;
|
||||||
import de.steamwar.bausystem.Permission;
|
import de.steamwar.bausystem.Permission;
|
||||||
|
import de.steamwar.bausystem.world.Welt;
|
||||||
import de.steamwar.bausystem.world.regions.GlobalRegion;
|
import de.steamwar.bausystem.world.regions.GlobalRegion;
|
||||||
import de.steamwar.bausystem.world.regions.Region;
|
import de.steamwar.bausystem.world.regions.Region;
|
||||||
import de.steamwar.bausystem.world.Welt;
|
|
||||||
import de.steamwar.command.SWCommand;
|
import de.steamwar.command.SWCommand;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
|
|
||||||
@ -27,20 +27,20 @@ public class CommandRegion extends SWCommand {
|
|||||||
|
|
||||||
@Register
|
@Register
|
||||||
public void undoCommand(Player p, Action action) {
|
public void undoCommand(Player p, Action action) {
|
||||||
if(!permissionCheck(p)) return;
|
if (!permissionCheck(p)) return;
|
||||||
Region region = Region.getRegion(p.getLocation());
|
Region region = Region.getRegion(p.getLocation());
|
||||||
if(checkGlobalRegion(region, p)) return;
|
if (checkGlobalRegion(region, p)) return;
|
||||||
|
|
||||||
switch (action) {
|
switch (action) {
|
||||||
case UNDO:
|
case UNDO:
|
||||||
if(region.undo()) {
|
if (region.undo()) {
|
||||||
p.sendMessage(BauSystem.PREFIX + "Letzte Aktion rückgangig gemacht");
|
p.sendMessage(BauSystem.PREFIX + "Letzte Aktion rückgangig gemacht");
|
||||||
} else {
|
} else {
|
||||||
p.sendMessage(BauSystem.PREFIX + "§cNichts zum rückgängig machen");
|
p.sendMessage(BauSystem.PREFIX + "§cNichts zum rückgängig machen");
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case REDO:
|
case REDO:
|
||||||
if(region.redo()) {
|
if (region.redo()) {
|
||||||
p.sendMessage(BauSystem.PREFIX + "Letzte Aktion wiederhohlt");
|
p.sendMessage(BauSystem.PREFIX + "Letzte Aktion wiederhohlt");
|
||||||
} else {
|
} else {
|
||||||
p.sendMessage(BauSystem.PREFIX + "§cNichts zum wiederhohlen");
|
p.sendMessage(BauSystem.PREFIX + "§cNichts zum wiederhohlen");
|
||||||
@ -52,7 +52,7 @@ public class CommandRegion extends SWCommand {
|
|||||||
}
|
}
|
||||||
|
|
||||||
static boolean checkGlobalRegion(Region region, Player p) {
|
static boolean checkGlobalRegion(Region region, Player p) {
|
||||||
if(GlobalRegion.isGlobalRegion(region)) {
|
if (GlobalRegion.isGlobalRegion(region)) {
|
||||||
p.sendMessage(BauSystem.PREFIX + "§cDu bist in keiner Region");
|
p.sendMessage(BauSystem.PREFIX + "§cDu bist in keiner Region");
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
In neuem Issue referenzieren
Einen Benutzer sperren