Class OperationOwner

  • All Implemented Interfaces:
    java.lang.AutoCloseable

    public final class OperationOwner
    extends java.lang.Object
    implements java.lang.AutoCloseable
    One plugin run or explicitly managed script lifetime. Closing it forbids new actions.
    • Constructor Detail

      • OperationOwner

        public OperationOwner()
    • Method Detail

      • getId

        public long getId()
      • isActive

        public boolean isActive()
      • onCancel

        public java.lang.Runnable onCancel​(java.lang.Runnable cancellation)
        Registers cleanup only; listeners must not send game actions. Returns listener removal.
      • whileActive

        public <T> T whileActive​(java.util.function.Supplier<T> step,
                                 T cancelled)
        Linearizes a complete client-thread step against owner shutdown.
      • close

        public void close()
        Specified by:
        close in interface java.lang.AutoCloseable