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 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 TypeMethodDescription<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) void
registerObject
(Object object) (package private) void
registrationChange
(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
-
-
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
-
getChannelName
ResourceLocation getChannelName() -
getNetworkProtocolVersion
int getNetworkProtocolVersion() -
registrationChange
void registrationChange(boolean registered)
-