Package net.minecraftforge.fml.network
Class NetworkInstance
- java.lang.Object
-
- net.minecraftforge.fml.network.NetworkInstance
-
public class NetworkInstance extends java.lang.Object
-
-
Field Summary
Fields Modifier and Type Field Description private ResourceLocation
channelName
private java.util.function.Predicate<java.lang.String>
clientAcceptedVersions
private net.minecraftforge.eventbus.api.IEventBus
networkEventBus
private java.lang.String
networkProtocolVersion
private java.util.function.Predicate<java.lang.String>
serverAcceptedVersions
-
Constructor Summary
Constructors Constructor Description NetworkInstance(ResourceLocation channelName, java.util.function.Supplier<java.lang.String> networkProtocolVersion, java.util.function.Predicate<java.lang.String> clientAcceptedVersions, java.util.function.Predicate<java.lang.String> serverAcceptedVersions)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addGatherListener(java.util.function.Consumer<NetworkEvent.GatherLoginPayloadsEvent> eventListener)
<T extends NetworkEvent>
voidaddListener(java.util.function.Consumer<T> eventListener)
(package private) boolean
dispatch(NetworkDirection side, ICustomPacket<?> packet, NetworkManager manager)
(package private) void
dispatchEvent(NetworkEvent networkEvent)
(package private) void
dispatchGatherLogin(java.util.List<NetworkRegistry.LoginPayload> loginPayloadList, boolean isLocal)
(package private) void
dispatchLoginPacket(NetworkEvent.LoginPayloadEvent loginPayloadEvent)
ResourceLocation
getChannelName()
(package private) java.lang.String
getNetworkProtocolVersion()
private void
handleError(net.minecraftforge.eventbus.api.IEventBus iEventBus, net.minecraftforge.eventbus.api.Event event, net.minecraftforge.eventbus.api.IEventListener[] iEventListeners, int i, java.lang.Throwable throwable)
boolean
isRemotePresent(NetworkManager manager)
void
registerObject(java.lang.Object object)
(package private) boolean
tryClientVersionOnServer(java.lang.String clientVersion)
(package private) boolean
tryServerVersionOnClient(java.lang.String serverVersion)
void
unregisterObject(java.lang.Object object)
-
-
-
Field Detail
-
channelName
private final ResourceLocation channelName
-
networkProtocolVersion
private final java.lang.String networkProtocolVersion
-
clientAcceptedVersions
private final java.util.function.Predicate<java.lang.String> clientAcceptedVersions
-
serverAcceptedVersions
private final java.util.function.Predicate<java.lang.String> serverAcceptedVersions
-
networkEventBus
private final net.minecraftforge.eventbus.api.IEventBus networkEventBus
-
-
Constructor Detail
-
NetworkInstance
NetworkInstance(ResourceLocation channelName, java.util.function.Supplier<java.lang.String> networkProtocolVersion, java.util.function.Predicate<java.lang.String> clientAcceptedVersions, java.util.function.Predicate<java.lang.String> serverAcceptedVersions)
-
-
Method Detail
-
getChannelName
public ResourceLocation getChannelName()
-
handleError
private void handleError(net.minecraftforge.eventbus.api.IEventBus iEventBus, net.minecraftforge.eventbus.api.Event event, net.minecraftforge.eventbus.api.IEventListener[] iEventListeners, int i, java.lang.Throwable throwable)
-
addListener
public <T extends NetworkEvent> void addListener(java.util.function.Consumer<T> eventListener)
-
addGatherListener
public void addGatherListener(java.util.function.Consumer<NetworkEvent.GatherLoginPayloadsEvent> eventListener)
-
registerObject
public void registerObject(java.lang.Object object)
-
unregisterObject
public void unregisterObject(java.lang.Object object)
-
dispatch
boolean dispatch(NetworkDirection side, ICustomPacket<?> packet, NetworkManager manager)
-
getNetworkProtocolVersion
java.lang.String getNetworkProtocolVersion()
-
tryServerVersionOnClient
boolean tryServerVersionOnClient(java.lang.String serverVersion)
-
tryClientVersionOnServer
boolean tryClientVersionOnServer(java.lang.String clientVersion)
-
dispatchGatherLogin
void dispatchGatherLogin(java.util.List<NetworkRegistry.LoginPayload> loginPayloadList, boolean isLocal)
-
dispatchLoginPacket
void dispatchLoginPacket(NetworkEvent.LoginPayloadEvent loginPayloadEvent)
-
dispatchEvent
void dispatchEvent(NetworkEvent networkEvent)
-
isRemotePresent
public boolean isRemotePresent(NetworkManager manager)
-
-