Class ChunkStorage
java.lang.Object
io.github.addoncommunity.galactifun.util.ChunkStorage
Class that uses
BlockPositions to store boolean tags on blocks. To be used instead of BlockStorage-
Method Summary
Modifier and TypeMethodDescriptionstatic Set<io.github.thebusybiscuit.slimefun5.libraries.dough.blocks.BlockPosition> Gets all blocks in this chunk that have the given tagstatic booleanChecks if a block is taggedstatic booleanChecks if a block is taggedstatic voidsetTagged(Collection<io.github.thebusybiscuit.slimefun5.libraries.dough.blocks.BlockPosition> positions, String tag) Sets the given tag on the given blocks.static voidTag a block with a tagstatic voidTag a block with a tagstatic booleanUntags a block from a tagstatic booleanUntags a block from a tag
-
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 fromtag- 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 ontag- 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 checktag- The tag to check- Returns:
- Whether the block is tagged
-
isTagged
Checks if a block is tagged- Parameters:
block- The block to checktag- 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 tagtag- The tag to tag the block with
-
tag
Tag a block with a tag- Parameters:
block- The block to tagtag- 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 untagtag- The tag to remove the block from- Returns:
- true if the block was untagged, false if it was not tagged
-
untag
Untags a block from a tag- Parameters:
block- The block to untagtag- The tag to remove the block from- Returns:
- true if the block was untagged, false if it was not tagged
-