public class NetworkHooks
extends java.lang.Object
Constructor and Description |
---|
NetworkHooks() |
Modifier and Type | Method and Description |
---|---|
static ConnectionType |
getConnectionType(java.util.function.Supplier<NetworkManager> connection) |
static Packet<?> |
getEntitySpawningPacket(Entity entity) |
static java.lang.String |
getFMLVersion(java.lang.String ip) |
static void |
handleClientLoginSuccess(NetworkManager manager) |
static boolean |
onCustomPayload(ICustomPacket<?> packet,
NetworkManager manager) |
static void |
openGui(EntityPlayerMP player,
IInteractionObject containerSupplier)
Request to open a GUI on the client, from the server
Refer to
ExtensionPoint.GUIFACTORY for how to provide a function to consume
these GUI requests on the client. |
static void |
openGui(EntityPlayerMP player,
IInteractionObject containerSupplier,
BlockPos pos)
Request to open a GUI on the client, from the server
Refer to
ExtensionPoint.GUIFACTORY for how to provide a function to consume
these GUI requests on the client. |
static void |
openGui(EntityPlayerMP player,
IInteractionObject containerSupplier,
java.util.function.Consumer<PacketBuffer> extraDataWriter)
Request to open a GUI on the client, from the server
Refer to
ExtensionPoint.GUIFACTORY for how to provide a function to consume
these GUI requests on the client. |
static void |
registerClientLoginChannel(NetworkManager manager) |
static void |
registerServerLoginChannel(NetworkManager manager,
CPacketHandshake packet) |
static boolean |
tickNegotiation(NetHandlerLoginServer netHandlerLoginServer,
NetworkManager networkManager,
EntityPlayerMP player) |
public static java.lang.String getFMLVersion(java.lang.String ip)
public static ConnectionType getConnectionType(java.util.function.Supplier<NetworkManager> connection)
public static boolean onCustomPayload(ICustomPacket<?> packet, NetworkManager manager)
public static void registerServerLoginChannel(NetworkManager manager, CPacketHandshake packet)
public static void registerClientLoginChannel(NetworkManager manager)
public static void handleClientLoginSuccess(NetworkManager manager)
public static boolean tickNegotiation(NetHandlerLoginServer netHandlerLoginServer, NetworkManager networkManager, EntityPlayerMP player)
public static void openGui(EntityPlayerMP player, IInteractionObject containerSupplier)
ExtensionPoint.GUIFACTORY
for how to provide a function to consume
these GUI requests on the client.
The IInteractionObject.getGuiID()
is treated as a ResourceLocation
.
It should refer to a valid modId namespace, to trigger opening on the client.
The namespace is directly used to lookup the modId in the client side.player
- The player to open the GUI forcontainerSupplier
- A supplier of container properties including the registry name of the containerpublic static void openGui(EntityPlayerMP player, IInteractionObject containerSupplier, BlockPos pos)
ExtensionPoint.GUIFACTORY
for how to provide a function to consume
these GUI requests on the client.
The IInteractionObject.getGuiID()
is treated as a ResourceLocation
.
It should refer to a valid modId namespace, to trigger opening on the client.
The namespace is directly used to lookup the modId in the client side.player
- The player to open the GUI forcontainerSupplier
- A supplier of container properties including the registry name of the containerpos
- A block pos, which will be encoded into the auxillary data for this requestpublic static void openGui(EntityPlayerMP player, IInteractionObject containerSupplier, java.util.function.Consumer<PacketBuffer> extraDataWriter)
ExtensionPoint.GUIFACTORY
for how to provide a function to consume
these GUI requests on the client.
The IInteractionObject.getGuiID()
is treated as a ResourceLocation
.
It should refer to a valid modId namespace, to trigger opening on the client.
The namespace is directly used to lookup the modId in the client side.
The maximum size for #extraDataWriter is 32600 bytes.player
- The player to open the GUI forcontainerSupplier
- A supplier of container properties including the registry name of the containerextraDataWriter
- Consumer to write any additional data the GUI needs