From 3d7c0810c235e88d3a2f82fcefff8fe981a0cb7c Mon Sep 17 00:00:00 2001 From: Lixfel Date: Fri, 21 Jan 2022 21:04:27 +0100 Subject: [PATCH] Fightserverportale --- src/de/steamwar/lobby/Fightserver.java | 2 +- src/de/steamwar/lobby/listener/Join.java | 4 +++- src/de/steamwar/lobby/portal/CommandPortal.java | 1 + src/de/steamwar/lobby/portal/FightserverPortal.java | 8 ++++---- 4 files changed, 9 insertions(+), 6 deletions(-) diff --git a/src/de/steamwar/lobby/Fightserver.java b/src/de/steamwar/lobby/Fightserver.java index 85a869a..d8204a3 100644 --- a/src/de/steamwar/lobby/Fightserver.java +++ b/src/de/steamwar/lobby/Fightserver.java @@ -48,7 +48,7 @@ public class Fightserver { Iterator> it = servers.entrySet().iterator(); while(it.hasNext()) { Map.Entry server = it.next(); - if(timeout.isBefore(server.getValue().lastUpdate)) { + if(timeout.isAfter(server.getValue().lastUpdate)) { server.getValue().remove(); it.remove(); } diff --git a/src/de/steamwar/lobby/listener/Join.java b/src/de/steamwar/lobby/listener/Join.java index 9321c1d..225f14b 100644 --- a/src/de/steamwar/lobby/listener/Join.java +++ b/src/de/steamwar/lobby/listener/Join.java @@ -20,6 +20,8 @@ package de.steamwar.lobby.listener; import de.steamwar.comms.packets.ImALobbyPacket; +import de.steamwar.lobby.LobbySystem; +import org.bukkit.Bukkit; import org.bukkit.GameMode; import org.bukkit.entity.Player; import org.bukkit.event.EventHandler; @@ -34,6 +36,6 @@ public class Join extends BasicListener { player.setGameMode(GameMode.ADVENTURE); player.setWalkSpeed(0.5f); - new ImALobbyPacket().send(player); + Bukkit.getScheduler().runTaskLater(LobbySystem.getPlugin(), () -> new ImALobbyPacket().send(player), 20); } } diff --git a/src/de/steamwar/lobby/portal/CommandPortal.java b/src/de/steamwar/lobby/portal/CommandPortal.java index 6eba0b4..20734fa 100644 --- a/src/de/steamwar/lobby/portal/CommandPortal.java +++ b/src/de/steamwar/lobby/portal/CommandPortal.java @@ -76,6 +76,7 @@ public class CommandPortal implements PortalHandler { cmd.append(pieces[i]).append(parts[i+1].substring(1)); } + player.sendMessage("/" + cmd); new ExecuteCommandPacket(player, cmd.toString()).send(player); } diff --git a/src/de/steamwar/lobby/portal/FightserverPortal.java b/src/de/steamwar/lobby/portal/FightserverPortal.java index 2968175..97258f2 100644 --- a/src/de/steamwar/lobby/portal/FightserverPortal.java +++ b/src/de/steamwar/lobby/portal/FightserverPortal.java @@ -101,7 +101,7 @@ public class FightserverPortal implements PortalHandler, Comparable list = portals.computeIfAbsent(gamemode, mode -> new ArrayList<>()); list.add(this); @@ -114,8 +114,8 @@ public class FightserverPortal implements PortalHandler, Comparable