Interface Contextual

    • Method Detail

      • identifier

        java.lang.String identifier()
        Returns the identifier associated with this Contextual.

        The identifier of each distinct Contextual within a collection of contextuals should be unique.

        Not guaranteed to be human-readable. Use friendlyIdentifier() for a more readable alternative.

        Returns:
        The identifier for this subject
      • friendlyIdentifier

        default java.util.Optional<java.lang.String> friendlyIdentifier()
        Returns the friendly identifier associated with this Contextual.

        Unlike identifier(), this value is not guaranteed to be unique.

        If the friendly identifier is equal to the normal identifier, this method should return Optional.empty().

        Contextuals which represent a ServerPlayer or a User should return the username here, if available.

        Returns:
        The friendly identifier for this contextual
      • contextCause

        default Cause contextCause()
        Get the cause describing the current state of this subject.

        This is often not based on current game state, but rather the last known state of this subject. If a subject refers to a game object that is not active in the world, the cause may be a global cause.

        Returns:
        the active cause