интерфейс EventBus
This commit is contained in:
17
protocol/src/main/java/mc/protocol/utils/EventBus.java
Normal file
17
protocol/src/main/java/mc/protocol/utils/EventBus.java
Normal 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);
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user