From 36369a3de4b3fae0ea5c05fa214a614193a7fe0b Mon Sep 17 00:00:00 2001 From: unurled Date: Sat, 27 Apr 2024 20:55:11 +0200 Subject: [PATCH] Javadoc for ClientBuild.Java --- .../components/clientbuild/ClientBuild.java | 35 +++++++++++++++++++ 1 file changed, 35 insertions(+) diff --git a/src/main/java/me/unurled/sacredrealms/sr/components/clientbuild/ClientBuild.java b/src/main/java/me/unurled/sacredrealms/sr/components/clientbuild/ClientBuild.java index 1281e3f..72d42af 100644 --- a/src/main/java/me/unurled/sacredrealms/sr/components/clientbuild/ClientBuild.java +++ b/src/main/java/me/unurled/sacredrealms/sr/components/clientbuild/ClientBuild.java @@ -6,36 +6,71 @@ import org.bukkit.Location; import org.bukkit.block.data.BlockData; import org.jetbrains.annotations.NotNull; +/** Represents a client build */ public class ClientBuild { private final String name; private final HashMap blocks = new HashMap<>(); + /** + * Create a new client build + * + * @param name the name of the client build + */ public ClientBuild(String name) { this.name = name; } + /** + * Get the name of the client build + * + * @return the name of the client build + */ public String getName() { return this.name; } + /** + * Get the blocks of the client build + * + * @return the blocks of the client build + */ public Map getBlocks() { return this.blocks; } + /** + * Add a block to the client build + * + * @param loc the location of the block + * @param state the state of the block + */ public void addBlock(Location loc, BlockData state) { this.blocks.put(loc, state); } + /** + * Remove a block from the client build + * + * @param loc the location of the block + */ @SuppressWarnings("unused") public void removeBlock(@NotNull Location loc) { this.blocks.remove(loc); } + /** + * Check if the client build contains a block + * + * @param loc the location of the block + * @param data the state of the block + * @return true if the client build contains the block, false otherwise + */ @SuppressWarnings("unused") public boolean containsBlock(@NotNull Location loc, @NotNull BlockData data) { return this.blocks.containsKey(loc) && this.blocks.get(loc).matches(data); } + /** Clear all blocks from the client build */ @SuppressWarnings("unused") public void clearBlocks() { this.blocks.clear();