Package wtf.choco.veinminer.config
Class VeinMiningConfig
java.lang.Object
wtf.choco.veinminer.config.VeinMiningConfig
- All Implemented Interfaces:
Cloneable
Represents VeinMiner's configuration for vein mining operations.
-
Nested Class Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic VeinMiningConfig.Builder
builder()
Get a new builder for aVeinMiningConfig
.@NotNull VeinMiningConfig
clone()
@NotNull VeinMiningConfig
edit
(@NotNull Consumer<VeinMiningConfig.Builder> editor) Edit thisVeinMiningConfig
with the givenConsumer
and return a new instance of the config with all edited values.boolean
double
getCost()
Get the cost of using VeinMiner.Get an unmodifiableSet
of all disabled worlds.int
Get the maximum vein size.int
hashCode()
boolean
isDisabledWorld
(@NotNull String worldName) Check whether or not the world with the given (case-sensitive) name is disabled.boolean
Check whether or not repair friendly is enabled.
-
Constructor Details
-
VeinMiningConfig
public VeinMiningConfig()Construct a new defaultVeinMiningConfig
.- See Also:
-
-
Method Details
-
isRepairFriendly
public boolean isRepairFriendly()Check whether or not repair friendly is enabled.If
true
, VeinMiner will stop breaking blocks when a tool reaches 1 durability as to avoid breaking it.- Returns:
- true if repair friendly, false otherwise
-
getMaxVeinSize
public int getMaxVeinSize()Get the maximum vein size.The returned integer is the maximum amount of blocks VeinMiner will mine for any given vein of blocks.
- Returns:
- the maximum vein size
-
getCost
public double getCost()Get the cost of using VeinMiner.The returned double is the amount of money that will be taken from the player if an economy is installed on the server.
- Returns:
- the cost
-
isDisabledWorld
Check whether or not the world with the given (case-sensitive) name is disabled.Disabled worlds will disallow VeinMiner from being used at all.
- Parameters:
worldName
- the name of the world to check- Returns:
- true if disabled, false otherwise
-
getDisabledWorlds
Get an unmodifiableSet
of all disabled worlds.- Returns:
- all disabled world names
-
edit
@NotNull public @NotNull VeinMiningConfig edit(@NotNull @NotNull Consumer<VeinMiningConfig.Builder> editor) Edit thisVeinMiningConfig
with the givenConsumer
and return a new instance of the config with all edited values. This operation is immutable and will not modify this instance of the config.- Parameters:
editor
- the editor- Returns:
- the newly edited VeinMinerConfig instance
-
builder
Get a new builder for aVeinMiningConfig
.- Returns:
- a builder
- See Also:
-
clone
-
hashCode
public int hashCode() -
equals
-