From fe6e963d4c462fd3c6996b592960db9d81a8c987 Mon Sep 17 00:00:00 2001 From: yoyosource Date: Mon, 4 Oct 2021 15:14:46 +0200 Subject: [PATCH] Implement FightServerPortal command --- src/de/steamwar/lobby/command/PortalCommand.java | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) 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;