Contents
Class BeaconBroadcast
java.lang.Object
com.hypixel.hytale.server.npc.components.messaging.BeaconBroadcast
Shared beacon-broadcast API.
-
Method Summary
Modifier and TypeMethodDescriptionstatic voidbroadcast(org.joml.Vector3d origin, double range, String message, Ref<EntityStore> target, int senderIndex, int[] groups, boolean allowGlobal, double expirationTime, Store<EntityStore> store) Broadcastsmessagefromoriginto nearby NPCs and provided receivers.static voidcollectProvidedReceivers(org.joml.Vector3d origin, double range, Store<EntityStore> store, List<Ref<EntityStore>> out) Appends non-NPC beacon receivers (e.g. encounter managers) withinrangeoforigintoout, via every registeredBeaconReceiverProvider.static voidpost(Ref<EntityStore> candidate, String message, Ref<EntityStore> target, double expirationTime, ComponentAccessor<EntityStore> accessor) static booleanshouldReceive(int senderIndex, Ref<EntityStore> candidate, int[] groups, boolean allowGlobal, ComponentAccessor<EntityStore> accessor) Whethercandidateshould receive a beacon: it must hold aBeaconSupportmailbox and pass the group filter.
-
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) withinrangeoforigintoout, via every registeredBeaconReceiverProvider. -
shouldReceive
public static boolean shouldReceive(int senderIndex, @Nonnull Ref<EntityStore> candidate, @Nullable int[] groups, boolean allowGlobal, @Nonnull ComponentAccessor<EntityStore> accessor) Whethercandidateshould receive a beacon: it must hold aBeaconSupportmailbox and pass the group filter. A null/emptygroupsmeans everyone whenallowGlobaland nobody otherwise. -
post
public static void post(@Nonnull Ref<EntityStore> candidate, @Nonnull String message, @Nonnull Ref<EntityStore> target, double expirationTime, @Nonnull ComponentAccessor<EntityStore> accessor) Postsmessageintocandidate'sBeaconSupportmailbox. Only lands if the receiver hasmessagemapped 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) Broadcastsmessagefromoriginto nearby NPCs and provided receivers.- Parameters:
senderIndex- the sender's builder index for group resolution, or a negative value if none.allowGlobal- whengroupsis null/empty, whether to reach every in-range receiver.
-