diff --git a/src/de/steamwar/lobby/command/PortalCommand.java b/src/de/steamwar/lobby/command/PortalCommand.java index b83ced2..726e19f 100644 --- a/src/de/steamwar/lobby/command/PortalCommand.java +++ b/src/de/steamwar/lobby/command/PortalCommand.java @@ -9,10 +9,7 @@ import com.sk89q.worldedit.regions.RegionSelector; import de.steamwar.command.SWCommand; import de.steamwar.command.TypeMapper; import de.steamwar.lobby.LobbySystem; -import de.steamwar.lobby.portal.CommandPortal; -import de.steamwar.lobby.portal.FightserverPortal; -import de.steamwar.lobby.portal.Portal; -import de.steamwar.lobby.portal.TeleportPortal; +import de.steamwar.lobby.portal.*; import de.steamwar.sql.SteamwarUser; import lombok.Data; import org.bukkit.Bukkit; @@ -88,6 +85,17 @@ public class PortalCommand extends SWCommand { new Portal(portalName, tuple.k, tuple.v, portal -> new TeleportPortal(portal, portalDestination)); } + @Register({"create", "stack"}) + public void portalAddStack(Player player, String portalName, String portalDestination, String... command) { + if (noPermissions(player)) return; + Tuple tuple = getSelection(player); + if (tuple == null) { + LobbySystem.MESSAGE.send("PORTAL_NO_WORLDEDIT_SELECTION", player); + return; + } + new Portal(portalName, tuple.k, tuple.v, portal -> new StackPortal(portal, portalDestination, String.join(" ", command))); + } + @Register("remove") public void portalRemove(Player player, Portal portal) { if (noPermissions(player)) return;