SubServers-2/SubServers.Host/src/net/ME1312/SubServers/Host/Network/PacketIn.java
ME1312 75b9b688cc Rewrite SubData API for JSON dependancy changes
This commit removes the org.JSON library where alternatives are already provided (Bungee & Bukkit provide Gson). This change was made to improve compatability with BungeeCord plugins and reduce file sizes.

This means big changes to the SubData API, which heavily relied on org.JSON. Now we submit our data through YAMLSection to be converted and sent over the network.
2018-04-14 21:53:51 -04:00

34 lines
736 B
Java

package net.ME1312.SubServers.Host.Network;
import net.ME1312.SubServers.Host.Library.Config.YAMLSection;
import net.ME1312.SubServers.Host.Library.Version.Version;
/**
* PacketIn Layout Class
*/
public interface PacketIn {
/**
* Execute Incoming Packet
*
* @param data Incoming Data
*/
void execute(YAMLSection data) throws Throwable;
/**
* Get Packet Version
*
* @return Packet Version
*/
Version getVersion();
/**
* Check Compatibility with oncoming packet
*
* @param version Version of oncoming packet
* @return Compatibility Status
*/
default boolean isCompatible(Version version) {
return getVersion().equals(version);
}
}