Interface Shape

All Known Implementing Classes:
Point, Ring

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 Details

  • 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)
      Emits vfx and/or sfx at the positions defined by this shape.

      Either or both effect arguments may be null; check before calling their respective send methods.

      Parameters:
      origin - the world position around which effects are distributed
      vfx - the visual effect to emit, or null if none
      sfx - the sound effect to emit, or null if none
      players - the players to receive the effects, already filtered to the action's radius
      buffer - the command buffer for the current tick
      random - 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)
      Writes packet to the packet handler of every valid player in players.

      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 send
      players - the player entity refs to send to
      buffer - the command buffer used to read player components