Package net.minecraftforge.fml.network
Class PacketDistributor<T>
java.lang.Object
net.minecraftforge.fml.network.PacketDistributor<T>
- Type Parameters:
T
-
Means to distribute packets in various ways
- See Also:
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
A Distributor curried with a specific value instance, for actual dispatchstatic final class
-
Field Summary
Modifier and TypeFieldDescriptionstatic final PacketDistributor<Void>
Send to everyone
noArg()
static final PacketDistributor<RegistryKey<World>>
Send to everyone in the dimension specified in the Supplier
with(Supplier)
DimensionTypeprivate final NetworkDirection
private final BiFunction<PacketDistributor<T>,
Supplier<T>, Consumer<IPacket<?>>> static final PacketDistributor<PacketDistributor.TargetPoint>
Send to everyone near thePacketDistributor.TargetPoint
specified in the Supplier
with(Supplier)
TargetPointstatic final PacketDistributor<List<NetworkManager>>
Send to the supplied list of NetworkManager instances in the Supplier
with(Supplier)
List of NetworkManagerstatic final PacketDistributor<ServerPlayerEntity>
Send to the player specified in the Supplier
with(Supplier)
Playerstatic final PacketDistributor<Void>
Send to the server (CLIENT to SERVER)
noArg()
static final PacketDistributor<Chunk>
Send to all tracking the Chunk in the Supplier
with(Supplier)
Chunkstatic final PacketDistributor<Entity>
Send to all tracking the Entity in the Supplier
with(Supplier)
Entitystatic final PacketDistributor<Entity>
Send to all tracking the Entity and Player in the Supplier
with(Supplier)
Entity -
Constructor Summary
ConstructorDescriptionPacketDistributor
(BiFunction<PacketDistributor<T>, Supplier<T>, Consumer<IPacket<?>>> functor, NetworkDirection direction) -
Method Summary
Modifier and TypeMethodDescriptionclientToServer
(Supplier<Void> voidSupplier) private MinecraftServer
networkManagerList
(Supplier<List<NetworkManager>> nmListSupplier) noArg()
Apply a no argument value to a distributor to generate an instance for sending packets to.playerConsumer
(Supplier<ServerPlayerEntity> entityPlayerMPSupplier) playerListAll
(Supplier<Void> voidSupplier) playerListDimConsumer
(Supplier<RegistryKey<World>> dimensionTypeSupplier) playerListPointConsumer
(Supplier<PacketDistributor.TargetPoint> targetPointSupplier) trackingChunk
(Supplier<Chunk> chunkPosSupplier) trackingEntity
(Supplier<Entity> entitySupplier) trackingEntityAndSelf
(Supplier<Entity> entitySupplier) Apply the supplied value to the specific distributor to generate an instance for sending packets to.
-
Field Details
-
PLAYER
Send to the player specified in the Supplier
with(Supplier)
Player -
DIMENSION
Send to everyone in the dimension specified in the Supplier
with(Supplier)
DimensionType -
NEAR
Send to everyone near thePacketDistributor.TargetPoint
specified in the Supplier
with(Supplier)
TargetPoint -
ALL
Send to everyone
noArg()
-
SERVER
Send to the server (CLIENT to SERVER)
noArg()
-
TRACKING_ENTITY
Send to all tracking the Entity in the Supplier
with(Supplier)
Entity -
TRACKING_ENTITY_AND_SELF
Send to all tracking the Entity and Player in the Supplier
with(Supplier)
Entity -
TRACKING_CHUNK
Send to all tracking the Chunk in the Supplier
with(Supplier)
Chunk -
NMLIST
Send to the supplied list of NetworkManager instances in the Supplier
with(Supplier)
List of NetworkManager -
functor
-
direction
-
-
Constructor Details
-
PacketDistributor
public PacketDistributor(BiFunction<PacketDistributor<T>, Supplier<T>, Consumer<IPacket<?>>> functor, NetworkDirection direction)
-
-
Method Details
-
with
Apply the supplied value to the specific distributor to generate an instance for sending packets to.- Parameters:
input
- The input to apply- Returns:
- A curried instance
-
noArg
Apply a no argument value to a distributor to generate an instance for sending packets to. -
playerConsumer
-
playerListDimConsumer
private Consumer<IPacket<?>> playerListDimConsumer(Supplier<RegistryKey<World>> dimensionTypeSupplier) -
playerListAll
-
clientToServer
-
playerListPointConsumer
private Consumer<IPacket<?>> playerListPointConsumer(Supplier<PacketDistributor.TargetPoint> targetPointSupplier) -
trackingEntity
-
trackingEntityAndSelf
-
trackingChunk
-
networkManagerList
-
getServer
-