geforkt von SteamWar/BungeeCore
Hotfix message and auto abort
Signed-off-by: Lixfel <agga-games@gmx.de>
Dieser Commit ist enthalten in:
Ursprung
d6690736a4
Commit
445bbc6824
@ -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);
|
||||||
|
@ -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){
|
||||||
|
In neuem Issue referenzieren
Einen Benutzer sperren