-
Notifications
You must be signed in to change notification settings - Fork 1
/
BungeePortal.java
41 lines (32 loc) · 1023 Bytes
/
BungeePortal.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
package me.minebuilders.portal.portals;
import java.io.ByteArrayOutputStream;
import java.io.DataOutputStream;
import java.io.IOException;
import org.bukkit.entity.Player;
import me.minebuilders.portal.Bound;
import me.minebuilders.portal.IP;
import me.minebuilders.portal.Status;
public class BungeePortal extends Portal {
private ByteArrayOutputStream stream;
public BungeePortal(String name, Bound region, Status status) {
super(name, region, status);
}
@Override
public void Teleport(Player p) {
p.sendPluginMessage(IP.instance, "BungeeCord", stream.toByteArray());
}
@Override
public void setTarget(String s) {
ByteArrayOutputStream bao = new ByteArrayOutputStream();
DataOutputStream out = new DataOutputStream(bao);
try {
out.writeUTF("Connect"); //Connect = connect player to server
out.writeUTF(s); // Target Server
} catch (IOException e) { }
stream = bao;
}
@Override
public PortalType getType() {
return PortalType.BUNGEE;
}
}