Interface ServerPlatform

All Known Implementing Classes:
BukkitServerPlatform

public interface ServerPlatform
A bridge interface for various implementing platforms.
  • Method Details

    • getVeinMinerDetails

      @NotNull @NotNull ServerPlatform.VeinMinerDetails getVeinMinerDetails()
      Get the details of the currently installed VeinMiner plugin.
      Returns:
      the vein miner details
    • getVeinMinerPluginDirectory

      @NotNull @NotNull File getVeinMinerPluginDirectory()
      Get the File directory where VeinMiner's files are located.
      Returns:
      VeinMiner's plugin directory
    • getLogger

      @NotNull @NotNull Logger getLogger()
      Get VeinMiner's Logger.
      Returns:
      the logger
    • getConfig

      @NotNull @NotNull VeinMinerConfiguration getConfig()
      Get the VeinMinerConfiguration instance for this server platform.
      Returns:
      the config
    • getState

      @Nullable @Nullable BlockState getState(@NotNull @NotNull String state)
      Construct a new BlockState 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");
       
      Parameters:
      state - the state string from which to create a BlockState
      Returns:
      the created BlockState, or null if an invalid string
    • getBlockType

      @Nullable @Nullable BlockType getBlockType(@NotNull @NotNull String type)
      Construct a new BlockType from a string.

      The string passed to this method must be a type of block registered to Minecraft.

       getBlockType("minecraft:stone");
       getBlockType("diamond_ore");
       
      Parameters:
      type - the type string from which to create a BlockType
      Returns:
      the created BlockType, or null if an unknown type
    • getItemType

      @Nullable @Nullable ItemType getItemType(@NotNull @NotNull String type)
      Construct a new ItemType 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
       
      Parameters:
      type - the type string from which to create an ItemType
      Returns:
      the created ItemType, or null if an unknown type
    • getAllBlockTypeKeys

      @NotNull @NotNull List<String> getAllBlockTypeKeys()
      Get the string representation of keys of all registered blocks on the server.
      Returns:
      all block type keys
    • getAllItemTypeKeys

      @NotNull @NotNull List<String> getAllItemTypeKeys()
      Get the string representation of keys of all registered items on the server.
      Returns:
      all item type keys
    • getPlatformPlayer

      @NotNull @NotNull PlatformPlayer getPlatformPlayer(@NotNull @NotNull UUID playerUUID)
      Create a PlatformPlayer instance for the player with the given UUID.
      Parameters:
      playerUUID - the player UUID
      Returns:
      the platform player
    • getOnlinePlayers

      @NotNull @NotNull Collection<? extends PlatformPlayer> getOnlinePlayers()
      Get all online players.
      Returns:
      all online players
    • getOrRegisterPermission

      @NotNull @NotNull PlatformPermission getOrRegisterPermission(String permission, Supplier<String> description, PlatformPermission.Default permissionDefault)
      Get the PlatformPermission with the given name, or register it with the given description and default value if it does not exist.
      Parameters:
      permission - the permission name to get (or register)
      description - a description provider if the permission does not exist and needs to be registered
      permissionDefault - the default permission value
      Returns:
      the permission
    • getEventDispatcher

      @NotNull @NotNull ServerEventDispatcher getEventDispatcher()
      Get an instance of the ServerEventDispatcher.
      Returns:
      the event dispatcher
    • getCommandRegistry

      @NotNull @NotNull ServerCommandRegistry getCommandRegistry()
      Get an instance of the ServerCommandRegistry.
      Returns:
      the command registry
    • getUpdateChecker

      @NotNull @NotNull UpdateChecker getUpdateChecker()
      Get an instance of the UpdateChecker.
      Returns:
      the update checker
    • runTaskLater

      void runTaskLater(@NotNull @NotNull Runnable runnable, int ticks)
      Run the given Runnable task the given amount of ticks later.
      Parameters:
      runnable - the task to run
      ticks - the amount of time (in ticks) after which to run the task
    • runTaskAsynchronously

      void runTaskAsynchronously(@NotNull @NotNull Runnable runnable)
      Run the given Runnable task asynchronously.
      Parameters:
      runnable - the task to run