13
0

Fightserverportale

Dieser Commit ist enthalten in:
Lixfel 2022-01-21 21:04:27 +01:00
Ursprung ecf813c809
Commit 3d7c0810c2
4 geänderte Dateien mit 9 neuen und 6 gelöschten Zeilen

Datei anzeigen

@ -48,7 +48,7 @@ public class Fightserver {
Iterator<Map.Entry<String, Fightserver>> it = servers.entrySet().iterator(); Iterator<Map.Entry<String, Fightserver>> it = servers.entrySet().iterator();
while(it.hasNext()) { while(it.hasNext()) {
Map.Entry<String, Fightserver> server = it.next(); Map.Entry<String, Fightserver> server = it.next();
if(timeout.isBefore(server.getValue().lastUpdate)) { if(timeout.isAfter(server.getValue().lastUpdate)) {
server.getValue().remove(); server.getValue().remove();
it.remove(); it.remove();
} }

Datei anzeigen

@ -20,6 +20,8 @@
package de.steamwar.lobby.listener; package de.steamwar.lobby.listener;
import de.steamwar.comms.packets.ImALobbyPacket; import de.steamwar.comms.packets.ImALobbyPacket;
import de.steamwar.lobby.LobbySystem;
import org.bukkit.Bukkit;
import org.bukkit.GameMode; import org.bukkit.GameMode;
import org.bukkit.entity.Player; import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler; import org.bukkit.event.EventHandler;
@ -34,6 +36,6 @@ public class Join extends BasicListener {
player.setGameMode(GameMode.ADVENTURE); player.setGameMode(GameMode.ADVENTURE);
player.setWalkSpeed(0.5f); player.setWalkSpeed(0.5f);
new ImALobbyPacket().send(player); Bukkit.getScheduler().runTaskLater(LobbySystem.getPlugin(), () -> new ImALobbyPacket().send(player), 20);
} }
} }

Datei anzeigen

@ -76,6 +76,7 @@ public class CommandPortal implements PortalHandler {
cmd.append(pieces[i]).append(parts[i+1].substring(1)); cmd.append(pieces[i]).append(parts[i+1].substring(1));
} }
player.sendMessage("/" + cmd);
new ExecuteCommandPacket(player, cmd.toString()).send(player); new ExecuteCommandPacket(player, cmd.toString()).send(player);
} }

Datei anzeigen

@ -101,7 +101,7 @@ public class FightserverPortal implements PortalHandler, Comparable<FightserverP
} }
private void init() { private void init() {
updateText(); setServer(null);
List<FightserverPortal> list = portals.computeIfAbsent(gamemode, mode -> new ArrayList<>()); List<FightserverPortal> list = portals.computeIfAbsent(gamemode, mode -> new ArrayList<>());
list.add(this); list.add(this);
@ -114,8 +114,8 @@ public class FightserverPortal implements PortalHandler, Comparable<FightserverP
} }
@Override @Override
public void handle(Player player, Location from) { public void handle(Player player, Location from, Location to) {
handler.handle(player, from); handler.handle(player, from, to);
} }
@Override @Override
@ -139,6 +139,6 @@ public class FightserverPortal implements PortalHandler, Comparable<FightserverP
@Override @Override
public int compareTo(FightserverPortal other) { public int compareTo(FightserverPortal other) {
return other.order - order; return order - other.order;
} }
} }