Class BukkitServerPlatform

java.lang.Object
wtf.choco.veinminer.platform.BukkitServerPlatform
All Implemented Interfaces:
ServerPlatform

public final class BukkitServerPlatform extends Object implements ServerPlatform
A Bukkit implementation of ServerPlatform.
  • Method Details

    • getVeinMinerDetails

      @NotNull public @NotNull ServerPlatform.VeinMinerDetails getVeinMinerDetails()
      Description copied from interface: ServerPlatform
      Get the details of the currently installed VeinMiner plugin.
      Specified by:
      getVeinMinerDetails in interface ServerPlatform
      Returns:
      the vein miner details
    • getVeinMinerPluginDirectory

      @NotNull public @NotNull File getVeinMinerPluginDirectory()
      Description copied from interface: ServerPlatform
      Get the File directory where VeinMiner's files are located.
      Specified by:
      getVeinMinerPluginDirectory in interface ServerPlatform
      Returns:
      VeinMiner's plugin directory
    • getLogger

      @NotNull public @NotNull Logger getLogger()
      Description copied from interface: ServerPlatform
      Get VeinMiner's Logger.
      Specified by:
      getLogger in interface ServerPlatform
      Returns:
      the logger
    • getConfig

      @NotNull public @NotNull VeinMinerConfiguration getConfig()
      Description copied from interface: ServerPlatform
      Get the VeinMinerConfiguration instance for this server platform.
      Specified by:
      getConfig in interface ServerPlatform
      Returns:
      the config
    • getState

      @Nullable public @Nullable BlockState getState(@NotNull @NotNull String state)
      Description copied from interface: ServerPlatform
      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");
       
      Specified by:
      getState in interface ServerPlatform
      Parameters:
      state - the state string from which to create a BlockState
      Returns:
      the created BlockState, or null if an invalid string
    • getBlockType

      @Nullable public @Nullable BlockType getBlockType(@NotNull @NotNull String type)
      Description copied from interface: ServerPlatform
      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");
       
      Specified by:
      getBlockType in interface ServerPlatform
      Parameters:
      type - the type string from which to create a BlockType
      Returns:
      the created BlockType, or null if an unknown type
    • getItemType

      @Nullable public @Nullable ItemType getItemType(@NotNull @NotNull String type)
      Description copied from interface: ServerPlatform
      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
       
      Specified by:
      getItemType in interface ServerPlatform
      Parameters:
      type - the type string from which to create an ItemType
      Returns:
      the created ItemType, or null if an unknown type
    • getAllBlockTypeKeys

      @NotNull public @NotNull List<String> getAllBlockTypeKeys()
      Description copied from interface: ServerPlatform
      Get the string representation of keys of all registered blocks on the server.
      Specified by:
      getAllBlockTypeKeys in interface ServerPlatform
      Returns:
      all block type keys
    • getAllItemTypeKeys

      @NotNull public @NotNull List<String> getAllItemTypeKeys()
      Description copied from interface: ServerPlatform
      Get the string representation of keys of all registered items on the server.
      Specified by:
      getAllItemTypeKeys in interface ServerPlatform
      Returns:
      all item type keys
    • getPlatformPlayer

      @NotNull public @NotNull PlatformPlayer getPlatformPlayer(@NotNull @NotNull UUID playerUUID)
      Description copied from interface: ServerPlatform
      Create a PlatformPlayer instance for the player with the given UUID.
      Specified by:
      getPlatformPlayer in interface ServerPlatform
      Parameters:
      playerUUID - the player UUID
      Returns:
      the platform player
    • getOnlinePlayers

      @NotNull public @NotNull Collection<? extends PlatformPlayer> getOnlinePlayers()
      Description copied from interface: ServerPlatform
      Get all online players.
      Specified by:
      getOnlinePlayers in interface ServerPlatform
      Returns:
      all online players
    • getOrRegisterPermission

      @NotNull public @NotNull PlatformPermission getOrRegisterPermission(String permission, Supplier<String> description, PlatformPermission.Default permissionDefault)
      Description copied from interface: ServerPlatform
      Get the PlatformPermission with the given name, or register it with the given description and default value if it does not exist.
      Specified by:
      getOrRegisterPermission in interface ServerPlatform
      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 public @NotNull ServerEventDispatcher getEventDispatcher()
      Description copied from interface: ServerPlatform
      Get an instance of the ServerEventDispatcher.
      Specified by:
      getEventDispatcher in interface ServerPlatform
      Returns:
      the event dispatcher
    • getCommandRegistry

      @NotNull public @NotNull ServerCommandRegistry getCommandRegistry()
      Description copied from interface: ServerPlatform
      Get an instance of the ServerCommandRegistry.
      Specified by:
      getCommandRegistry in interface ServerPlatform
      Returns:
      the command registry
    • getUpdateChecker

      @NotNull public @NotNull UpdateChecker getUpdateChecker()
      Description copied from interface: ServerPlatform
      Get an instance of the UpdateChecker.
      Specified by:
      getUpdateChecker in interface ServerPlatform
      Returns:
      the update checker
    • runTaskLater

      public void runTaskLater(@NotNull @NotNull Runnable runnable, int ticks)
      Description copied from interface: ServerPlatform
      Run the given Runnable task the given amount of ticks later.
      Specified by:
      runTaskLater in interface ServerPlatform
      Parameters:
      runnable - the task to run
      ticks - the amount of time (in ticks) after which to run the task
    • runTaskAsynchronously

      public void runTaskAsynchronously(@NotNull @NotNull Runnable runnable)
      Description copied from interface: ServerPlatform
      Run the given Runnable task asynchronously.
      Specified by:
      runTaskAsynchronously in interface ServerPlatform
      Parameters:
      runnable - the task to run
    • getInstance

      public static BukkitServerPlatform getInstance()
      Get the BukkitServerPlatform singleton instance.
      Returns:
      the instance