Initial commit
This commit is contained in:
33
Plugins/Old/Lobby own/src/de/craftix/lobby/utils/Server.java
Normal file
33
Plugins/Old/Lobby own/src/de/craftix/lobby/utils/Server.java
Normal file
@@ -0,0 +1,33 @@
|
||||
package de.craftix.lobby.utils;
|
||||
|
||||
import de.craftix.lobby.general.Main;
|
||||
import de.craftix.lobby.general.Messages;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
import java.io.ByteArrayOutputStream;
|
||||
import java.io.DataOutputStream;
|
||||
|
||||
public class Server {
|
||||
|
||||
public static void connect(String server, Player p){
|
||||
try {
|
||||
ByteArrayOutputStream b = new ByteArrayOutputStream();
|
||||
DataOutputStream out = new DataOutputStream(b);
|
||||
|
||||
out.writeUTF("Connect");
|
||||
out.writeUTF(server);
|
||||
|
||||
p.sendMessage("§aVerbinde zu " + server + "...");
|
||||
|
||||
p.sendPluginMessage(Main.getPlugin(), "BungeeCord", b.toByteArray());
|
||||
} catch (Exception e){
|
||||
p.sendMessage(Messages.prefix + "§cEin Fehler ist aufgetreten!");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public static void warp(String name, Player p) {
|
||||
p.performCommand("warp " + name);
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user