Class IllegalStackScanner
java.lang.Object
fr.andross.banitem.utils.scanners.illegalstack.IllegalStackScanner
A simple async scanner to check if players has illegal stacks into their inventories
- Version:
- 3.4
- Author:
- Andross
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionGet the default block type for items This can be null if an invalid block type is set from configMap<org.bukkit.Material,
IllegalStackItemConfig> getItems()
Get the map of illegal stacks configuration loaded from configint
Get the scanner Bukkit Task id, -1 if not runningboolean
Check if the scanner is runningboolean
Check if the scanner should be enabled (in config)boolean
Check if the vanilla max stack size is enabledvoid
Load the configuration file and enable (if configured) the illegal stack scannervoid
setDefaultBlockType
(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 anythingvoid
setEnabled
(boolean enabled) Enable or disable the scannervoid
setEnabledInConfig
(boolean enabledInConfig) Set the variable.void
setVanillaMaxStackSize
(boolean vanillaMaxStackSize) Set the vanilla max stack size state This does not edit the config file
-
Constructor Details
-
IllegalStackScanner
-
-
Method Details
-
load
Load the configuration file and enable (if configured) the illegal stack scanner- Parameters:
sender
- the executorconfig
- 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
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
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
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
-