Merge remote-tracking branch 'origin/RegionFix' into RegionFix
Dieser Commit ist enthalten in:
Commit
049e18cfd2
@ -5,9 +5,12 @@ import de.steamwar.bausystem.Permission;
|
||||
import de.steamwar.bausystem.world.Welt;
|
||||
import de.steamwar.bausystem.world.regions.GlobalRegion;
|
||||
import de.steamwar.bausystem.world.regions.Region;
|
||||
import de.steamwar.bausystem.world.regions.RegionExtensionType;
|
||||
import de.steamwar.bausystem.world.regions.RegionType;
|
||||
import de.steamwar.command.SWCommand;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
|
||||
public class CommandRegion extends SWCommand {
|
||||
|
||||
public CommandRegion() {
|
||||
@ -25,30 +28,48 @@ public class CommandRegion extends SWCommand {
|
||||
player.sendMessage(BauSystem.PREFIX + "§8/§7region redo §8- §7Wiederhohle die letzten 10 §8/§7rg undo");
|
||||
}
|
||||
|
||||
@Register
|
||||
public void undoCommand(Player p, Action action) {
|
||||
if (!permissionCheck(p)) return;
|
||||
Region region = Region.getRegion(p.getLocation());
|
||||
if (checkGlobalRegion(region, p)) return;
|
||||
|
||||
switch (action) {
|
||||
case UNDO:
|
||||
if (region.undo()) {
|
||||
p.sendMessage(BauSystem.PREFIX + "Letzte Aktion rückgangig gemacht");
|
||||
} else {
|
||||
p.sendMessage(BauSystem.PREFIX + "§cNichts zum rückgängig machen");
|
||||
}
|
||||
break;
|
||||
case REDO:
|
||||
if (region.redo()) {
|
||||
p.sendMessage(BauSystem.PREFIX + "Letzte Aktion wiederhohlt");
|
||||
} else {
|
||||
p.sendMessage(BauSystem.PREFIX + "§cNichts zum wiederhohlen");
|
||||
}
|
||||
break;
|
||||
default:
|
||||
genericHelp(p);
|
||||
@Register("undo")
|
||||
public void undoCommand(Player p) {
|
||||
if (!permissionCheck(p)) {
|
||||
return;
|
||||
}
|
||||
Region region = Region.getRegion(p.getLocation());
|
||||
if (checkGlobalRegion(region, p)) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (region.undo()) {
|
||||
p.sendMessage(BauSystem.PREFIX + "Letzte Aktion rückgangig gemacht");
|
||||
} else {
|
||||
p.sendMessage(BauSystem.PREFIX + "§cNichts zum rückgängig machen");
|
||||
}
|
||||
}
|
||||
|
||||
@Register("redo")
|
||||
public void redoCommand(Player p) {
|
||||
if (!permissionCheck(p)) {
|
||||
return;
|
||||
}
|
||||
Region region = Region.getRegion(p.getLocation());
|
||||
if (checkGlobalRegion(region, p)) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (region.redo()) {
|
||||
p.sendMessage(BauSystem.PREFIX + "Letzte Aktion wiederhohlt");
|
||||
} else {
|
||||
p.sendMessage(BauSystem.PREFIX + "§cNichts zum wiederhohlen");
|
||||
}
|
||||
}
|
||||
|
||||
@Register
|
||||
public void baurahmenCommand(Player p, RegionType regionType) {
|
||||
CommandSelect.getInstance().baurahmenCommand(p, regionType, RegionExtensionType.NORMAL);
|
||||
}
|
||||
|
||||
@Register
|
||||
public void baurahmenCommand(Player p, RegionType regionType, RegionExtensionType regionExtensionType) {
|
||||
CommandSelect.getInstance().baurahmenCommand(p, regionType, regionExtensionType);
|
||||
}
|
||||
|
||||
static boolean checkGlobalRegion(Region region, Player p) {
|
||||
|
In neuem Issue referenzieren
Einen Benutzer sperren