Class TeleportsService


  • @Singleton
    public class TeleportsService
    extends java.lang.Object
    Registry and fail-closed invoker for built-in TeleportDefinitions.

    Dispatch always goes through the owning service (Inventory / Equipment / Magic), which validate actions against live widget state. This service adds only availability + magic-level gates; it never invents component tuples.

    Semantics:

    • canInvoke(TeleportDefinition) is a pure readback check.
    • invoke(TeleportDefinition) submits a command. Returning normally means "dispatch accepted or queued by the owning service", NOT that the player arrived anywhere.
    • "Rub"-style items open a destination dialog on a later tick. After invoking such a definition, call resolveDialogueChoice() from subsequent ticks until it returns true. It never blocks or sleeps.
    • arrivedAt(TeleportDefinition) compares the live player position with the definition's verified landing area; definitions with dynamic destinations (POH/home) always report false.
    • Method Detail

      • advanceOperations

        public void advanceOperations()
      • cancelSession

        public void cancelSession()
      • all

        public java.util.List<TeleportDefinition> all()
        All built-in verified definitions (spells, tablets, jewellery both modes).
      • find

        public java.util.List<TeleportDefinition> find​(java.lang.String namePart)
        Definitions whose name contains the given text, case-insensitive.
      • canInvoke

        public boolean canInvoke​(TeleportDefinition def)
        Availability readback: item present in inventory / worn in slot / spell widget visible, plus magic-level gate when the definition has one.
      • resolveDialogueChoice

        public boolean resolveDialogueChoice()
        Legacy polling adapter: true only on the call observing a newly submitted choice.
      • lastOperation

        public TeleportOperation lastOperation()
        Last operation remains available after cancellation/failure for diagnostics.
      • clearPendingChoice

        public void clearPendingChoice()
      • arrivedAt

        public boolean arrivedAt​(TeleportDefinition def)
        Observed-state arrival check against the definition's verified landing area (Chebyshev distance within arrivalRadius). Always false for dynamic destinations — we do not pretend to know where a POH is.