убираем reactor
This commit is contained in:
@@ -8,12 +8,9 @@ import mc.protocol.packets.PingPacket;
|
||||
import mc.protocol.packets.ServerSidePacket;
|
||||
import mc.protocol.packets.client.*;
|
||||
import mc.protocol.packets.server.*;
|
||||
import reactor.core.publisher.Flux;
|
||||
import reactor.core.publisher.Sinks;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
import java.util.Collections;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
@RequiredArgsConstructor
|
||||
@@ -83,9 +80,6 @@ public enum State {
|
||||
private final Map<Integer, Class<? extends ClientSidePacket>> clientSidePackets;
|
||||
private final Map<Class<? extends ServerSidePacket>, Integer> serverSidePackets;
|
||||
|
||||
@SuppressWarnings("rawtypes")
|
||||
private final Map<Class<? extends ClientSidePacket>, Sinks.Many<ChannelContext>> observedMap = new HashMap<>();
|
||||
|
||||
State(int id, Map<Integer, Class<? extends ClientSidePacket>> clientSidePackets) {
|
||||
this.id = id;
|
||||
this.clientSidePackets = clientSidePackets;
|
||||
@@ -101,16 +95,4 @@ public enum State {
|
||||
public Integer getServerSidePacketId(Class<? extends Packet> clazz) {
|
||||
return serverSidePackets == null ? null : serverSidePackets.get(clazz);
|
||||
}
|
||||
|
||||
|
||||
@SuppressWarnings("rawtypes")
|
||||
public <P extends ClientSidePacket> Sinks.Many<ChannelContext> getPacketSinks(Class<P> packetClass) {
|
||||
return observedMap.get(packetClass);
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
public <P extends ClientSidePacket> Flux<ChannelContext<P>> packetFlux(Class<P> packetClass) {
|
||||
return observedMap.computeIfAbsent(packetClass, aClass -> Sinks.many().multicast().directBestEffort())
|
||||
.asFlux().map(ChannelContext.class::cast);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user