Fix javadoc warnings

A part of the documentation may still be incorrect
This commit is contained in:
Eric 2018-07-25 13:11:44 +02:00
parent f51f91e8f4
commit 8cf7b7c08e
8 changed files with 46 additions and 17 deletions

View File

@ -26,7 +26,7 @@ public abstract class ShopSubCommand {
} }
/** /**
* Returns whether the command can only be used by players, not by the console * @return Whether the command can only be used by players, not by the console
*/ */
public boolean isPlayerCommand() { public boolean isPlayerCommand() {
return playerCommand; return playerCommand;
@ -35,7 +35,10 @@ public abstract class ShopSubCommand {
/** /**
* Execute the sub command * Execute the sub command
* @param sender Sender of the command * @param sender Sender of the command
* @param command Command which was executed
* @param args Arguments of the command ({@code args[0]} is the sub command's name) * @param args Arguments of the command ({@code args[0]} is the sub command's name)
* @param label Alias of the command which was used
* @param args Passed command arguments
* @return Whether the sender should be sent the help message * @return Whether the sender should be sent the help message
*/ */
public boolean execute(CommandSender sender, Command command, String label, String[] args) { public boolean execute(CommandSender sender, Command command, String label, String[] args) {
@ -43,11 +46,11 @@ public abstract class ShopSubCommand {
} }
/** /**
* <p>Returns a list of tab completions for the sub command</p>
* The main sub command will be tab completed by ShopChest
* @param sender Sender of the command * @param sender Sender of the command
* @param command Command which was executed
* @param label Alias of the command which was used
* @param args Arguments of the command ({@code args[0]} is the sub command's name) * @param args Arguments of the command ({@code args[0]} is the sub command's name)
* @return A list of tab completions (may be an empty list) * @return A list of tab completions for the sub command (may be an empty list)
*/ */
public List<String> getTabCompletions(CommandSender sender, Command command, String label, String[] args) { public List<String> getTabCompletions(CommandSender sender, Command command, String label, String[] args) {
if (tabCompleter == null) { if (tabCompleter == null) {
@ -58,8 +61,8 @@ public abstract class ShopSubCommand {
} }
/** /**
* Returns the help message for the command.
* @param sender Sender to receive the help message * @param sender Sender to receive the help message
* @return The help message for the command.
*/ */
public abstract String getHelpMessage(CommandSender sender); public abstract String getHelpMessage(CommandSender sender);
} }

View File

@ -451,6 +451,9 @@ public class Config {
/** /**
* Reload the configuration values from config.yml * Reload the configuration values from config.yml
* @param firstLoad Whether the config values have not been loaded before
* @param langReload Whether the language configuration should be reloaded
* @param showMessages Whether console (error) messages should be shown
*/ */
public void reload(boolean firstLoad, boolean langReload, boolean showMessages) { public void reload(boolean firstLoad, boolean langReload, boolean showMessages) {
plugin.reloadConfig(); plugin.reloadConfig();

View File

@ -43,6 +43,7 @@ public class HologramFormat {
* Get the format for the given line of the hologram * Get the format for the given line of the hologram
* @param line Line of the hologram * @param line Line of the hologram
* @param reqMap Values of the requirements that might be needed by the format (contains {@code null} if not comparable) * @param reqMap Values of the requirements that might be needed by the format (contains {@code null} if not comparable)
* @param plaMap Values of the placeholders that might be needed by the format
* @return The format of the first working option, or an empty String if no option is working * @return The format of the first working option, or an empty String if no option is working
* because of not fulfilled requirements * because of not fulfilled requirements
*/ */
@ -76,7 +77,9 @@ public class HologramFormat {
config = YamlConfiguration.loadConfiguration(configFile); config = YamlConfiguration.loadConfiguration(configFile);
} }
/** Returns whether the hologram text has to change dynamically without reloading */ /**
* @return Whether the hologram text has to change dynamically without reloading
*/
public boolean isDynamic() { public boolean isDynamic() {
int count = getLineCount(); int count = getLineCount();
for (int i = 0; i < count; i++) { for (int i = 0; i < count; i++) {
@ -101,12 +104,16 @@ public class HologramFormat {
return false; return false;
} }
/** Returns the amount of lines in a hologram */ /**
* @return Amount of lines in a hologram
*/
public int getLineCount() { public int getLineCount() {
return config.getConfigurationSection("lines").getKeys(false).size(); return config.getConfigurationSection("lines").getKeys(false).size();
} }
/** Returns the configuration of the "hologram-format.yml" file */ /**
* @return Configuration of the "hologram-format.yml" file
*/
public YamlConfiguration getConfig() { public YamlConfiguration getConfig() {
return config; return config;
} }

View File

@ -93,12 +93,16 @@ public class Hologram {
return interactArmorStandWrapper != null && interactArmorStandWrapper.getUuid().equals(armorStand.getUniqueId()); return interactArmorStandWrapper != null && interactArmorStandWrapper.getUuid().equals(armorStand.getUniqueId());
} }
/** Returns the ArmorStandWrappers of this hologram */ /**
* @return A list of {@link ArmorStandWrapper}s of this hologram
*/
public List<ArmorStandWrapper> getArmorStandWrappers() { public List<ArmorStandWrapper> getArmorStandWrappers() {
return wrappers; return wrappers;
} }
/** Returns the ArmorStandWrapper of this hologram that is positioned higher to be used for interaction */ /**
* @return The {@link ArmorStandWrapper} of this hologram that is positioned higher to be used for interaction
*/
public ArmorStandWrapper getInteractArmorStandWrapper() { public ArmorStandWrapper getInteractArmorStandWrapper() {
return interactArmorStandWrapper; return interactArmorStandWrapper;
} }
@ -120,7 +124,7 @@ public class Hologram {
/** /**
* @param p Player to which the hologram should be shown * @param p Player to which the hologram should be shown
* @param force whether to force or not * @param force Whether to force showing the hologram
*/ */
public void showPlayer(Player p, boolean force) { public void showPlayer(Player p, boolean force) {
if (viewers.add(p.getUniqueId()) || force) { if (viewers.add(p.getUniqueId()) || force) {
@ -137,7 +141,7 @@ public class Hologram {
/** /**
* @param p Player from which the hologram should be hidden * @param p Player from which the hologram should be hidden
* @param force whether to force or not * @param force Whether to force hiding the hologram
*/ */
public void hidePlayer(Player p, boolean force) { public void hidePlayer(Player p, boolean force) {
if (viewers.remove(p.getUniqueId()) || force) { if (viewers.remove(p.getUniqueId()) || force) {
@ -146,8 +150,10 @@ public class Hologram {
} }
/** /**
* Removes the hologram. <br> * <p>Removes the hologram.</p>
* Hologram will be hidden from all players and will be killed *
* Hologram will be hidden from all players and all
* ArmorStand entities will be killed.
*/ */
public void remove() { public void remove() {
viewers.clear(); viewers.clear();
@ -166,6 +172,11 @@ public class Hologram {
HOLOGRAMS.remove(this); HOLOGRAMS.remove(this);
} }
/**
* Remove the player from the list of viewers. The hologram is
* then counted as hidden, but no packets are sent to the player.
* @param p Player whose visibility status will be reset
*/
public void resetVisible(Player p) { public void resetVisible(Player p) {
viewers.remove(p.getUniqueId()); viewers.remove(p.getUniqueId());
} }

View File

@ -325,8 +325,9 @@ public class Shop {
} }
/** /**
* Assign an ID to the shop. <br/> * <p>Assign an ID to the shop.</p>
* Only works for the first time! * Only works for the first time!
* @param id ID to set for this shop
*/ */
public void setId(int id) { public void setId(int id) {
if (this.id == -1) { if (this.id == -1) {

View File

@ -383,8 +383,9 @@ public abstract class Database {
/** /**
* Log an economy transaction to the database * Log an economy transaction to the database
* @param executor Player who bought/sold something * @param executor Player who bought/sold something
* @param product ItemStack that was bought/sold * @param product {@link ItemStack} that was bought/sold
* @param vendor Vendor of the shop * @param vendor Vendor of the shop
* @param shopType {@link ShopType} of the shop
* @param location Location of the shop * @param location Location of the shop
* @param price Price (buyprice or sellprice, depends on {@code type}) * @param price Price (buyprice or sellprice, depends on {@code type})
* @param type Whether the player bought or sold something * @param type Whether the player bought or sold something

View File

@ -298,8 +298,10 @@ public class ShopUtils {
} }
/** /**
* Remove a player from the {@code playerLocation} map. * Remove a saved location of a player to force a recalculation
* of whether the hologram should be visible.
* This should only be called when really needed * This should only be called when really needed
* @param player Player whose saved location will be reset
*/ */
public void resetPlayerLocation(Player player) { public void resetPlayerLocation(Player player) {
playerLocation.remove(player.getUniqueId()); playerLocation.remove(player.getUniqueId());

View File

@ -298,6 +298,7 @@ public class Utils {
/** /**
* Send a packet to a player * Send a packet to a player
* @param plugin An instance of the {@link ShopChest} plugin
* @param packet Packet to send * @param packet Packet to send
* @param player Player to which the packet should be sent * @param player Player to which the packet should be sent
* @return {@code true} if the packet was sent, or {@code false} if an exception was thrown * @return {@code true} if the packet was sent, or {@code false} if an exception was thrown