forked from Upstream/CommandPanels
Add force-server= Bungeetag
This commit is contained in:
parent
43e8f329ae
commit
3851ed4505
@ -17,7 +17,7 @@ public class BungeeTags implements Listener {
|
|||||||
|
|
||||||
@EventHandler
|
@EventHandler
|
||||||
public void commandTag(CommandTagEvent e){
|
public void commandTag(CommandTagEvent e){
|
||||||
if(e.name.equalsIgnoreCase("server=")){
|
if(e.name.equalsIgnoreCase("force-server=")){
|
||||||
e.commandTagUsed();
|
e.commandTagUsed();
|
||||||
//this contacts bungee and tells it to send the server change command
|
//this contacts bungee and tells it to send the server change command
|
||||||
ByteArrayDataOutput out = ByteStreams.newDataOutput();
|
ByteArrayDataOutput out = ByteStreams.newDataOutput();
|
||||||
@ -26,6 +26,19 @@ public class BungeeTags implements Listener {
|
|||||||
Player player = Bukkit.getPlayerExact(e.p.getName());
|
Player player = Bukkit.getPlayerExact(e.p.getName());
|
||||||
assert player != null;
|
assert player != null;
|
||||||
player.sendPluginMessage(plugin, "BungeeCord", out.toByteArray());
|
player.sendPluginMessage(plugin, "BungeeCord", out.toByteArray());
|
||||||
|
} else if(e.name.equalsIgnoreCase("server=")){
|
||||||
|
e.commandTagUsed();
|
||||||
|
Player player = Bukkit.getPlayerExact(e.p.getName());
|
||||||
|
assert player != null;
|
||||||
|
if (player.hasPermission("bungeecord.command.server." + e.args[0].toLowerCase())) {
|
||||||
|
//this contacts bungee and tells it to send the server change command
|
||||||
|
ByteArrayDataOutput out = ByteStreams.newDataOutput();
|
||||||
|
out.writeUTF("Connect");
|
||||||
|
out.writeUTF(e.args[0]);
|
||||||
|
player.sendPluginMessage(plugin, "BungeeCord", out.toByteArray());
|
||||||
|
}else{
|
||||||
|
player.sendMessage(plugin.tex.colour(plugin.tag + plugin.config.getString("config.format.perms")));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user