Class HasNotPermissionFunction

java.lang.Object
io.github.toberocat.guiengine.function.compute.HasNotPermissionFunction
All Implemented Interfaces:
ComputeFunction

public class HasNotPermissionFunction extends Object implements ComputeFunction
Custom compute function to check if a player does not have a specific permission.

Created: 14.07.2023 Author: Tobias Madlberger (Tobias)

  • Constructor Details

    • HasNotPermissionFunction

      public HasNotPermissionFunction()
  • Method Details

    • compute

      @NotNull public @NotNull String compute(@NotNull @NotNull GuiEngineApi api, @NotNull @NotNull GuiContext context, @NotNull @NotNull String value)
      Computes the result of the permission check using the provided API and context.
      Specified by:
      compute in interface ComputeFunction
      Parameters:
      api - The `GuiEngineApi` instance used to interact with the GUI engine.
      context - The `GuiContext` instance representing the GUI context for which the computation is performed.
      value - The input value containing the permission node to check.
      Returns:
      A string representation of the result with the permission check. `True` if the player does not have the specified permission, `false` otherwise.
    • checkForFunction

      public boolean checkForFunction(@NotNull @NotNull String value)
      Checks if the provided value contains the function to check for the absence of a permission.
      Specified by:
      checkForFunction in interface ComputeFunction
      Parameters:
      value - The input value to check for the function.
      Returns:
      `true` if the function is present in the value, `false` otherwise.