记录类 PacketDistributor<T>
java.lang.Object
java.lang.Record
net.minecraftforge.network.PacketDistributor<T>
- 类型参数:
T
-
public record PacketDistributor<T>(BiFunction<PacketDistributor<T>,T,Consumer<Packet<?>>> functor, NetworkDirection<?> direction)
extends Record
Means to distribute packets in various ways
- 另请参阅:
-
嵌套类概要
嵌套类修饰符和类型类说明static final record
A Distributor curried with a specific value instance, for actual dispatchstatic final record
-
字段概要
字段修饰符和类型字段说明static final PacketDistributor
<Void> Send to everyone
noArg()
static final PacketDistributor
<ResourceKey<Level>> Send to everyone in the dimension specified in the Supplier
with(T)
DimensionTypeprivate final NetworkDirection
<?> direction
记录组件的字段。private final BiFunction
<PacketDistributor<T>, T, Consumer<Packet<?>>> functor
记录组件的字段。static final PacketDistributor
<PacketDistributor.TargetPoint> Send to everyone near thePacketDistributor.TargetPoint
specified in the Supplier
with(T)
TargetPointstatic final PacketDistributor
<List<Connection>> Send to the supplied list of NetworkManager instances in the Supplier
with(T)
List of NetworkManagerstatic final PacketDistributor
<ServerPlayer> Send to the player specified in the Supplier
with(T)
Playerstatic final PacketDistributor
<Void> Send to the server (CLIENT to SERVER)
noArg()
static final PacketDistributor
<LevelChunk> Send to all tracking the Chunk in the Supplier
with(T)
Chunkstatic final PacketDistributor
<Entity> Send to all tracking the Entity in the Supplier
with(T)
Entitystatic final PacketDistributor
<Entity> Send to all tracking the Entity and Player in the Supplier
with(T)
Entity -
构造器概要
构造器构造器说明PacketDistributor
(BiFunction<PacketDistributor<T>, T, Consumer<Packet<?>>> functor) PacketDistributor
(BiFunction<PacketDistributor<T>, T, Consumer<Packet<?>>> functor, NetworkDirection<?> direction) 创建PacketDistributor
记录类的实例。 -
方法概要
修饰符和类型方法说明clientToServer
(Void ignored) 返回direction
记录组件的值。final boolean
指示某个其他对象是否“等于”此对象。BiFunction
<PacketDistributor<T>, T, Consumer<Packet<?>>> functor()
返回functor
记录组件的值。private MinecraftServer
final int
hashCode()
返回此对象的哈希代码值。networkManagerList
(List<Connection> connections) noArg()
Apply a no argument value to a distributor to generate an instance for sending packets to.playerConsumer
(ServerPlayer player) playerListAll
(Void ignored) playerListDimConsumer
(ResourceKey<Level> dimension) final String
toString()
返回此记录类的字符串表示形式。trackingChunk
(LevelChunk chunk) trackingEntity
(Entity entity) trackingEntityAndSelf
(Entity entity) Apply the supplied value to the specific distributor to generate an instance for sending packets to.
-
字段详细资料
-
functor
functor
记录组件的字段。 -
direction
direction
记录组件的字段。 -
PLAYER
Send to the player specified in the Supplier
with(T)
Player -
DIMENSION
Send to everyone in the dimension specified in the Supplier
with(T)
DimensionType -
NEAR
Send to everyone near thePacketDistributor.TargetPoint
specified in the Supplier
with(T)
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(T)
Entity -
TRACKING_ENTITY_AND_SELF
Send to all tracking the Entity and Player in the Supplier
with(T)
Entity -
TRACKING_CHUNK
Send to all tracking the Chunk in the Supplier
with(T)
Chunk -
NMLIST
Send to the supplied list of NetworkManager instances in the Supplier
with(T)
List of NetworkManager
-
-
构造器详细资料
-
PacketDistributor
-
PacketDistributor
public PacketDistributor(BiFunction<PacketDistributor<T>, T, Consumer<Packet<?>>> functor, NetworkDirection<?> direction) 创建PacketDistributor
记录类的实例。- 参数:
functor
-functor
记录组件的值direction
-direction
记录组件的值
-
-
方法详细资料
-
with
Apply the supplied value to the specific distributor to generate an instance for sending packets to.- 参数:
input
- The input to apply- 返回:
- A curried instance
-
noArg
Apply a no argument value to a distributor to generate an instance for sending packets to.- 返回:
- A curried instance
- 另请参阅:
-
playerConsumer
-
playerListDimConsumer
-
playerListAll
-
clientToServer
-
playerListPointConsumer
-
trackingEntity
-
trackingEntityAndSelf
-
trackingChunk
-
networkManagerList
-
getServer
-
toString
返回此记录类的字符串表示形式。此表示形式包含类的名称,后跟每个记录组件的名称和值。 -
hashCode
public final int hashCode()返回此对象的哈希代码值。此值派生自每个记录组件的哈希代码。 -
equals
指示某个其他对象是否“等于”此对象。如果两个对象属于同一个类,而且所有记录组件都相等,则这两个对象相等。 此记录类中的所有组件都使用Objects::equals(Object,Object)
进行比较。 -
functor
返回functor
记录组件的值。- 返回:
functor
记录组件的值
-
direction
返回direction
记录组件的值。- 返回:
direction
记录组件的值
-