public class NetworkHelper
extends java.lang.Object
PacketDistributor
is ugly)Constructor and Description |
---|
NetworkHelper() |
Modifier and Type | Method and Description |
---|---|
static void |
sendNearbyPacket(net.minecraftforge.fml.network.PacketDistributor.TargetPoint targetPoint,
TCGPacket packet)
Sends a packet to all nearby players
|
static void |
sendNearbyPacket(TargetPoint targetPoint,
java.util.function.Function<net.minecraft.entity.player.ServerPlayerEntity,TCGPacket> packetFunction)
Sends a packet to all nearby players, with a function to modify the packet based on the specific player.
|
static void |
sendNearbyPacket(TCGPacket packet,
net.minecraftforge.fml.network.PacketDistributor.TargetPoint targetPoint)
Sends a packet to all nearby players
|
static void |
sendPacket(net.minecraft.entity.player.ServerPlayerEntity serverPlayer,
TCGPacket packet)
Sends the packet to the player
|
static void |
sendPacket(TCGPacket packet,
net.minecraft.entity.player.ServerPlayerEntity serverPlayer)
Sends the packet to the player
|
static void |
sendToAll(TCGPacket packet)
Sends a packet to all players
|
static void |
sendToAllTracking(TCGPacket packet,
net.minecraft.entity.Entity entity)
Sends a packet to all nearby players
|
static void |
sendToDimension(TCGPacket packet,
net.minecraft.world.World world)
Sends a packet to all nearby players
|
static void |
sendToServer(TCGPacket packet)
Sends a packet to the server
|
public static void sendPacket(TCGPacket packet, net.minecraft.entity.player.ServerPlayerEntity serverPlayer)
serverPlayer
- The player implementationpacket
- The packet to send to the playerpublic static void sendPacket(net.minecraft.entity.player.ServerPlayerEntity serverPlayer, TCGPacket packet)
serverPlayer
- The player implementationpacket
- The packet to send to the playerpublic static void sendNearbyPacket(TCGPacket packet, net.minecraftforge.fml.network.PacketDistributor.TargetPoint targetPoint)
targetPoint
- The point to get nearby players frompacket
- The packet to sendpublic static void sendNearbyPacket(net.minecraftforge.fml.network.PacketDistributor.TargetPoint targetPoint, TCGPacket packet)
targetPoint
- The point to get nearby players frompacket
- The packet to sendpublic static void sendNearbyPacket(TargetPoint targetPoint, java.util.function.Function<net.minecraft.entity.player.ServerPlayerEntity,TCGPacket> packetFunction)
public static void sendToDimension(TCGPacket packet, net.minecraft.world.World world)
world
- The world to get all players frompacket
- The packet to sendpublic static void sendToAllTracking(TCGPacket packet, net.minecraft.entity.Entity entity)
entity
- The entity to get all players trackingpacket
- The packet to sendpublic static void sendToAll(TCGPacket packet)
packet
- The packet to sendpublic static void sendToServer(TCGPacket packet)
packet
- The packet to send