public class NetworkInstance
extends java.lang.Object
Modifier and Type | Field and 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 and 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) |
Modifier and Type | Method and Description |
---|---|
void |
addGatherListener(java.util.function.Consumer<NetworkEvent.GatherLoginPayloadsEvent> eventListener) |
<T extends NetworkEvent> |
addListener(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) |
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) |
private final ResourceLocation channelName
private final java.lang.String networkProtocolVersion
private final java.util.function.Predicate<java.lang.String> clientAcceptedVersions
private final java.util.function.Predicate<java.lang.String> serverAcceptedVersions
private final net.minecraftforge.eventbus.api.IEventBus networkEventBus
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)
public ResourceLocation getChannelName()
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)
public <T extends NetworkEvent> void addListener(java.util.function.Consumer<T> eventListener)
public void addGatherListener(java.util.function.Consumer<NetworkEvent.GatherLoginPayloadsEvent> eventListener)
public void registerObject(java.lang.Object object)
public void unregisterObject(java.lang.Object object)
boolean dispatch(NetworkDirection side, ICustomPacket<?> packet, NetworkManager manager)
java.lang.String getNetworkProtocolVersion()
boolean tryServerVersionOnClient(java.lang.String serverVersion)
boolean tryClientVersionOnServer(java.lang.String clientVersion)
void dispatchGatherLogin(java.util.List<NetworkRegistry.LoginPayload> loginPayloadList, boolean isLocal)
void dispatchLoginPacket(NetworkEvent.LoginPayloadEvent loginPayloadEvent)
void dispatchEvent(NetworkEvent networkEvent)