Class IllegalStackScanner

java.lang.Object
fr.andross.banitem.utils.scanners.illegalstack.IllegalStackScanner

public final class IllegalStackScanner extends Object
A simple async scanner to check if players has illegal stacks into their inventories
Version:
3.4
Author:
Andross
  • Constructor Details

    • IllegalStackScanner

      public IllegalStackScanner(@NotNull BanItem pl, @NotNull BanUtils utils)
  • Method Details

    • load

      public void load(@NotNull org.bukkit.command.CommandSender sender, @NotNull BanConfig config)
      Load the configuration file and enable (if configured) the illegal stack scanner
      Parameters:
      sender - the executor
      config - the configuration file
    • isEnabled

      public boolean isEnabled()
      Check if the scanner is running
      Returns:
      true if the scanner is running, otherwise false
    • setEnabled

      public void setEnabled(boolean enabled)
      Enable or disable the scanner
      Parameters:
      enabled - the enabled state
    • isEnabledInConfig

      public boolean isEnabledInConfig()
      Check if the scanner should be enabled (in config)
      Returns:
      if the scanner should be enabled (in config)
    • setEnabledInConfig

      public void setEnabledInConfig(boolean enabledInConfig)
      Set the variable. This does not edit the config file.
      Parameters:
      enabledInConfig - set the variable
    • getTaskId

      public int getTaskId()
      Get the scanner Bukkit Task id, -1 if not running
      Returns:
      the scanner Bukkit Task id, -1 if not running
    • getItems

      @NotNull public Map<org.bukkit.Material,IllegalStackItemConfig> getItems()
      Get the map of illegal stacks configuration loaded from config
      Returns:
      the map of illegal stacks configuration loaded from config
    • isVanillaMaxStackSize

      public boolean isVanillaMaxStackSize()
      Check if the vanilla max stack size is enabled
      Returns:
      true if the vanilla max stack size is enabled, otherwise false
    • setVanillaMaxStackSize

      public void setVanillaMaxStackSize(boolean vanillaMaxStackSize)
      Set the vanilla max stack size state This does not edit the config file
      Parameters:
      vanillaMaxStackSize - the vanilla max stack size state
    • getDefaultBlockType

      @Nullable public IllegalStackBlockType getDefaultBlockType()
      Get the default block type for items This can be null if an invalid block type is set from config
      Returns:
      the default block type for items
    • setDefaultBlockType

      public void setDefaultBlockType(@Nullable IllegalStackBlockType defaultBlockType)
      Set the default block type for items Setting the parameter to null is not recommended because it will keep the task running but will not block anything
      Parameters:
      defaultBlockType - the default block type wanted