DataPass allows bungeecord proxy plugins and bukkit plugins to exchange data more conveniently. This is currently work in progress and I'll probably change the api a bit until version 1.0.
One side can send a (serializable) java object. The other side will then receive an event that can be processed by normal (either bungee or bukkit) event handlers.
DataPass uses the Plugin Messaging Channel to send the serialized data.
- The Bukkit plugin: datapass-bukkit
- The Bungee Proxy plugin: datapass-proxy
Create a new DataPassEvent containing your data:
DataPassEvent dataEvent = new DataPassStringEvent("This is a String!");Send the data to the bungee proxy by calling
DataPass.getDataSender().sendData(dataEvent);Register a new EventHandler:
@EventHandler
public void onStringReceived(DataPassStringEvent event) {
String data = event.getData();
}Create a new DataPassEvent containing your data and the server it should be sent to:
ServerInfo server = getProxy().getServerInfo("Example");
DataPassEvent dataEvent = new DataPassStringEvent(server, "Another String.");Send the data to the bukkit server by calling
DataPass.getDataSender().sendData(dataEvent);Register a new EventHandler:
@EventHandler
public void onStringReceiver(DataPassStringEvent event) {
ServerInfo server = event.getServer();
String data = event.getData()
}