Package dev.piglin.piglinworldapi.block
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
-
Constructor Summary
ConstructorsConstructorDescriptionBlockDataStorage(File storage)Deprecated.Should be refactored to be private or package-private -
Method Summary
Modifier and TypeMethodDescriptiongetTags(org.bukkit.block.Block block, org.bukkit.plugin.Plugin plugin)booleanChecks if the block contains the tagbooleanonCommand(@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)voidSave the block data to the filebooleanSets the tag for the blockbooleanRemoves the tag from the block
-
Constructor Details
-
BlockDataStorage
Deprecated.Should be refactored to be private or package-private- Parameters:
storage- The file to load data from
-
-
Method Details
-
is
Checks if the block contains the tag- Parameters:
block- The blocktag- The tagplugin- The plugin- Returns:
- true if the block contains the plugin:tag pair
-
set
Sets the tag for the block- Parameters:
block- The blocktag- The tagplugin- The plugin- Returns:
- true if set successfully, false if already set
-
unset
Removes the tag from the block- Parameters:
block- The blocktag- The tagplugin- 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 blockplugin- The plugin- Returns:
- List of all your plugin's tags in this block
-
save
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:
onCommandin interfaceorg.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:
onTabCompletein interfaceorg.bukkit.command.TabCompleter
-