26 lines
804 B
Java
26 lines
804 B
Java
// SPDX-FileCopyrightText: 2018 The CC: Tweaked Developers
|
|
//
|
|
// SPDX-License-Identifier: MPL-2.0
|
|
|
|
package dan200.computercraft.shared.network;
|
|
|
|
import dan200.computercraft.shared.network.client.ClientNetworkContext;
|
|
import dan200.computercraft.shared.network.server.ServerNetworkContext;
|
|
import net.minecraft.network.protocol.common.custom.CustomPacketPayload;
|
|
|
|
/**
|
|
* The base interface for any message which will be sent to the client or server.
|
|
*
|
|
* @param <T> The context under which packets are evaluated.
|
|
* @see ClientNetworkContext
|
|
* @see ServerNetworkContext
|
|
*/
|
|
public interface NetworkMessage<T> extends CustomPacketPayload {
|
|
/**
|
|
* Handle this {@link NetworkMessage}.
|
|
*
|
|
* @param context The context with which to handle this message
|
|
*/
|
|
void handle(T context);
|
|
}
|