mirror of
https://github.com/ME1312/SubServers-2.git
synced 2024-09-29 13:57:26 +02:00
75b9b688cc
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.
34 lines
736 B
Java
34 lines
736 B
Java
package net.ME1312.SubServers.Sync.Network;
|
|
|
|
import net.ME1312.SubServers.Sync.Library.Config.YAMLSection;
|
|
import net.ME1312.SubServers.Sync.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);
|
|
}
|
|
}
|