updated because Yoyo renamed methods
Dieser Commit ist enthalten in:
Ursprung
ab7471a028
Commit
0a821936c6
@ -5,9 +5,12 @@ import de.steamwar.bausystem.Permission;
|
|||||||
import de.steamwar.bausystem.world.Welt;
|
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.regions.RegionExtensionType;
|
||||||
|
import de.steamwar.bausystem.world.regions.RegionType;
|
||||||
import de.steamwar.command.SWCommand;
|
import de.steamwar.command.SWCommand;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
|
|
||||||
|
|
||||||
public class CommandRegion extends SWCommand {
|
public class CommandRegion extends SWCommand {
|
||||||
|
|
||||||
public CommandRegion() {
|
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");
|
player.sendMessage(BauSystem.PREFIX + "§8/§7region redo §8- §7Wiederhohle die letzten 10 §8/§7rg undo");
|
||||||
}
|
}
|
||||||
|
|
||||||
@Register
|
@Register("undo")
|
||||||
public void undoCommand(Player p, Action action) {
|
public void undoCommand(Player p) {
|
||||||
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) {
|
|
||||||
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;
|
}
|
||||||
case REDO:
|
|
||||||
|
@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()) {
|
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");
|
||||||
}
|
}
|
||||||
break;
|
|
||||||
default:
|
|
||||||
genericHelp(p);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@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) {
|
static boolean checkGlobalRegion(Region region, Player p) {
|
||||||
|
In neuem Issue referenzieren
Einen Benutzer sperren