Contents
Interface Shape
public interface Shape
Determines the spatial distribution of effect spawn points relative to an origin position.
Called by
EffectsAction
after the nearby player list has already been collected.-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionvoidapply(org.joml.Vector3d origin, VisualFX vfx, SoundFX sfx, List<Ref<EntityStore>> players, CommandBuffer<EntityStore> buffer, RandomGenerator random) Emitsvfxand/orsfxat the positions defined by this shape.static voidsendPacketToAll(ToClientPacket packet, List<Ref<EntityStore>> players, CommandBuffer<EntityStore> buffer) Writespacketto the packet handler of every valid player inplayers.
-
Field Details
-
TYPE_CODEC
-
-
Method Details
-
apply
void apply(@Nonnull org.joml.Vector3d origin, @Nullable VisualFX vfx, @Nullable SoundFX sfx, @Nonnull List<Ref<EntityStore>> players, @Nonnull CommandBuffer<EntityStore> buffer, @Nonnull RandomGenerator random) Emitsvfxand/orsfxat the positions defined by this shape.Either or both effect arguments may be
null; check before calling their respectivesendmethods.- Parameters:
origin- the world position around which effects are distributedvfx- the visual effect to emit, ornullif nonesfx- the sound effect to emit, ornullif noneplayers- the players to receive the effects, already filtered to the action's radiusbuffer- the command buffer for the current tickrandom- a random source for per-point variation (offsets, scale, pitch, etc.)
-
sendPacketToAll
static void sendPacketToAll(@Nonnull ToClientPacket packet, @Nonnull List<Ref<EntityStore>> players, @Nonnull CommandBuffer<EntityStore> buffer) Writespacketto the packet handler of every valid player inplayers.Implementations can use this as a convenience when emitting a single packet to all players from within
apply(Vector3d, VisualFX, SoundFX, List, CommandBuffer, RandomGenerator), rather than iterating the list manually.- Parameters:
packet- the packet to sendplayers- the player entity refs to send tobuffer- the command buffer used to read player components
-