Merge remote-tracking branch 'origin/master'
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
Dieser Commit ist enthalten in:
Commit
3d5dc2e07e
@ -21,17 +21,22 @@ package de.steamwar.lobby;
|
||||
|
||||
import de.steamwar.network.packets.PacketHandler;
|
||||
import de.steamwar.network.packets.common.FightInfoPacket;
|
||||
import de.steamwar.network.packets.server.StartingServerPacket;
|
||||
import de.steamwar.sql.SteamwarUser;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.event.player.PlayerTeleportEvent;
|
||||
|
||||
import java.util.Objects;
|
||||
|
||||
public class LobbyPacketHandler extends PacketHandler {
|
||||
|
||||
public LobbyPacketHandler() {
|
||||
super();
|
||||
this.register();
|
||||
}
|
||||
|
||||
@Handler
|
||||
public void handleFightserver(FightInfoPacket packet) {
|
||||
Fightserver.newFightInfo(packet);
|
||||
}
|
||||
|
||||
@Handler
|
||||
public void serverStarting(StartingServerPacket packet) {
|
||||
Objects.requireNonNull(Bukkit.getPlayer(SteamwarUser.get(packet.getUser()).getUUID())).teleport(LobbySystem.config().getWaitingHallSpawn(), PlayerTeleportEvent.TeleportCause.PLUGIN);
|
||||
}
|
||||
}
|
||||
|
@ -45,7 +45,6 @@ public class LobbySystem extends JavaPlugin {
|
||||
message = new Message("de.steamwar.lobby.LobbySystem", getClassLoader());
|
||||
|
||||
Fightserver.init();
|
||||
new WaitingHall();
|
||||
new Portals();
|
||||
new PortalCommand();
|
||||
new HologramCommand();
|
||||
@ -68,7 +67,7 @@ public class LobbySystem extends JavaPlugin {
|
||||
new AlphaWall(l -> l.getX() < 2977, AlphaWall.REFLECT_X);
|
||||
new AlphaWall(l -> l.getZ() > 892, AlphaWall.REFLECT_Z);
|
||||
new AlphaWall(l -> l.getZ() < 1794, AlphaWall.REFLECT_Z);
|
||||
new LobbyPacketHandler();
|
||||
new LobbyPacketHandler().register();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -1,38 +0,0 @@
|
||||
/*
|
||||
* This file is a part of the SteamWar software.
|
||||
*
|
||||
* Copyright (C) 2022 SteamWar.de-Serverteam
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Affero General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Affero General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package de.steamwar.lobby;
|
||||
|
||||
import de.steamwar.network.packets.PacketHandler;
|
||||
import de.steamwar.sql.SteamwarUser;
|
||||
import de.steamwar.network.packets.server.StartingServerPacket;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.event.player.PlayerTeleportEvent;
|
||||
|
||||
public class WaitingHall extends PacketHandler {
|
||||
public WaitingHall() {
|
||||
super();
|
||||
this.register();
|
||||
}
|
||||
|
||||
@Handler
|
||||
private void serverStarting(StartingServerPacket in) {
|
||||
Bukkit.getPlayer(SteamwarUser.get(in.getUser()).getUUID()).teleport(LobbySystem.config().getWaitingHallSpawn(), PlayerTeleportEvent.TeleportCause.PLUGIN);
|
||||
}
|
||||
}
|
@ -43,7 +43,7 @@ public class HologramCommand extends SWCommand {
|
||||
public void portalCreate(Player player, String id, String... text) {
|
||||
if (PortalCommand.noPermissions(player)) return;
|
||||
|
||||
new Hologram(id, player.getLocation(), String.join(" ", text), false);
|
||||
new Hologram(id, player.getLocation(), String.join(" ", text).replace("&", "§"), false);
|
||||
LobbySystem.config().save();
|
||||
}
|
||||
|
||||
|
@ -58,7 +58,7 @@ public class PlayerSpawn extends BasicListener {
|
||||
player.setFoodLevel(20);
|
||||
giveItems(player);
|
||||
|
||||
Bukkit.getScheduler().runTaskLater(LobbySystem.getPlugin(), () -> NetworkSender.send(new ImALobbyPacket()), 20);
|
||||
Bukkit.getScheduler().runTaskLater(LobbySystem.getPlugin(), () -> NetworkSender.send(new ImALobbyPacket(), player), 20);
|
||||
}
|
||||
|
||||
private void giveItems(Player player) {
|
||||
|
In neuem Issue referenzieren
Einen Benutzer sperren