Package wtf.choco.veinminer.manager
Class VeinMinerManager
java.lang.Object
wtf.choco.veinminer.manager.VeinMinerManager
A manager for VeinMiner's general configurable values.
-
Constructor Summary
ConstructorDescriptionVeinMinerManager
(@NotNull VeinMinerServer veinMiner) Construct a newVeinMinerManager
. -
Method Summary
Modifier and TypeMethodDescriptionboolean
Add a new aliasBlockList
.void
clear()
Clear values stored in thisVeinMinerManager
(excluding thegetGlobalConfig()
).@Nullable BlockList
getAlias
(@NotNull VeinMinerBlock block) Get an aliasBlockList
that contains the givenVeinMinerBlock
.@NotNull BlockList
Get aBlockList
of allVeinMinerBlocks
vein mineable in any category.@NotNull BlockList
Get the globalBlockList
.@NotNull VeinMiningConfig
Get the globalVeinMiningConfig
.@Nullable VeinMinerBlock
getVeinMinerBlock
(@NotNull BlockState state, @NotNull VeinMinerToolCategory category) Get theVeinMinerBlock
instance from the providedVeinMinerToolCategory
'sBlockList
that matches the givenBlockState
.boolean
isDisabledGameMode
(@NotNull GameMode gameMode) Check whether or not the givenGameMode
is disabled.boolean
isVeinMineable
(@NotNull BlockState state) Check whether or not the givenBlockState
can be destroyed using vein miner with any category.boolean
isVeinMineable
(@NotNull BlockState state, @NotNull VeinMinerToolCategory category) Check whether or not the givenBlockState
can be destroyed using vein miner under the givenVeinMinerToolCategory
.boolean
isVeinMineable
(@NotNull BlockType type) Check whether or not the givenBlockType
can be destroyed using vein miner with any category.boolean
isVeinMineable
(@NotNull BlockType type, @NotNull VeinMinerToolCategory category) Check whether or not the givenBlockType
can be destroyed using vein miner under the givenVeinMinerToolCategory
.boolean
removeAlias
(@NotNull BlockList blockList) Remove an aliasBlockList
.@Nullable BlockList
removeAliasContaining
(@NotNull VeinMinerBlock block) Remove an alias that contains the givenVeinMinerBlock
.void
setDisabledGameModes
(@NotNull Collection<GameMode> gameModes) Set the disabledGameModes
.void
setGlobalBlockList
(@NotNull BlockList blockList) Set the globalBlockList
.void
setGlobalConfig
(@NotNull VeinMiningConfig config) Set the globalVeinMiningConfig
.
-
Constructor Details
-
VeinMinerManager
Construct a newVeinMinerManager
.- Parameters:
veinMiner
- the vein miner server instance
-
-
Method Details
-
setGlobalBlockList
Set the globalBlockList
.Values in this BlockList should be breakable by all categories.
- Parameters:
blockList
- the block list to set
-
getGlobalBlockList
Get the globalBlockList
.Values in this BlockList should be breakable by all categories.
- Returns:
- the global block list
-
setGlobalConfig
Set the globalVeinMiningConfig
.Values in this config should be used as the default unless otherwise specified.
- Parameters:
config
- the config to set
-
getGlobalConfig
Get the globalVeinMiningConfig
.Values in this config should be used as the default unless otherwise specified.
- Returns:
- the global config
-
isDisabledGameMode
Check whether or not the givenGameMode
is disabled.- Parameters:
gameMode
- the game mode to check- Returns:
- true if disabled, false otherwise
-
setDisabledGameModes
Set the disabledGameModes
.- Parameters:
gameModes
- the game modes to disable
-
getDisabledGameModes
- Returns:
- all disabled game modes
-
getAllVeinMineableBlocks
Get aBlockList
of allVeinMinerBlocks
vein mineable in any category.- Returns:
- a BlockList containing the blocks of all categories and the global BlockList
-
isVeinMineable
public boolean isVeinMineable(@NotNull @NotNull BlockState state, @NotNull @NotNull VeinMinerToolCategory category) Check whether or not the givenBlockState
can be destroyed using vein miner under the givenVeinMinerToolCategory
.Convenience method to check both the category's
BlockList
, as well asthe global BlockList
.- Parameters:
state
- the state to checkcategory
- the category to check- Returns:
- true if the state is vein mineable, false otherwise
-
isVeinMineable
public boolean isVeinMineable(@NotNull @NotNull BlockType type, @NotNull @NotNull VeinMinerToolCategory category) Check whether or not the givenBlockType
can be destroyed using vein miner under the givenVeinMinerToolCategory
.Convenience method to check both the category's
BlockList
, as well asthe global BlockList
.- Parameters:
type
- the type to checkcategory
- the category to check- Returns:
- true if the type is vein mineable, false otherwise
-
isVeinMineable
Check whether or not the givenBlockState
can be destroyed using vein miner with any category.Convenience method to check all
BlockLists
, includingthe global BlockList
.- Parameters:
state
- the state to check- Returns:
- true if the state is vein mineable, false otherwise
-
isVeinMineable
Check whether or not the givenBlockType
can be destroyed using vein miner with any category.Convenience method to check all
BlockLists
, includingthe global BlockList
.- Parameters:
type
- the type to check- Returns:
- true if the type is vein mineable, false otherwise
-
getVeinMinerBlock
@Nullable public @Nullable VeinMinerBlock getVeinMinerBlock(@NotNull @NotNull BlockState state, @NotNull @NotNull VeinMinerToolCategory category) Get theVeinMinerBlock
instance from the providedVeinMinerToolCategory
'sBlockList
that matches the givenBlockState
.- Parameters:
state
- the state whose matching VeinMinerBlock instance to getcategory
- the category whose BlockList from which the instance should be fetched- Returns:
- the matching VeinMinerBlock, or null if none exists
-
addAlias
Add a new aliasBlockList
.- Parameters:
blockList
- the list of blocks in this alias- Returns:
- true if the alias was added, false if it was already added
-
removeAlias
Remove an aliasBlockList
.- Parameters:
blockList
- the alias block list to remove- Returns:
- true if the alias was removed, false if it was not already added
-
removeAliasContaining
Remove an alias that contains the givenVeinMinerBlock
.- Parameters:
block
- the block- Returns:
- the removed alias block list, or null if none contained the block
-
getAlias
Get an aliasBlockList
that contains the givenVeinMinerBlock
.- Parameters:
block
- the block- Returns:
- the alias block list to which the block belongs
-
clear
public void clear()Clear values stored in thisVeinMinerManager
(excluding thegetGlobalConfig()
).
-