From 445bbc68243bc4f23e4a6e8568860229295c4c33 Mon Sep 17 00:00:00 2001 From: Lixfel Date: Mon, 11 May 2020 11:12:38 +0200 Subject: [PATCH] Hotfix message and auto abort Signed-off-by: Lixfel --- .../bungeecore/commands/HistoricCommand.java | 2 +- .../bungeecore/listeners/CheckListener.java | 14 ++++++++++++-- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/src/de/steamwar/bungeecore/commands/HistoricCommand.java b/src/de/steamwar/bungeecore/commands/HistoricCommand.java index b8e3449..b83cbe4 100644 --- a/src/de/steamwar/bungeecore/commands/HistoricCommand.java +++ b/src/de/steamwar/bungeecore/commands/HistoricCommand.java @@ -23,7 +23,7 @@ public class HistoricCommand extends BasicCommand { FightCommand.createArena(sender, "/historic ", args, 0, true, (player, mode, map) -> { Subserver arena = SubserverSystem.startArena(mode, map, 0, 0, null, null, player.getUniqueId(), null); 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.setClickEvent(new ClickEvent(ClickEvent.Action.RUN_COMMAND, "/join " + player.getName())); ProxyServer.getInstance().broadcast(tc); diff --git a/src/de/steamwar/bungeecore/listeners/CheckListener.java b/src/de/steamwar/bungeecore/listeners/CheckListener.java index 985ce05..799dec8 100644 --- a/src/de/steamwar/bungeecore/listeners/CheckListener.java +++ b/src/de/steamwar/bungeecore/listeners/CheckListener.java @@ -1,6 +1,9 @@ package de.steamwar.bungeecore.listeners; +import de.steamwar.bungeecore.Bauserver; 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.sql.Schematic; import de.steamwar.bungeecore.sql.SchematicType; @@ -34,8 +37,15 @@ public class CheckListener extends BasicListener { @EventHandler public void onServerSwitch(ServerSwitchEvent e){ ProxiedPlayer player = e.getPlayer(); - if(CheckCommand.isChecking(player)) - CheckCommand.abort(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); + } } @EventHandler