geforkt von SteamWar/BungeeCore
Merge pull request 'Add Fabric Challenge' (#130) from fixed-fabric into master
Reviewed-by: YoyoNow <jwsteam@nidido.de>
Dieser Commit ist enthalten in:
Commit
722f9ad20d
@ -20,6 +20,7 @@
|
||||
package de.steamwar.bungeecore.commands;
|
||||
|
||||
import de.steamwar.bungeecore.*;
|
||||
import de.steamwar.bungeecore.listeners.mods.Fabric;
|
||||
import de.steamwar.bungeecore.sql.IgnoreSystem;
|
||||
import net.md_5.bungee.api.CommandSender;
|
||||
import net.md_5.bungee.api.ProxyServer;
|
||||
@ -46,6 +47,11 @@ public class ChallengeCommand extends BasicCommand {
|
||||
if (!(sender instanceof ProxiedPlayer))
|
||||
return;
|
||||
|
||||
if(Fabric.isFabric((ProxiedPlayer) sender)) {
|
||||
BungeeCore.send((ProxiedPlayer) sender, BungeeCore.CHAT_PREFIX + "§cHat ich dir nicht gesagt, dass man mit Fabric nicht auf die Arenen darf?");
|
||||
return;
|
||||
}
|
||||
|
||||
ProxiedPlayer target = ProxyServer.getInstance().getPlayer(args[0]);
|
||||
if(target == null){
|
||||
BungeeCore.send(sender, BungeeCore.CHAT_PREFIX + "§cDer Herausgeforderte ist nicht online.");
|
||||
|
@ -20,6 +20,7 @@
|
||||
package de.steamwar.bungeecore.commands;
|
||||
|
||||
import de.steamwar.bungeecore.*;
|
||||
import de.steamwar.bungeecore.listeners.mods.Fabric;
|
||||
import net.md_5.bungee.api.ChatColor;
|
||||
import net.md_5.bungee.api.CommandSender;
|
||||
import net.md_5.bungee.api.ProxyServer;
|
||||
@ -127,6 +128,11 @@ public class FightCommand extends BasicCommand {
|
||||
if(!(sender instanceof ProxiedPlayer))
|
||||
return;
|
||||
|
||||
if(Fabric.isFabric((ProxiedPlayer) sender)) {
|
||||
BungeeCore.send((ProxiedPlayer) sender, BungeeCore.CHAT_PREFIX + "§cHat ich dir nicht gesagt, dass man mit Fabric nicht auf die Arenen darf?");
|
||||
return;
|
||||
}
|
||||
|
||||
ProxiedPlayer player = (ProxiedPlayer) sender;
|
||||
if(alreadyInArena(player))
|
||||
return;
|
||||
|
@ -58,9 +58,13 @@ public class Fabric extends BasicListener {
|
||||
public void onServerSwitch(ServerSwitchEvent event) {
|
||||
if(Subserver.getSubserver(event.getPlayer()) != null
|
||||
&& Subserver.getSubserver(event.getPlayer()).getType() == Servertype.ARENA
|
||||
&& Storage.fabricPlayers.contains(event.getPlayer())) {
|
||||
&& isFabric(event.getPlayer())) {
|
||||
event.getPlayer().connect(BungeeCore.get().getProxy().getServerInfo(BungeeCore.LOBBY_SERVER));
|
||||
BungeeCore.send(event.getPlayer(), BungeeCore.CHAT_PREFIX + "§cDu kannst nicht auf die Arena mit Fabric");
|
||||
}
|
||||
}
|
||||
|
||||
public static boolean isFabric(ProxiedPlayer player) {
|
||||
return Storage.fabricPlayers.contains(player);
|
||||
}
|
||||
}
|
||||
|
In neuem Issue referenzieren
Einen Benutzer sperren