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
Modifier and TypeFieldDescription(package private) final Map
<io.netty.util.AttributeKey<?>, Function<Connection, ?>> (package private) final Consumer
<Connection> private final ResourceLocation
(package private) final Channel.VersionTest
private final Set
<ResourceLocation> private final net.minecraftforge.eventbus.api.IEventBus
private final int
(package private) final ServerStatusPing.ChannelData
(package private) final Channel.VersionTest
-
Constructor Summary
ConstructorDescriptionNetworkInstance
(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) boolean
dispatch
(CustomPayloadEvent event) (package private) ResourceLocation
(package private) int
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) (package private) boolean
void
registerObject
(Object object) (package private) void
registrationChange
(ResourceLocation name, boolean registered) void
unregisterObject
(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
-