T
- public class PacketDistributor<T>
extends java.lang.Object
net.minecraftforge.fml.network.simple.SimpleChannel#send(PacketTarget, Object)
Modifier and Type | Class and Description |
---|---|
static class |
PacketDistributor.PacketTarget
A Distributor curried with a specific value instance, for actual dispatch
|
static class |
PacketDistributor.TargetPoint |
Modifier and Type | Field and Description |
---|---|
static PacketDistributor<java.lang.Void> |
ALL
Send to everyone
noArg() |
static PacketDistributor<DimensionType> |
DIMENSION
Send to everyone in the dimension specified in the Supplier
with(Supplier) DimensionType |
private NetworkDirection |
direction |
private java.util.function.BiFunction<PacketDistributor<T>,java.util.function.Supplier<T>,java.util.function.Consumer<IPacket<?>>> |
functor |
static PacketDistributor<PacketDistributor.TargetPoint> |
NEAR
Send to everyone near the
PacketDistributor.TargetPoint specified in the Supplier
with(Supplier) TargetPoint |
static PacketDistributor<java.util.List<NetworkManager>> |
NMLIST
Send to the supplied list of NetworkManager instances in the Supplier
with(Supplier) List of NetworkManager |
static PacketDistributor<ServerPlayerEntity> |
PLAYER
Send to the player specified in the Supplier
with(Supplier) Player |
static PacketDistributor<java.lang.Void> |
SERVER
Send to the server (CLIENT to SERVER)
noArg() |
static PacketDistributor<Chunk> |
TRACKING_CHUNK
Send to all tracking the Chunk in the Supplier
with(Supplier) Chunk |
static PacketDistributor<Entity> |
TRACKING_ENTITY
Send to all tracking the Entity in the Supplier
with(Supplier) Entity |
static PacketDistributor<Entity> |
TRACKING_ENTITY_AND_SELF
Send to all tracking the Entity and Player in the Supplier
with(Supplier) Entity |
Constructor and Description |
---|
PacketDistributor(java.util.function.BiFunction<PacketDistributor<T>,java.util.function.Supplier<T>,java.util.function.Consumer<IPacket<?>>> functor,
NetworkDirection direction) |
Modifier and Type | Method and Description |
---|---|
private java.util.function.Consumer<IPacket<?>> |
clientToServer(java.util.function.Supplier<java.lang.Void> voidSupplier) |
private MinecraftServer |
getServer() |
private java.util.function.Consumer<IPacket<?>> |
networkManagerList(java.util.function.Supplier<java.util.List<NetworkManager>> nmListSupplier) |
PacketDistributor.PacketTarget |
noArg()
Apply a no argument value to a distributor to generate an instance for sending packets to.
|
private java.util.function.Consumer<IPacket<?>> |
playerConsumer(java.util.function.Supplier<ServerPlayerEntity> entityPlayerMPSupplier) |
private java.util.function.Consumer<IPacket<?>> |
playerListAll(java.util.function.Supplier<java.lang.Void> voidSupplier) |
private java.util.function.Consumer<IPacket<?>> |
playerListDimConsumer(java.util.function.Supplier<DimensionType> dimensionTypeSupplier) |
private java.util.function.Consumer<IPacket<?>> |
playerListPointConsumer(java.util.function.Supplier<PacketDistributor.TargetPoint> targetPointSupplier) |
private java.util.function.Consumer<IPacket<?>> |
trackingChunk(java.util.function.Supplier<Chunk> chunkPosSupplier) |
private java.util.function.Consumer<IPacket<?>> |
trackingEntity(java.util.function.Supplier<Entity> entitySupplier) |
private java.util.function.Consumer<IPacket<?>> |
trackingEntityAndSelf(java.util.function.Supplier<Entity> entitySupplier) |
PacketDistributor.PacketTarget |
with(java.util.function.Supplier<T> input)
Apply the supplied value to the specific distributor to generate an instance for sending packets to.
|
public static final PacketDistributor<ServerPlayerEntity> PLAYER
with(Supplier)
Playerpublic static final PacketDistributor<DimensionType> DIMENSION
with(Supplier)
DimensionTypepublic static final PacketDistributor<PacketDistributor.TargetPoint> NEAR
PacketDistributor.TargetPoint
specified in the Supplier
with(Supplier)
TargetPointpublic static final PacketDistributor<java.lang.Void> ALL
noArg()
public static final PacketDistributor<java.lang.Void> SERVER
noArg()
public static final PacketDistributor<Entity> TRACKING_ENTITY
with(Supplier)
Entitypublic static final PacketDistributor<Entity> TRACKING_ENTITY_AND_SELF
with(Supplier)
Entitypublic static final PacketDistributor<Chunk> TRACKING_CHUNK
with(Supplier)
Chunkpublic static final PacketDistributor<java.util.List<NetworkManager>> NMLIST
with(Supplier)
List of NetworkManagerprivate final java.util.function.BiFunction<PacketDistributor<T>,java.util.function.Supplier<T>,java.util.function.Consumer<IPacket<?>>> functor
private final NetworkDirection direction
public PacketDistributor(java.util.function.BiFunction<PacketDistributor<T>,java.util.function.Supplier<T>,java.util.function.Consumer<IPacket<?>>> functor, NetworkDirection direction)
public PacketDistributor.PacketTarget with(java.util.function.Supplier<T> input)
input
- The input to applypublic PacketDistributor.PacketTarget noArg()
private java.util.function.Consumer<IPacket<?>> playerConsumer(java.util.function.Supplier<ServerPlayerEntity> entityPlayerMPSupplier)
private java.util.function.Consumer<IPacket<?>> playerListDimConsumer(java.util.function.Supplier<DimensionType> dimensionTypeSupplier)
private java.util.function.Consumer<IPacket<?>> playerListAll(java.util.function.Supplier<java.lang.Void> voidSupplier)
private java.util.function.Consumer<IPacket<?>> clientToServer(java.util.function.Supplier<java.lang.Void> voidSupplier)
private java.util.function.Consumer<IPacket<?>> playerListPointConsumer(java.util.function.Supplier<PacketDistributor.TargetPoint> targetPointSupplier)
private java.util.function.Consumer<IPacket<?>> trackingEntity(java.util.function.Supplier<Entity> entitySupplier)
private java.util.function.Consumer<IPacket<?>> trackingEntityAndSelf(java.util.function.Supplier<Entity> entitySupplier)
private java.util.function.Consumer<IPacket<?>> trackingChunk(java.util.function.Supplier<Chunk> chunkPosSupplier)
private java.util.function.Consumer<IPacket<?>> networkManagerList(java.util.function.Supplier<java.util.List<NetworkManager>> nmListSupplier)
private MinecraftServer getServer()