Javadoc for ClientBuild.Java

This commit is contained in:
unurled 2024-04-27 20:55:11 +02:00
parent 0fbaf8905e
commit 36369a3de4
Signed by: unurled
GPG key ID: FDBC9CBE1F82423F

View file

@ -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<Location, BlockData> 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<Location, BlockData> 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();