Archived
0

интерфейс EventBus

This commit is contained in:
2021-05-05 20:09:32 +03:00
parent 87dc18f009
commit 0f1c9bfb1b

View File

@@ -0,0 +1,17 @@
package mc.protocol.utils;
import mc.protocol.ChannelContext;
import mc.protocol.State;
import mc.protocol.packets.ClientSidePacket;
public interface EventBus {
<P extends ClientSidePacket> void subscribe(State state, Class<P> packetClass, EventHandler<P> eventHandler);
<P extends ClientSidePacket> void emit(State state, ChannelContext<P> channelContext);
@FunctionalInterface
interface EventHandler<P extends ClientSidePacket> {
void handle(ChannelContext<P> channelContext);
}
}