Package wtf.choco.veinminer.platform
Class BukkitServerPlatform
java.lang.Object
wtf.choco.veinminer.platform.BukkitServerPlatform
- All Implemented Interfaces:
ServerPlatform
A Bukkit implementation of
ServerPlatform
.-
Nested Class Summary
Nested classes/interfaces inherited from interface wtf.choco.veinminer.platform.ServerPlatform
ServerPlatform.VeinMinerDetails
-
Method Summary
Modifier and TypeMethodDescriptionGet the string representation of keys of all registered blocks on the server.Get the string representation of keys of all registered items on the server.@Nullable BlockType
getBlockType
(@NotNull String type) Construct a newBlockType
from a string.@NotNull ServerCommandRegistry
Get an instance of theServerCommandRegistry
.@NotNull VeinMinerConfiguration
Get theVeinMinerConfiguration
instance for this server platform.@NotNull ServerEventDispatcher
Get an instance of theServerEventDispatcher
.static BukkitServerPlatform
Get theBukkitServerPlatform
singleton instance.@Nullable ItemType
getItemType
(@NotNull String type) Construct a newItemType
from a string.@NotNull Logger
Get VeinMiner'sLogger
.@NotNull Collection<? extends PlatformPlayer>
Get all online players.@NotNull PlatformPermission
getOrRegisterPermission
(String permission, Supplier<String> description, PlatformPermission.Default permissionDefault) Get thePlatformPermission
with the given name, or register it with the given description and default value if it does not exist.@NotNull PlatformPlayer
getPlatformPlayer
(@NotNull UUID playerUUID) Create aPlatformPlayer
instance for the player with the given UUID.@Nullable BlockState
Construct a newBlockState
from a string.@NotNull UpdateChecker
Get an instance of theUpdateChecker
.@NotNull ServerPlatform.VeinMinerDetails
Get the details of the currently installed VeinMiner plugin.@NotNull File
Get theFile
directory where VeinMiner's files are located.void
runTaskAsynchronously
(@NotNull Runnable runnable) Run the givenRunnable
task asynchronously.void
runTaskLater
(@NotNull Runnable runnable, int ticks) Run the givenRunnable
task the given amount of ticks later.
-
Method Details
-
getVeinMinerDetails
Description copied from interface:ServerPlatform
Get the details of the currently installed VeinMiner plugin.- Specified by:
getVeinMinerDetails
in interfaceServerPlatform
- Returns:
- the vein miner details
-
getVeinMinerPluginDirectory
Description copied from interface:ServerPlatform
Get theFile
directory where VeinMiner's files are located.- Specified by:
getVeinMinerPluginDirectory
in interfaceServerPlatform
- Returns:
- VeinMiner's plugin directory
-
getLogger
Description copied from interface:ServerPlatform
Get VeinMiner'sLogger
.- Specified by:
getLogger
in interfaceServerPlatform
- Returns:
- the logger
-
getConfig
Description copied from interface:ServerPlatform
Get theVeinMinerConfiguration
instance for this server platform.- Specified by:
getConfig
in interfaceServerPlatform
- Returns:
- the config
-
getState
Description copied from interface:ServerPlatform
Construct a newBlockState
from a string.The string passed to this method must be a fully-qualified state understood by Minecraft. For instance,
"minecraft:chest[waterlogged=true,facing=south]"
(excluding the quotation marks). States are entirely optional and a simple block type may be passed as well, in which case the default BlockState will be returned.getState("minecraft:chest[waterlogged=true,facing=south]"); getState("button[powered=false]"); getState("minecraft:air"); getState("torch");
- Specified by:
getState
in interfaceServerPlatform
- Parameters:
state
- the state string from which to create a BlockState- Returns:
- the created BlockState, or null if an invalid string
-
getBlockType
Description copied from interface:ServerPlatform
Construct a newBlockType
from a string.The string passed to this method must be a type of block registered to Minecraft.
getBlockType("minecraft:stone"); getBlockType("diamond_ore");
- Specified by:
getBlockType
in interfaceServerPlatform
- Parameters:
type
- the type string from which to create a BlockType- Returns:
- the created BlockType, or null if an unknown type
-
getItemType
Description copied from interface:ServerPlatform
Construct a newItemType
from a string.The string passed to this method must be a type of item registered to Minecraft.
getBlockType("minecraft:apple"); getBlockType("diamond_ore"); // While it is a block, it also has an item
- Specified by:
getItemType
in interfaceServerPlatform
- Parameters:
type
- the type string from which to create an ItemType- Returns:
- the created ItemType, or null if an unknown type
-
getAllBlockTypeKeys
Description copied from interface:ServerPlatform
Get the string representation of keys of all registered blocks on the server.- Specified by:
getAllBlockTypeKeys
in interfaceServerPlatform
- Returns:
- all block type keys
-
getAllItemTypeKeys
Description copied from interface:ServerPlatform
Get the string representation of keys of all registered items on the server.- Specified by:
getAllItemTypeKeys
in interfaceServerPlatform
- Returns:
- all item type keys
-
getPlatformPlayer
Description copied from interface:ServerPlatform
Create aPlatformPlayer
instance for the player with the given UUID.- Specified by:
getPlatformPlayer
in interfaceServerPlatform
- Parameters:
playerUUID
- the player UUID- Returns:
- the platform player
-
getOnlinePlayers
Description copied from interface:ServerPlatform
Get all online players.- Specified by:
getOnlinePlayers
in interfaceServerPlatform
- Returns:
- all online players
-
getOrRegisterPermission
@NotNull public @NotNull PlatformPermission getOrRegisterPermission(String permission, Supplier<String> description, PlatformPermission.Default permissionDefault) Description copied from interface:ServerPlatform
Get thePlatformPermission
with the given name, or register it with the given description and default value if it does not exist.- Specified by:
getOrRegisterPermission
in interfaceServerPlatform
- Parameters:
permission
- the permission name to get (or register)description
- a description provider if the permission does not exist and needs to be registeredpermissionDefault
- the default permission value- Returns:
- the permission
-
getEventDispatcher
Description copied from interface:ServerPlatform
Get an instance of theServerEventDispatcher
.- Specified by:
getEventDispatcher
in interfaceServerPlatform
- Returns:
- the event dispatcher
-
getCommandRegistry
Description copied from interface:ServerPlatform
Get an instance of theServerCommandRegistry
.- Specified by:
getCommandRegistry
in interfaceServerPlatform
- Returns:
- the command registry
-
getUpdateChecker
Description copied from interface:ServerPlatform
Get an instance of theUpdateChecker
.- Specified by:
getUpdateChecker
in interfaceServerPlatform
- Returns:
- the update checker
-
runTaskLater
Description copied from interface:ServerPlatform
Run the givenRunnable
task the given amount of ticks later.- Specified by:
runTaskLater
in interfaceServerPlatform
- Parameters:
runnable
- the task to runticks
- the amount of time (in ticks) after which to run the task
-
runTaskAsynchronously
Description copied from interface:ServerPlatform
Run the givenRunnable
task asynchronously.- Specified by:
runTaskAsynchronously
in interfaceServerPlatform
- Parameters:
runnable
- the task to run
-
getInstance
Get theBukkitServerPlatform
singleton instance.- Returns:
- the instance
-