Class MiddlewareCallbackInfo

java.lang.Object
de.craftsblock.craftsnet.api.middlewares.MiddlewareCallbackInfo

public class MiddlewareCallbackInfo extends Object
The MiddlewareCallbackInfo is used to pass information between the different middlewares. It can further more also affect the further behaviour of the invoker after the invocation of the middlewares.
Since:
3.4.0-SNAPSHOT
  • Constructor Details

    • MiddlewareCallbackInfo

      public MiddlewareCallbackInfo()
  • Method Details

    • setCancelled

      public void setCancelled(boolean cancelled)
      Sets the cancelled flag for the callback, indicating whether the callback is cancelled or not.
      Parameters:
      cancelled - true to cancel the callback, false to allow processing.
    • isCancelled

      public boolean isCancelled()
      Checks if the callback has been cancelled.
      Returns:
      true if the callback is cancelled, false otherwise.
    • setCancelReason

      public void setCancelReason(String cancelReason)
      Sets a custom cancel reason which is printed to the console
      Parameters:
      cancelReason - The cancel reason which is printed to the console
    • getCancelReason

      public String getCancelReason()
      Gets the custom cancel reason which was set by one of the listeners.
      Returns:
      The cancel reason
    • hasCancelReason

      public boolean hasCancelReason()
      Checks and returns whether a custom cancel reason was set by one of the listeners.
      Returns:
      true if a custom cancel reason was set, false otherwise.