forked from Upstream/CommandPanels
Merge pull request #230 from TheLonelyWolf1/master
Add force-server= CommandTag
This commit is contained in:
commit
b3662984f9
@ -17,7 +17,7 @@ public class BungeeTags implements Listener {
|
||||
|
||||
@EventHandler
|
||||
public void commandTag(CommandTagEvent e){
|
||||
if(e.name.equalsIgnoreCase("server=")){
|
||||
if(e.name.equalsIgnoreCase("force-server=")){
|
||||
e.commandTagUsed();
|
||||
//this contacts bungee and tells it to send the server change command
|
||||
ByteArrayDataOutput out = ByteStreams.newDataOutput();
|
||||
@ -26,6 +26,19 @@ public class BungeeTags implements Listener {
|
||||
Player player = Bukkit.getPlayerExact(e.p.getName());
|
||||
assert player != null;
|
||||
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