Class SignalNearbyVolumesInteraction

All Implemented Interfaces:
JsonAsset<String>, JsonAssetWithMap<String, IndexedLookupTableAssetMap<String, Interaction>>, NetworkSerializable<Interaction>, Operation

public class SignalNearbyVolumesInteraction extends SimpleInstantInteraction
A simple instant interaction that sends a SignalReceived event to nearby trigger volumes, so a tool or key-bound interaction can drive volumes that listen for signals. Targets are the volumes within Radius of the origin; when MatchKey is set they are further filtered to volumes carrying that tag, otherwise every volume in range is signalled.

The origin is the Interaction.HIT_LOCATION when present, otherwise the instigating entity's position (unless RequireHitLocation is set, in which case the interaction does nothing without a hit). The signal carries the index-aligned SignalKeys / SignalValues tags, which a receiving volume can match with a Tag condition on Signal Received.

  • Field Details

  • Constructor Details

    • SignalNearbyVolumesInteraction

      public SignalNearbyVolumesInteraction()
  • Method Details

    • needsRemoteSync

      public boolean needsRemoteSync()
      Description copied from class: Interaction
      Returns whether this interaction must be synced to any remote clients in order to function correctly. Ignored when the interaction is running without a client.

      This method is used as an optimization when the interactions are being run by a manager with a remote client. If all interactions in a chain don't require a client in order to function (if this method returns false for all interactions in the chain) then we can skip executing/syncing the chain to the client and instead run the chain completely server-side instead.

      This method has no effect on interaction managers that run without a remote attached. It may also be ignored in some cases as this method only functions as a hint.

      If Operation.getWaitForDataFrom() returns WaitForDataFrom.Client then this must return true.

      Overrides:
      needsRemoteSync in class SimpleInteraction
      Returns:
      whether this interaction requires being synced to remote clients in order to function correctly for them.
    • toString

      @Nonnull public String toString()
      Overrides:
      toString in class SimpleInstantInteraction