Package net.minecraftforge.network
Class NetworkInstance
java.lang.Object
net.minecraftforge.network.NetworkInstance
This is essentially the shared common class for
SimpleChannel and EventNetworkChannel.
I've now introduced Channel as that common modder facing base class. I am basically using this
as the internal API and Channel as the public.-
Field Summary
FieldsModifier and TypeFieldDescription(package private) final Map<io.netty.util.AttributeKey<?>, Function<Connection, ?>> (package private) final Consumer<Connection> private final ResourceLocation(package private) final Channel.VersionTestprivate final Set<ResourceLocation> private final net.minecraftforge.eventbus.api.IEventBusprivate final int(package private) final ServerStatusPing.ChannelData(package private) final Channel.VersionTest -
Constructor Summary
ConstructorsConstructorDescriptionNetworkInstance(ResourceLocation channelName, int networkProtocolVersion, Channel.VersionTest clientAcceptedVersions, Channel.VersionTest serverAcceptedVersions, Map<io.netty.util.AttributeKey<?>, Function<Connection, ?>> attributes, Consumer<Connection> channelHandler) -
Method Summary
Modifier and TypeMethodDescriptionaddChild(ResourceLocation name) Registers another name that will have its CustomPayloadEvents redirected to this channel.<T extends CustomPayloadEvent>
voidaddListener(Consumer<T> eventListener) booleandispatch(CustomPayloadEvent event) (package private) ResourceLocation(package private) intprivate voidhandleError(net.minecraftforge.eventbus.api.IEventBus iEventBus, net.minecraftforge.eventbus.api.Event event, net.minecraftforge.eventbus.api.IEventListener[] iEventListeners, int i, Throwable throwable) (package private) booleanvoidregisterObject(Object object) (package private) voidregistrationChange(ResourceLocation name, boolean registered) voidunregisterObject(Object object)
-
Field Details
-
networkEventBus
private final net.minecraftforge.eventbus.api.IEventBus networkEventBus -
channelName
-
networkProtocolVersion
private final int networkProtocolVersion -
clientAcceptedVersions
-
serverAcceptedVersions
-
attributes
-
channelHandler
-
pingData
-
ids
-
-
Constructor Details
-
NetworkInstance
NetworkInstance(ResourceLocation channelName, int networkProtocolVersion, Channel.VersionTest clientAcceptedVersions, Channel.VersionTest serverAcceptedVersions, Map<io.netty.util.AttributeKey<?>, Function<Connection, ?>> attributes, Consumer<Connection> channelHandler)
-
-
Method Details
-
handleError
private void handleError(net.minecraftforge.eventbus.api.IEventBus iEventBus, net.minecraftforge.eventbus.api.Event event, net.minecraftforge.eventbus.api.IEventListener[] iEventListeners, int i, Throwable throwable) -
addListener
-
registerObject
-
unregisterObject
-
dispatch
-
addChild
Registers another name that will have its CustomPayloadEvents redirected to this channel. Like the main name, this must be unique across all channels. -
getChannelName
ResourceLocation getChannelName() -
getNetworkProtocolVersion
int getNetworkProtocolVersion() -
registrationChange
-
isRemotePresent
-