From 0a821936c66dc3b212cc1e0f00984b34e7ada07c Mon Sep 17 00:00:00 2001 From: Zeanon Date: Sat, 3 Apr 2021 22:39:49 +0200 Subject: [PATCH] updated because Yoyo renamed methods --- .../bausystem/commands/CommandRegion.java | 67 ++++++++++++------- 1 file changed, 44 insertions(+), 23 deletions(-) diff --git a/BauSystem_Main/src/de/steamwar/bausystem/commands/CommandRegion.java b/BauSystem_Main/src/de/steamwar/bausystem/commands/CommandRegion.java index 2f221f6..cfbd865 100644 --- a/BauSystem_Main/src/de/steamwar/bausystem/commands/CommandRegion.java +++ b/BauSystem_Main/src/de/steamwar/bausystem/commands/CommandRegion.java @@ -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) {