Package net.neoforged.neoforge.network
Class NetworkInstance
java.lang.Object
net.neoforged.neoforge.network.NetworkInstance
-
Field Summary
Modifier and TypeFieldDescriptionprivate final ResourceLocation
private final net.neoforged.bus.api.IEventBus
private final String
-
Constructor Summary
ConstructorDescriptionNetworkInstance
(ResourceLocation channelName, Supplier<String> networkProtocolVersion, Predicate<String> clientAcceptedVersions, Predicate<String> serverAcceptedVersions) -
Method Summary
Modifier and TypeMethodDescriptionvoid
addGatherListener
(Consumer<NetworkEvent.GatherLoginPayloadsEvent> eventListener) <T extends NetworkEvent>
voidaddListener
(Consumer<T> eventListener) (package private) boolean
dispatch
(LoginNetworkDirection side, ICustomQueryPayloadWithBuffer packet, Connection manager) (package private) boolean
dispatch
(PlayNetworkDirection side, ICustomPacketPayloadWithBuffer packet, Connection manager) (package private) void
dispatchEvent
(NetworkEvent networkEvent) (package private) void
dispatchGatherLogin
(List<NetworkRegistry.LoginPayload> loginPayloadList, boolean isLocal) (package private) void
dispatchLoginPacket
(NetworkEvent.LoginPayloadEvent loginPayloadEvent) (package private) String
private void
handleError
(net.neoforged.bus.api.IEventBus iEventBus, net.neoforged.bus.api.Event event, net.neoforged.bus.api.EventListener[] iEventListeners, int i, Throwable throwable) boolean
isRemotePresent
(Connection manager) void
registerObject
(Object object) (package private) boolean
tryClientVersionOnServer
(String clientVersion) (package private) boolean
tryServerVersionOnClient
(String serverVersion) void
unregisterObject
(Object object)
-
Field Details
-
channelName
-
networkProtocolVersion
-
clientAcceptedVersions
-
serverAcceptedVersions
-
networkEventBus
private final net.neoforged.bus.api.IEventBus networkEventBus
-
-
Constructor Details
-
NetworkInstance
-
-
Method Details
-
getChannelName
-
handleError
private void handleError(net.neoforged.bus.api.IEventBus iEventBus, net.neoforged.bus.api.Event event, net.neoforged.bus.api.EventListener[] iEventListeners, int i, Throwable throwable) -
addListener
-
addGatherListener
-
registerObject
-
unregisterObject
-
dispatch
boolean dispatch(PlayNetworkDirection side, ICustomPacketPayloadWithBuffer packet, Connection manager) -
dispatch
boolean dispatch(LoginNetworkDirection side, ICustomQueryPayloadWithBuffer packet, Connection manager) -
getNetworkProtocolVersion
String getNetworkProtocolVersion() -
tryServerVersionOnClient
-
tryClientVersionOnServer
-
dispatchGatherLogin
-
dispatchLoginPacket
-
dispatchEvent
-
isRemotePresent
-