Class BlockDataStorage

java.lang.Object
dev.piglin.piglinworldapi.block.BlockDataStorage
All Implemented Interfaces:
org.bukkit.command.CommandExecutor, org.bukkit.command.TabCompleter, org.bukkit.command.TabExecutor

public class BlockDataStorage extends Object implements org.bukkit.command.TabExecutor
  • Constructor Summary

    Constructors
    Constructor
    Description
    BlockDataStorage​(File storage)
    Deprecated.
    Should be refactored to be private or package-private
  • Method Summary

    Modifier and Type
    Method
    Description
    @NotNull List<String>
    getTags​(org.bukkit.block.Block block, org.bukkit.plugin.Plugin plugin)
     
    boolean
    is​(org.bukkit.block.Block block, String tag, org.bukkit.plugin.Plugin plugin)
    Checks if the block contains the tag
    boolean
    onCommand​(@NotNull org.bukkit.command.CommandSender sender, @NotNull org.bukkit.command.Command command, @NotNull String label, String[] args)
     
    onTabComplete​(@NotNull org.bukkit.command.CommandSender sender, @NotNull org.bukkit.command.Command command, @NotNull String alias, String[] args)
     
    void
    save​(File storage)
    Save the block data to the file
    boolean
    set​(org.bukkit.block.Block block, String tag, org.bukkit.plugin.Plugin plugin)
    Sets the tag for the block
    boolean
    unset​(org.bukkit.block.Block block, String tag, org.bukkit.plugin.Plugin plugin)
    Removes the tag from the block

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • BlockDataStorage

      @Deprecated public BlockDataStorage(File storage)
      Deprecated.
      Should be refactored to be private or package-private
      Parameters:
      storage - The file to load data from
  • Method Details

    • is

      public boolean is(org.bukkit.block.Block block, String tag, org.bukkit.plugin.Plugin plugin)
      Checks if the block contains the tag
      Parameters:
      block - The block
      tag - The tag
      plugin - The plugin
      Returns:
      true if the block contains the plugin:tag pair
    • set

      public boolean set(org.bukkit.block.Block block, String tag, org.bukkit.plugin.Plugin plugin)
      Sets the tag for the block
      Parameters:
      block - The block
      tag - The tag
      plugin - The plugin
      Returns:
      true if set successfully, false if already set
    • unset

      public boolean unset(org.bukkit.block.Block block, String tag, org.bukkit.plugin.Plugin plugin)
      Removes the tag from the block
      Parameters:
      block - The block
      tag - The tag
      plugin - The plugin
      Returns:
      true if unset successfully, false if not set
    • getTags

      @NotNull public @NotNull List<String> getTags(org.bukkit.block.Block block, org.bukkit.plugin.Plugin plugin)
      Parameters:
      block - The block
      plugin - The plugin
      Returns:
      List of all your plugin's tags in this block
    • save

      public void save(File storage)
      Save the block data to the file
      Parameters:
      storage - The file to save
    • onCommand

      public boolean onCommand(@NotNull @NotNull org.bukkit.command.CommandSender sender, @NotNull @NotNull org.bukkit.command.Command command, @NotNull @NotNull String label, String[] args)
      Specified by:
      onCommand in interface org.bukkit.command.CommandExecutor
    • onTabComplete

      public List<String> onTabComplete(@NotNull @NotNull org.bukkit.command.CommandSender sender, @NotNull @NotNull org.bukkit.command.Command command, @NotNull @NotNull String alias, String[] args)
      Specified by:
      onTabComplete in interface org.bukkit.command.TabCompleter