13
0

Implement FightServerPortal command

Dieser Commit ist enthalten in:
yoyosource 2021-10-04 15:14:46 +02:00
Ursprung 08fecc3333
Commit fe6e963d4c

Datei anzeigen

@ -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<Location, Location> 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;