Skip to content

RasmusAntons/datapass

Repository files navigation

DataPass

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.

Features

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.

How it works

DataPass uses the Plugin Messaging Channel to send the serialized data.

Binaries (v0.0)

Using the api

Bukkit

Sending Data

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);

Receiving Data

Register a new EventHandler:

@EventHandler
public void onStringReceived(DataPassStringEvent event) {
    String data = event.getData();
}

Bungee Proxy

Sending Data

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);

Receiving Data

Register a new EventHandler:

@EventHandler
public void onStringReceiver(DataPassStringEvent event) {
    ServerInfo server = event.getServer();
    String data = event.getData()
}

About

A plugin to send data between a bungee proxy and bukket servers event based.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages