Class ChunkStorage

java.lang.Object
io.github.addoncommunity.galactifun.util.ChunkStorage

public final class ChunkStorage extends Object
Class that uses BlockPositions to store boolean tags on blocks. To be used instead of BlockStorage
  • Method Summary

    Modifier and Type
    Method
    Description
    static Set<io.github.thebusybiscuit.slimefun5.libraries.dough.blocks.BlockPosition>
    getTagged(org.bukkit.Chunk chunk, String tag)
    Gets all blocks in this chunk that have the given tag
    static boolean
    isTagged(io.github.thebusybiscuit.slimefun5.libraries.dough.blocks.BlockPosition pos, String tag)
    Checks if a block is tagged
    static boolean
    isTagged(org.bukkit.block.Block block, String tag)
    Checks if a block is tagged
    static void
    setTagged(Collection<io.github.thebusybiscuit.slimefun5.libraries.dough.blocks.BlockPosition> positions, String tag)
    Sets the given tag on the given blocks.
    static void
    tag(io.github.thebusybiscuit.slimefun5.libraries.dough.blocks.BlockPosition pos, String tag)
    Tag a block with a tag
    static void
    tag(org.bukkit.block.Block block, String tag)
    Tag a block with a tag
    static boolean
    untag(io.github.thebusybiscuit.slimefun5.libraries.dough.blocks.BlockPosition pos, String tag)
    Untags a block from a tag
    static boolean
    untag(org.bukkit.block.Block block, String tag)
    Untags a block from a tag

    Methods inherited from class Object

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

    • getTagged

      public static Set<io.github.thebusybiscuit.slimefun5.libraries.dough.blocks.BlockPosition> getTagged(@Nonnull org.bukkit.Chunk chunk, @Nonnull String tag)
      Gets all blocks in this chunk that have the given tag
      Parameters:
      chunk - The chunk to get the blocks from
      tag - The tag to get the blocks with
      Returns:
      all blocks in this chunk that have the given tag
    • setTagged

      public static void setTagged(@Nonnull Collection<io.github.thebusybiscuit.slimefun5.libraries.dough.blocks.BlockPosition> positions, @Nonnull String tag)
      Sets the given tag on the given blocks. All blocks not in the chunk of the first block will be ignored. All blocks previously tagged with the given tag will be overwritten.
      Parameters:
      positions - The blocks to set the tag on
      tag - The tag to set
    • isTagged

      public static boolean isTagged(@Nonnull io.github.thebusybiscuit.slimefun5.libraries.dough.blocks.BlockPosition pos, @Nonnull String tag)
      Checks if a block is tagged
      Parameters:
      pos - The block to check
      tag - The tag to check
      Returns:
      Whether the block is tagged
    • isTagged

      public static boolean isTagged(@Nonnull org.bukkit.block.Block block, @Nonnull String tag)
      Checks if a block is tagged
      Parameters:
      block - The block to check
      tag - The tag to check
      Returns:
      Whether the block is tagged
    • tag

      public static void tag(@Nonnull io.github.thebusybiscuit.slimefun5.libraries.dough.blocks.BlockPosition pos, @Nonnull String tag)
      Tag a block with a tag
      Parameters:
      pos - The block to tag
      tag - The tag to tag the block with
    • tag

      public static void tag(@Nonnull org.bukkit.block.Block block, @Nonnull String tag)
      Tag a block with a tag
      Parameters:
      block - The block to tag
      tag - The tag to tag the block with
    • untag

      public static boolean untag(@Nonnull io.github.thebusybiscuit.slimefun5.libraries.dough.blocks.BlockPosition pos, @Nonnull String tag)
      Untags a block from a tag
      Parameters:
      pos - The block to untag
      tag - The tag to remove the block from
      Returns:
      true if the block was untagged, false if it was not tagged
    • untag

      public static boolean untag(@Nonnull org.bukkit.block.Block block, @Nonnull String tag)
      Untags a block from a tag
      Parameters:
      block - The block to untag
      tag - The tag to remove the block from
      Returns:
      true if the block was untagged, false if it was not tagged