Contents
- Description
- Constructor Summary
- Method Summary
- Constructor Details
- Method Details
- forEachPlayerThatCanSeeEntity(Ref, TriConsumer, ComponentAccessor)
- forEachPlayerThatCanSeeEntity(Ref, TriConsumer, Ref, ComponentAccessor)
- broadcastMessageToPlayers(UUID, Message, Store)
- broadcastPacketToPlayers(ComponentAccessor, ToClientPacket)
- broadcastPacketToPlayersNoCache(ComponentAccessor, ToClientPacket)
- broadcastPacketToPlayers(ComponentAccessor, ToClientPacket...)
- resetPlayerModel(Ref, ComponentAccessor)
Class PlayerUtil
java.lang.Object
com.hypixel.hytale.server.core.universe.world.PlayerUtil
A utility class that contains a variety of player-specific functions and utilities.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidbroadcastMessageToPlayers(UUID sourcePlayerUuid, Message message, Store<EntityStore> store) Called to broadcast a message to all player entities within the given entity store.static voidbroadcastPacketToPlayers(ComponentAccessor<EntityStore> componentAccessor, ToClientPacket packet) Called to broadcast the given packet to all player instances within the store of the provided component accessor.static voidbroadcastPacketToPlayers(ComponentAccessor<EntityStore> componentAccessor, ToClientPacket... packets) Called to broadcast the given packets to all player instances within the store of the provided component accessor.static voidbroadcastPacketToPlayersNoCache(ComponentAccessor<EntityStore> componentAccessor, ToClientPacket packet) Called to broadcast the given packet to all player instances within the store of the provided component accessor without caching the packetstatic voidforEachPlayerThatCanSeeEntity(Ref<EntityStore> ref, TriConsumer<Ref<EntityStore>, PlayerRef, ComponentAccessor<EntityStore>> consumer, ComponentAccessor<EntityStore> componentAccessor) Called to iterate over each player that can see the given entity, executing the provided consumer.static voidforEachPlayerThatCanSeeEntity(Ref<EntityStore> ref, TriConsumer<Ref<EntityStore>, PlayerRef, ComponentAccessor<EntityStore>> consumer, Ref<EntityStore> ignoredPlayerRef, ComponentAccessor<EntityStore> componentAccessor) Called to iterate over each player that can see the given entity, executing the provided consumer.static voidresetPlayerModel(Ref<EntityStore> ref, ComponentAccessor<EntityStore> componentAccessor) Deprecated, for removal: This API element is subject to removal in a future version.
-
Constructor Details
-
PlayerUtil
public PlayerUtil()
-
-
Method Details
-
forEachPlayerThatCanSeeEntity
public static void forEachPlayerThatCanSeeEntity(@Nonnull Ref<EntityStore> ref, @Nonnull TriConsumer<Ref<EntityStore>, PlayerRef, ComponentAccessor<EntityStore>> consumer, @Nonnull ComponentAccessor<EntityStore> componentAccessor) Called to iterate over each player that can see the given entity, executing the provided consumer.- Parameters:
ref- The entity reference of the target entity.consumer- The consumer of logic that is to be executed on each player.componentAccessor- Theinvalid input: '<' EntityStore >for component access.
-
forEachPlayerThatCanSeeEntity
public static void forEachPlayerThatCanSeeEntity(@Nonnull Ref<EntityStore> ref, @Nonnull TriConsumer<Ref<EntityStore>, PlayerRef, ComponentAccessor<EntityStore>> consumer, @Nullable Ref<EntityStore> ignoredPlayerRef, @Nonnull ComponentAccessor<EntityStore> componentAccessor) Called to iterate over each player that can see the given entity, executing the provided consumer.- Parameters:
ref- The entity reference of the target entity.consumer- The consumer of logic that is to be executed on each player.ignoredPlayerRef- An optional entity reference of a player to ignore during iteration.componentAccessor- TheComponentAccessor<EntityStore>for component access.
-
broadcastMessageToPlayers
public static void broadcastMessageToPlayers(@Nullable UUID sourcePlayerUuid, @Nonnull Message message, @Nonnull Store<EntityStore> store) Called to broadcast a message to all player entities within the given entity store.- Parameters:
sourcePlayerUuid- TheUUIDinstance of the source player entity, if any.message- The message instance to be sent.store- Thefor component access.
-
broadcastPacketToPlayers
public static void broadcastPacketToPlayers(@Nonnull ComponentAccessor<EntityStore> componentAccessor, @Nonnull ToClientPacket packet) Called to broadcast the given packet to all player instances within the store of the provided component accessor.- Parameters:
componentAccessor- TheComponentAccessor<EntityStore>associated with the store.packet- The packet instance to be sent to all player entities.
-
broadcastPacketToPlayersNoCache
public static void broadcastPacketToPlayersNoCache(@Nonnull ComponentAccessor<EntityStore> componentAccessor, @Nonnull ToClientPacket packet) Called to broadcast the given packet to all player instances within the store of the provided component accessor without caching the packet- Parameters:
componentAccessor- TheComponentAccessor<EntityStore>associated with the store.packet- The packet instance to be sent to all player entities.
-
broadcastPacketToPlayers
public static void broadcastPacketToPlayers(@Nonnull ComponentAccessor<EntityStore> componentAccessor, @Nonnull ToClientPacket... packets) Called to broadcast the given packets to all player instances within the store of the provided component accessor.- Parameters:
componentAccessor- TheComponentAccessor<EntityStore>associated with the store.packets- The packet instances to be sent to all player entities.
-
resetPlayerModel
@Deprecated(forRemoval=true) public static void resetPlayerModel(@Nonnull Ref<EntityStore> ref, @Nonnull ComponentAccessor<EntityStore> componentAccessor) Deprecated, for removal: This API element is subject to removal in a future version.Called to reset the model of the provided player entity.- Parameters:
ref- The entity reference of the entity that we are resetting the model for.componentAccessor- TheComponentAccessor<EntityStore>for component access.
-