Add javadocs

This commit is contained in:
ceze88 2023-07-08 11:18:34 +02:00
parent 8fd9dfa6e0
commit 31f517c436
3 changed files with 108 additions and 5 deletions

View File

@ -3,24 +3,74 @@ package com.craftaro.ultimatestacker.api.stack.spawner;
import com.craftaro.core.database.Data; import com.craftaro.core.database.Data;
import org.bukkit.Location; import org.bukkit.Location;
import org.bukkit.block.Block; import org.bukkit.block.Block;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import java.util.Collection; import java.util.Collection;
import java.util.List; import java.util.List;
/**
* Represents a manager for SpawnerStacks
*/
public interface SpawnerStackManager { public interface SpawnerStackManager {
/**
* Add a list of spawners to the manager
* @param spawners The list of spawners to add
*/
void addSpawners(List<SpawnerStack> spawners); void addSpawners(List<SpawnerStack> spawners);
/**
* Add a spawner to the manager
* @param spawnerStack The spawner to add
* @return The added spawner
*/
SpawnerStack addSpawner(SpawnerStack spawnerStack); SpawnerStack addSpawner(SpawnerStack spawnerStack);
/**
* Get the spawner for the given block
* @param block The block to get the spawner for
* @return The spawner for the given block
*/
SpawnerStack getSpawner(Block block); SpawnerStack getSpawner(Block block);
/**
* Get the spawner for the given location
* @param location The location to get the spawner for
* @return The spawner for the given location
*/
SpawnerStack getSpawner(Location location); SpawnerStack getSpawner(Location location);
/**
* Check if the given block is a SpawnerStack
* @param block The block to check
* @return True if the given block is a SpawnerStack
*/
boolean isSpawner(Block block);
/**
* Check if the given block is a SpawnerStack
* @param location The block to check
* @return True if the given block is a SpawnerStack
*/
boolean isSpawner(Location location); boolean isSpawner(Location location);
SpawnerStack removeSpawner(Location location); /**
* Remove a spawner from the manager
* @param location The location of the spawner to remove
* @return The removed spawner
*/
@Nullable SpawnerStack removeSpawner(Location location);
Collection<SpawnerStack> getStacks(); /**
* Get all the SpawnerStack in the manager
* @return All SpawnerStack in the manager
*/
@NotNull Collection<SpawnerStack> getStacks();
Collection<Data> getStacksData(); /**
* Get all the SpawnerStack as Data in the manager
* @return All SpawnerStack as Data in the manager
*/
@NotNull Collection<Data> getStacksData();
} }

View File

@ -2,15 +2,38 @@ package com.craftaro.ultimatestacker.api.utils;
import org.bukkit.Location; import org.bukkit.Location;
/**
* Represents an object which can have a hologram
*/
public interface Hologramable { public interface Hologramable {
Location getLocation(); /**
* Gets the name of the hologram
* @return The name of the hologram
*/
String getHologramName(); String getHologramName();
/**
* Checks if the hologram is enabled
* @return True if the hologram is enabled, otherwise false
*/
boolean areHologramsEnabled(); boolean areHologramsEnabled();
/**
* Checks if the hologram holder is valid
* @return True if the hologram holder is valid, otherwise false
*/
boolean isValid(); boolean isValid();
/**
* Gets the id of the hologram
* @return The id of the hologram
*/
String getHologramId(); String getHologramId();
/**
* Gets the location of the stack which has the hologram
* @return The location
*/
Location getLocation();
} }

View File

@ -1,15 +1,45 @@
package com.craftaro.ultimatestacker.api.utils; package com.craftaro.ultimatestacker.api.utils;
import org.bukkit.Location;
/**
* Represents an object that can be stacked
*/
public interface Stackable { public interface Stackable {
/**
* Get the amount of the stack
* @return The amount of the stack
*/
int getAmount(); int getAmount();
/**
* Set the amount of the stack
* @param amount The new amount of the stack
*/
void setAmount(int amount); void setAmount(int amount);
/**
* Add to the amount of the stack
* @param amount The amount to add to the stack
*/
void add(int amount); void add(int amount);
/**
* Take from the amount of the stack
* @param amount The amount to take from the stack
*/
void take(int amount); void take(int amount);
/**
* Get the location of the stack
* @return The location of the stack
*/
Location getLocation();
/**
* Check if the stack is valid
* @return True if the stack is valid
*/
boolean isValid(); boolean isValid();
} }