hohserg.elegant.networking.api.ClientToServerPacket Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of elegant-networking-1.16 Show documentation
Show all versions of elegant-networking-1.16 Show documentation
This is a runtime library of ElegantNetworking for MinecraftForge 1.16
The newest version!
package hohserg.elegant.networking.api;
import hohserg.elegant.networking.impl.Network;
import net.minecraft.entity.player.ServerPlayerEntity;
/**
* Base interface for packet, which can be send from client to server
*/
public interface ClientToServerPacket extends IByteBufSerializable {
/**
* Called when the packet is received
*
* @param player Sender
*/
void onReceive(ServerPlayerEntity player);
/**
* Use it for send packet instance to server
*/
default void sendToServer() {
Network.getNetwork().sendToServer(this);
}
}