Archiviert
1
0

Hotfix message and auto abort

Signed-off-by: Lixfel <agga-games@gmx.de>
Dieser Commit ist enthalten in:
Lixfel 2020-05-11 11:12:38 +02:00
Ursprung d6690736a4
Commit 445bbc6824
2 geänderte Dateien mit 13 neuen und 3 gelöschten Zeilen

Datei anzeigen

@ -23,7 +23,7 @@ public class HistoricCommand extends BasicCommand {
FightCommand.createArena(sender, "/historic ", args, 0, true, (player, mode, map) -> { FightCommand.createArena(sender, "/historic ", args, 0, true, (player, mode, map) -> {
Subserver arena = SubserverSystem.startArena(mode, map, 0, 0, null, null, player.getUniqueId(), null); Subserver arena = SubserverSystem.startArena(mode, map, 0, 0, null, null, player.getUniqueId(), null);
arena.sendPlayer(player); arena.sendPlayer(player);
TextComponent tc = new TextComponent(BungeeCore.CHAT_PREFIX + "§7Historischer §e" + mode.getDisplayName() + "§8-§7Kampf von §e" + player.getName() + " §8!"); TextComponent tc = new TextComponent(BungeeCore.CHAT_PREFIX + "§7Historischer §e" + mode.getDisplayName() + "§8-§7Kampf von §e" + player.getName() + "§8!");
tc.setHoverEvent(new HoverEvent(HoverEvent.Action.SHOW_TEXT, new ComponentBuilder("§aGegen §7" + player.getName() + " §ekämpfen").create())); tc.setHoverEvent(new HoverEvent(HoverEvent.Action.SHOW_TEXT, new ComponentBuilder("§aGegen §7" + player.getName() + " §ekämpfen").create()));
tc.setClickEvent(new ClickEvent(ClickEvent.Action.RUN_COMMAND, "/join " + player.getName())); tc.setClickEvent(new ClickEvent(ClickEvent.Action.RUN_COMMAND, "/join " + player.getName()));
ProxyServer.getInstance().broadcast(tc); ProxyServer.getInstance().broadcast(tc);

Datei anzeigen

@ -1,6 +1,9 @@
package de.steamwar.bungeecore.listeners; package de.steamwar.bungeecore.listeners;
import de.steamwar.bungeecore.Bauserver;
import de.steamwar.bungeecore.BungeeCore; import de.steamwar.bungeecore.BungeeCore;
import de.steamwar.bungeecore.Servertype;
import de.steamwar.bungeecore.Subserver;
import de.steamwar.bungeecore.commands.CheckCommand; import de.steamwar.bungeecore.commands.CheckCommand;
import de.steamwar.bungeecore.sql.Schematic; import de.steamwar.bungeecore.sql.Schematic;
import de.steamwar.bungeecore.sql.SchematicType; import de.steamwar.bungeecore.sql.SchematicType;
@ -34,9 +37,16 @@ public class CheckListener extends BasicListener {
@EventHandler @EventHandler
public void onServerSwitch(ServerSwitchEvent e){ public void onServerSwitch(ServerSwitchEvent e){
ProxiedPlayer player = e.getPlayer(); ProxiedPlayer player = e.getPlayer();
if(CheckCommand.isChecking(player)) if(CheckCommand.isChecking(player)){
Subserver server = Subserver.getSubserver(player.getServer().getInfo());
if(
server == null ||
server.getType() != Servertype.BAUSERVER ||
((Bauserver)server).getOwner() != player.getUniqueId()
)
CheckCommand.abort(player); CheckCommand.abort(player);
} }
}
@EventHandler @EventHandler
public void onPlayerDisconnect(PlayerDisconnectEvent e){ public void onPlayerDisconnect(PlayerDisconnectEvent e){