Package wtf.choco.veinminer
Class VeinMinerServer
java.lang.Object
wtf.choco.veinminer.VeinMinerServer
- All Implemented Interfaces:
VeinMiner
A class holding VeinMiner's core common functionality.
-
Field Summary
Fields inherited from interface wtf.choco.veinminer.VeinMiner
PATTERN_BLOCK_STATE, PROTOCOL, PROTOCOL_CHANNEL, PROTOCOL_LEGACY, PROTOCOL_VERSION
-
Method Summary
Modifier and TypeMethodDescription@NotNull ClientConfig
createClientConfig
(@NotNull PlatformPlayer player) Create aVeinMiningConfig
with values supplied by the plugin's config.@NotNull ActivationStrategy
Get the defaultActivationStrategy
to use for players that have not explicitly set one.@NotNull VeinMiningPattern
Get the defaultVeinMiningPattern
to use for players that have not explicitly set one.@NotNull SimpleEconomy
Get theSimpleEconomy
.static @NotNull VeinMinerServer
Get theVeinMinerServer
instance.@NotNull PatternRegistry
Get thePatternRegistry
.@NotNull PersistentDataStorage
Get thePersistentDataStorage
for the server.@NotNull ServerPlatform
Get theServerPlatform
instance.@NotNull VeinMinerPlayerManager
Get theVeinMinerPlayerManager
.@NotNull ToolCategoryRegistry
Get theToolCategoryRegistry
.@NotNull VeinMinerManager
Get theVeinMinerManager
.@NotNull String
Get the version of VeinMiner (not to be confused with the protocol version).boolean
isServer()
Check whether or not VeinMiner is running on the server.void
Called when the server plugin disables.void
onEnable()
Called when the server plugin enables.void
onLoad
(@NotNull ServerPlatform platform) Called when the server plugin loads.void
Reload theToolCategoryRegistry
's values from config into memory.void
Reload theVeinMinerManager
's values from config into memory.void
setDefaultActivationStrategy
(@NotNull ActivationStrategy activationStrategy) Set the defaultActivationStrategy
to use for players that have not explicitly set one.void
setDefaultVeinMiningPattern
(@NotNull VeinMiningPattern pattern) Set the defaultVeinMiningPattern
to use for players that have not explicitly set one.void
setEconomy
(@NotNull SimpleEconomy economy) Set theSimpleEconomy
implementation.void
setPersistentDataStorage
(@NotNull PersistentDataStorage persistentDataStorage) Set thePersistentDataStorage
for the server.
-
Method Details
-
onLoad
Called when the server plugin loads.- Parameters:
platform
- the server platform implementation to set
-
onEnable
public void onEnable()Called when the server plugin enables. -
onDisable
public void onDisable()Called when the server plugin disables. -
setDefaultActivationStrategy
Set the defaultActivationStrategy
to use for players that have not explicitly set one.- Parameters:
activationStrategy
- the activation strategy to set
-
getDefaultActivationStrategy
Get the defaultActivationStrategy
to use for players that have not explicitly set one.- Returns:
- the default activation strategy
-
setDefaultVeinMiningPattern
Set the defaultVeinMiningPattern
to use for players that have not explicitly set one.- Parameters:
pattern
- the pattern to set
-
getDefaultVeinMiningPattern
Get the defaultVeinMiningPattern
to use for players that have not explicitly set one.- Returns:
- the default pattern
-
getVeinMinerManager
Get theVeinMinerManager
.- Returns:
- the vein miner manager
-
getPlayerManager
Get theVeinMinerPlayerManager
.- Returns:
- the player manager
-
getToolCategoryRegistry
Get theToolCategoryRegistry
.- Returns:
- the tool category registry
-
getPatternRegistry
Get thePatternRegistry
.- Returns:
- the pattern registry
-
setPersistentDataStorage
Set thePersistentDataStorage
for the server.- Parameters:
persistentDataStorage
- the persistent data storage to set
-
getPersistentDataStorage
Get thePersistentDataStorage
for the server.- Returns:
- the persistent data storage
-
setEconomy
Set theSimpleEconomy
implementation.- Parameters:
economy
- the economy
-
getEconomy
Get theSimpleEconomy
.- Returns:
- the economy
-
getPlatform
Get theServerPlatform
instance.- Returns:
- the platform instance
-
getVersion
Description copied from interface:VeinMiner
Get the version of VeinMiner (not to be confused with the protocol version).- Specified by:
getVersion
in interfaceVeinMiner
- Returns:
- the version
-
isServer
public boolean isServer()Description copied from interface:VeinMiner
Check whether or not VeinMiner is running on the server. -
createClientConfig
Create aVeinMiningConfig
with values supplied by the plugin's config.- Parameters:
player
- the player for whom to create the config- Returns:
- the default client config
-
reloadVeinMinerManagerConfig
public void reloadVeinMinerManagerConfig()Reload theVeinMinerManager
's values from config into memory. -
reloadToolCategoryRegistryConfig
public void reloadToolCategoryRegistryConfig()Reload theToolCategoryRegistry
's values from config into memory. -
getInstance
Get theVeinMinerServer
instance.- Returns:
- the vein miner instance
-