package com.gmail.woodyc40.common.protocol; import net.tridentsdk.entity.living.Player; import java.util.Arrays; import java.util.Collection; /** * Represents a runnable action which can occur on the protocol stream * * <p>A protocol action that does notion should use {@code ProtocolAction.NO_OP}</p> * * @author Pierre C */ @FunctionalInterface public interface ProtocolAction { /** No players for protocol actions */ public static final Collection<Player> NO_PLAYERS = Arrays.asList(); /** Performs nothing */ public static final ProtocolAction NO_OP = pipe -> null; /** * Performs the action * * @param pipe the buffer to inject networking IO if needed * @return the players to send the action to */ Collection<Player> handle(ByteAppender pipe); }