java.lang.Object
io.github.thebusybiscuit.slimefun4.core.attributes.interactions.InteractionResult
Direct Known Subclasses:
ItemInteractionResult

public class InteractionResult extends Object
This class represents the result of an interaction on an ExternallyInteractable item.
  • Constructor Details

    • InteractionResult

      @ParametersAreNonnullByDefault public InteractionResult(boolean successful)
      Creates a new InteractionResult.
      Parameters:
      successful - Whether the interaction was successful or not.
  • Method Details

    • isInteractionSuccessful

      public boolean isInteractionSuccessful()
      Returns whether the interaction was successful or not.
      Returns:
      boolean denoting whether the interaction was successful or not.
    • setResultMessage

      public void setResultMessage(@Nullable String resultMessage)
      Sets a custom result message for this interaction.
      Parameters:
      resultMessage - The message to be sent with the Result
    • hasResultMessage

      public boolean hasResultMessage()
      Returns whether this result has a result message or is null.
      Returns:
      true if a result message is present
    • getResultMessage

      @Nullable public String getResultMessage()
      Returns the custom result message for this result or null if not set.
      Returns:
      A String of the provided custom result message.