Class BeaconBroadcast

java.lang.Object
com.hypixel.hytale.server.npc.components.messaging.BeaconBroadcast

public final class BeaconBroadcast extends Object
Shared beacon-broadcast API.
  • Method Details

    • collectProvidedReceivers

      public static void collectProvidedReceivers(@Nonnull org.joml.Vector3d origin, double range, @Nonnull Store<EntityStore> store, @Nonnull List<Ref<EntityStore>> out)
      Appends non-NPC beacon receivers (e.g. encounter managers) within range of origin to out, via every registered BeaconReceiverProvider.
    • shouldReceive

      public static boolean shouldReceive(int senderIndex, @Nonnull Ref<EntityStore> candidate, @Nullable int[] groups, boolean allowGlobal, @Nonnull ComponentAccessor<EntityStore> accessor)
      Whether candidate should receive a beacon: it must hold a BeaconSupport mailbox and pass the group filter. A null/empty groups means everyone when allowGlobal and nobody otherwise.
    • post

      public static void post(@Nonnull Ref<EntityStore> candidate, @Nonnull String message, @Nonnull Ref<EntityStore> target, double expirationTime, @Nonnull ComponentAccessor<EntityStore> accessor)
      Posts message into candidate's BeaconSupport mailbox. Only lands if the receiver has message mapped to a slot.
    • broadcast

      public static void broadcast(@Nonnull org.joml.Vector3d origin, double range, @Nonnull String message, @Nonnull Ref<EntityStore> target, int senderIndex, @Nullable int[] groups, boolean allowGlobal, double expirationTime, @Nonnull Store<EntityStore> store)
      Broadcasts message from origin to nearby NPCs and provided receivers.
      Parameters:
      senderIndex - the sender's builder index for group resolution, or a negative value if none.
      allowGlobal - when groups is null/empty, whether to reach every in-range receiver.