JavaDoc clean up.

This commit is contained in:
tastybento 2018-06-09 16:40:38 -07:00
parent db3344c8b9
commit 27639f673a
55 changed files with 178 additions and 180 deletions

View File

@ -115,7 +115,7 @@ public abstract class Addon implements AddonInterface {
/**
* Register a listener for this addon
*
* @param listener
* @param listener - listener
*/
public void registerListener(Listener listener) {
Bukkit.getPluginManager().registerEvents(listener, BSkyBlock.getInstance());
@ -201,7 +201,7 @@ public abstract class Addon implements AddonInterface {
/**
* Get the resource from Jar file
* @param jarResource
* @param jarResource - jar resource filename
* @return resource or null if there is a problem
*/
public InputStream getResource(String jarResource) {
@ -235,7 +235,7 @@ public abstract class Addon implements AddonInterface {
/**
* Set this addon's data folder
*
* @param file
* @param file - data folder
*/
public void setDataFolder(File file) {
dataFolder = file;
@ -244,7 +244,7 @@ public abstract class Addon implements AddonInterface {
/**
* Set this addons description
*
* @param desc
* @param desc - description
*/
public void setDescription(AddonDescription desc) {
description = desc;

View File

@ -100,9 +100,9 @@ public class AddonClassLoader extends URLClassLoader {
/**
* This is a custom findClass that enables classes in other addons to be found
* @param name
* @param checkGlobal
* @return Class
* @param name - class name
* @param checkGlobal - check globally or not when searching
* @return Class - class if found
*/
public Class<?> findClass(String name, boolean checkGlobal) {
if (name.startsWith("us.tastybento.")) {

View File

@ -21,7 +21,7 @@ public interface BSBCommand {
/**
* What will be executed when this command is run
* @param user - the User
* @param args
* @param args - command arguments
* @return true or false - true if the command executed successfully
*/
boolean execute(User user, List<String> args);
@ -30,8 +30,8 @@ public interface BSBCommand {
* Tab Completer for CompositeCommands. Note that any registered sub-commands will be automatically
* added to the list must not be manually added. Use this to add tab-complete for things like names.
* @param user - the User
* @param alias
* @param args
* @param alias - alias for command
* @param args - command arguments
* @return List of strings that could be used to complete this command.
*/
default Optional<List<String>> tabComplete(User user, String alias, List<String> args) {

View File

@ -29,9 +29,9 @@ public class IslandBaseEvent extends PremadeEvent implements Cancellable {
}
/**
* @param island
* @param island - island
* @param playerUUID - the player's UUID
* @param admin
* @param admin - true if ths is due to an admin event
* @param location - the location
*/
public IslandBaseEvent(Island island, UUID playerUUID, boolean admin, Location location) {

View File

@ -20,10 +20,10 @@ public class FlagChangeEvent extends IslandBaseEvent {
private final boolean setTo;
/**
* @param island
* @param island - island
* @param player - the player
* @param editedFlag
* @param setTo
* @param editedFlag - flag edited
* @param setTo - new value
*/
public FlagChangeEvent(Island island, UUID player, Flag editedFlag, boolean setTo) {
super(island);

View File

@ -116,7 +116,7 @@ public class IslandEvent {
/**
* True if this is an admin driven event
* @param admin
* @param admin - true if due to admin event
* @return TeamEvent
*/
public IslandEventBuilder admin(boolean admin) {

View File

@ -107,7 +107,7 @@ public class TeamEvent {
/**
* True if this is an admin driven event
* @param admin
* @param admin - true if due to an admin event
* @return TeamEvent
*/
public TeamEventBuilder admin(boolean admin) {

View File

@ -27,7 +27,7 @@ public class FlagBuilder {
/**
* The material that will become the icon for this flag
* @param icon
* @param icon - material
*/
public FlagBuilder icon(Material icon) {
this.icon = icon;
@ -48,7 +48,7 @@ public class FlagBuilder {
/**
* Sets the default setting for this flag in the world
* @param setting
* @param setting - true or false
* @return FlagBuilder
*/
public FlagBuilder allowedByDefault(boolean setting) {
@ -68,7 +68,7 @@ public class FlagBuilder {
/**
* Set the id of this flag to the name of this enum value
* @param flag
* @param flag - flag
* @return FlagBuilder
*/
public FlagBuilder id(Enum<?> flag) {
@ -78,7 +78,7 @@ public class FlagBuilder {
/**
* Set a default rank for this flag. If not set, the value of RanksManager.MEMBER_RANK will be used
* @param rank
* @param rank - rank value
* @return FlagBuilder
*/
public FlagBuilder defaultRank(int rank) {

View File

@ -103,7 +103,7 @@ public class BSBLocale {
/**
* Merges a language YAML file to this locale
* @param language
* @param language - language file
*/
public void merge(File language) {
YamlConfiguration toBeMerged = YamlConfiguration.loadConfiguration(language);

View File

@ -85,7 +85,7 @@ public class Panel implements HeadRequester {
/**
* Open the inventory panel
* @param users
* @param users - users that should see the panel
*/
public void open(User... users) {
for (User u : users) {

View File

@ -41,8 +41,8 @@ public class PanelBuilder {
/**
* Forces panel to be a specific number of slots.
* @param size
* @return PanelBuilder
* @param size - size to be
* @return PanelBuilder - PanelBuilder
*/
public PanelBuilder size(int size) {
this.size = size;
@ -61,7 +61,7 @@ public class PanelBuilder {
/**
* Sets which PanelListener will listen for clicks
* @param listener
* @param listener - listener for this panel
* @return PanelBuilder
*/
public PanelBuilder listener(PanelListener listener) {

View File

@ -31,8 +31,8 @@ public interface PlaceholderAPIInterface {
/**
* Replace placeholders in the message according to the receiver
* @param receiver
* @param message
* @param receiver - user who will receive the message
* @param message - message
* @return updated message
*/
String replacePlaceholders(User receiver, String message);

View File

@ -12,8 +12,8 @@ public class PlaceholderBuilder {
/**
* The value this placeholder should take
* @param value
* @return
* @param value - placeholder request value
* @return PlaceholderBuilder object
*/
public PlaceholderBuilder value(Placeholder.PlaceholderRequest value) {
this.value = value;

View File

@ -77,8 +77,8 @@ public class PlaceholderHandler {
/**
* Replace placeholders in the message according to the receiver
* @param receiver
* @param message
* @param receiver - user to receive the message
* @param message - message
* @return updated message
*/
public static String replacePlaceholders(User receiver, String message){

View File

@ -38,8 +38,8 @@ public class User {
/**
* Get an instance of User from a CommandSender
* @param sender
* @return user
* @param sender - command sender, e.g. console
* @return user - user
*/
public static User getInstance(CommandSender sender) {
if (sender instanceof Player) {
@ -51,7 +51,7 @@ public class User {
/**
* Get an instance of User from a Player object
* @param player - the player
* @return user
* @return user - user
*/
public static User getInstance(Player player) {
if (player == null) {
@ -65,7 +65,7 @@ public class User {
/**
* Get an instance of User from a UUID
* @param uuid - UUID
* @return user
* @return user - user
*/
public static User getInstance(UUID uuid) {
if (uuid == null) {
@ -159,7 +159,7 @@ public class User {
}
/**
* @param permission
* @param permission - permission string
* @return true if permission is empty or if the player has that permission
*/
public boolean hasPermission(String permission) {
@ -189,8 +189,9 @@ public class User {
/**
* Gets a translation of this reference for this user.
* @param reference
* @param variables
* @param reference - reference found in a locale file
* @param variables - variables to insert into translated string. Variables go in pairs, for example
* "[name]", "tastybento"
* @return Translated string with colors converted, or the reference if nothing has been found
*/
public String getTranslation(String reference, String... variables) {
@ -217,8 +218,9 @@ public class User {
/**
* Gets a translation of this reference for this user.
* @param reference
* @param variables
* @param reference - reference found in a locale file
* @param variables - variables to insert into translated string. Variables go in pairs, for example
* "[name]", "tastybento"
* @return Translated string with colors converted, or a blank String if nothing has been found
*/
public String getTranslationOrNothing(String reference, String... variables) {
@ -272,7 +274,7 @@ public class User {
/**
* Sets the user's game mode
* @param mode
* @param mode - GameMode
*/
public void setGameMode(GameMode mode) {
player.setGameMode(mode);
@ -325,7 +327,7 @@ public class User {
/**
* Performs a command as the player
* @param cmd
* @param cmd - command to execute
* @return true if the command was successful, otherwise false
*/
public boolean performCommand(String cmd) {

View File

@ -12,7 +12,7 @@ import us.tastybento.bskyblock.api.user.User;
public class AdminReloadCommand extends CompositeCommand {
/**
* @param parent
* @param parent - parent command
*/
public AdminReloadCommand(CompositeCommand parent) {
super(parent, "reload", "rl");

View File

@ -10,7 +10,7 @@ public class IslandAboutCommand extends CompositeCommand {
/**
* About
* @param islandCommand
* @param islandCommand - parent command
*/
public IslandAboutCommand(CompositeCommand islandCommand) {
super(islandCommand, "about", "ab");

View File

@ -17,7 +17,7 @@ public class IslandCreateCommand extends CompositeCommand {
/**
* Command to create an island
* @param islandCommand
* @param islandCommand - parent command
*/
public IslandCreateCommand(CompositeCommand islandCommand) {
super(islandCommand, "create");

View File

@ -149,8 +149,8 @@ public class IslandTeamInviteCommand extends CompositeCommand {
/**
* Gets the maximum team size for this player in this game based on the permission or the world's setting
* @param user
* @return max team size
* @param user - user
* @return max team size of user
*/
public int getMaxTeamSize(User user) {
return Util.getPermValue(user.getPlayer(), getPermissionPrefix() + "team.maxsize.", getIWM().getMaxTeamSize(getWorld()));

View File

@ -69,16 +69,16 @@ public abstract class AbstractDatabaseHandler<T> {
/**
* Deletes the object with the unique id from the database
* @param instance
* @param instance - object instance
*/
public abstract void deleteObject(T instance) throws IllegalAccessException, InvocationTargetException, IntrospectionException ;
/**
* Checks if a key exists or not
* @param key
* @return true if this key exists
* Checks if a unique id exists or not
* @param uniqueId - uniqueId to check
* @return true if this uniqueId exists
*/
public abstract boolean objectExists(String key);
public abstract boolean objectExists(String uniqueId);
/**
* Closes the database

View File

@ -104,8 +104,8 @@ public class FlatFileDatabaseConnecter implements DatabaseConnecter {
/**
* Adds comments to a YAML file
* @param file
* @param commentMap
* @param file - file
* @param commentMap - map of comments to apply to file
*/
private void commentFile(File file, Map<String, String> commentMap) {
// Run through the file and add in the comments

View File

@ -72,8 +72,8 @@ public class FlatFileDatabaseHandler<T> extends AbstractDatabaseHandler<T> {
}
@Override
public boolean objectExists(String key) {
return databaseConnecter.uniqueIdExists(dataObject.getSimpleName(), key);
public boolean objectExists(String uniqueId) {
return databaseConnecter.uniqueIdExists(dataObject.getSimpleName(), uniqueId);
}
@ -360,8 +360,8 @@ public class FlatFileDatabaseHandler<T> extends AbstractDatabaseHandler<T> {
/**
* Serialize an object if required
* @param object
* @return
* @param object - object to serialize
* @return - serialized object
*/
private Object serialize(Object object) {
if (object == null) {

View File

@ -20,7 +20,7 @@ public class MongoDBDatabaseConnecter implements DatabaseConnecter {
/**
* Class for MySQL database connections using the settings provided
* @param dbSettings
* @param dbSettings - database settings
*/
public MongoDBDatabaseConnecter(DatabaseConnectionSettingsImpl dbSettings) {
this.dbSettings = dbSettings;

View File

@ -151,8 +151,8 @@ public class MongoDBDatabaseHandler<T> extends AbstractDatabaseHandler<T> {
* @see us.tastybento.bskyblock.database.managers.AbstractDatabaseHandler#objectExists(java.lang.String)
*/
@Override
public boolean objectExists(String key) {
return collection.find(new Document(MONGO_ID, key)).first() != null;
public boolean objectExists(String uniqueId) {
return collection.find(new Document(MONGO_ID, uniqueId)).first() != null;
}
@Override

View File

@ -19,7 +19,7 @@ public class MySQLDatabaseConnecter implements DatabaseConnecter {
/**
* Class for MySQL database connections using the settings provided
* @param dbSettings
* @param dbSettings - database settings
*/
public MySQLDatabaseConnecter(DatabaseConnectionSettingsImpl dbSettings) {
this.dbSettings = dbSettings;

View File

@ -178,21 +178,21 @@ public class MySQLDatabaseHandler<T> extends AbstractDatabaseHandler<T> {
* @see us.tastybento.bskyblock.database.managers.AbstractDatabaseHandler#objectExists(java.lang.String)
*/
@Override
public boolean objectExists(String key) {
public boolean objectExists(String uniqueId) {
// Create the query to see if this key exists
String query = "SELECT IF ( EXISTS( SELECT * FROM `" +
dataObject.getCanonicalName() +
"` WHERE `uniqueId` = ?), 1, 0)";
try (PreparedStatement preparedStatement = connection.prepareStatement(query)) {
preparedStatement.setString(1, key);
preparedStatement.setString(1, uniqueId);
try (ResultSet resultSet = preparedStatement.executeQuery()) {
if (resultSet.next()) {
return resultSet.getBoolean(1);
}
}
} catch (SQLException e) {
plugin.logError("Could not check if key exists in database! " + key + " " + e.getMessage());
plugin.logError("Could not check if key exists in database! " + uniqueId + " " + e.getMessage());
}
return false;
}

View File

@ -136,8 +136,9 @@ public class Island implements DataObject {
public boolean addToBanList(UUID targetUUID) {
if (targetUUID != null) {
members.put(targetUUID, RanksManager.BANNED_RANK);
return true;
}
return true;
return false;
}
/**
@ -170,7 +171,7 @@ public class Island implements DataObject {
* Gets the Island Guard flag's setting. If this is a protection flag, the this will be the
* rank needed to bypass this flag. If it is a Settings flag, any non-zero value means the
* setting is allowed.
* @param flag
* @param flag - flag
* @return flag value
*/
public int getFlag(Flag flag) {
@ -291,7 +292,7 @@ public class Island implements DataObject {
}
/**
* @param material
* @param material - Material
* @return count of how many tile entities of type mat are on the island at last count. Counts are done when a player places
* a tile entity.
*/
@ -385,7 +386,7 @@ public class Island implements DataObject {
/**
* Checks if the coords are in island space
* @param blockCoord
* @param blockCoord - Pair(x,z) coords of block
* @return true or false
*/
public boolean inIslandSpace(Pair<Integer, Integer> blockCoord) {
@ -395,7 +396,7 @@ public class Island implements DataObject {
/**
* Check if the flag is allowed or not
* For flags that are for the island in general and not related to rank.
* @param flag
* @param flag - flag
* @return true if allowed, false if not
*/
public boolean isAllowed(Flag flag) {
@ -432,7 +433,7 @@ public class Island implements DataObject {
/**
* Checks if a location is within this island's protected area
*
* @param target
* @param target - target location
* @return true if it is, false if not
*/
public boolean onIsland(Location target) {
@ -445,13 +446,13 @@ public class Island implements DataObject {
* @return true if successful, otherwise false.
*/
public boolean removeFromBanList(UUID targetUUID) {
members.remove(targetUUID);
return true;
return (members.remove(targetUUID) != null);
}
/**
* Removes a player from the team member map. Do not call this directly. Use {@link us.tastybento.bskyblock.managers.IslandsManager#removePlayer(World, UUID)}
* @param playerUUID
* Removes a player from the team member map. Do not call this directly.
* Use {@link us.tastybento.bskyblock.managers.IslandsManager#removePlayer(World, UUID)}
* @param playerUUID - uuid of player
*/
public void removeMember(UUID playerUUID) {
members.remove(playerUUID);
@ -476,7 +477,7 @@ public class Island implements DataObject {
/**
* Set the Island Guard flag rank
* @param flag
* @param flag - flag
* @param value - Use RanksManager settings, e.g. RanksManager.MEMBER
*/
public void setFlag(Flag flag, int value){
@ -589,7 +590,7 @@ public class Island implements DataObject {
/**
* Set user's rank to an arbitrary rank value
* @param user - the User
* @param rank
* @param rank - rank value
*/
public void setRank(User user, int rank) {
if (user.getUniqueId() != null) {
@ -644,7 +645,7 @@ public class Island implements DataObject {
/**
* Show info on the island
* @param plugin
* @param plugin - plugin
* @param user - the user who is receiving the info
* @return true always
*/
@ -681,7 +682,7 @@ public class Island implements DataObject {
/**
* Shows the members of this island
* @param plugin
* @param plugin - plugin
* @param user - user who is requesting
*/
public void showMembers(BSkyBlock plugin, User user) {
@ -703,7 +704,7 @@ public class Island implements DataObject {
/**
* Toggles a settings flag
* @param flag
* @param flag - flag
*/
public void toggleFlag(Flag flag) {
if (flag.getType().equals(Flag.Type.SETTING) || flag.getType().equals(Flag.Type.WORLD_SETTING)) {
@ -713,8 +714,8 @@ public class Island implements DataObject {
/**
* Sets the state of a settings flag
* @param flag
* @param state
* @param flag - flag
* @param state - true or false
*/
public void setSettingsFlag(Flag flag, boolean state) {
if (flag.getType().equals(Flag.Type.SETTING) || flag.getType().equals(Flag.Type.WORLD_SETTING)) {

View File

@ -86,7 +86,7 @@ public class Players implements DataObject {
}
/**
* @param world
* @param world - world
* @return List of home locations
*/
public Map<Location, Integer> getHomeLocations(World world) {
@ -187,7 +187,7 @@ public class Players implements DataObject {
/**
* Clears all home Locations in world
* @param world
* @param world - world
*/
public void clearHomeLocations(World world) {
homeLocations.keySet().removeIf(l -> Util.sameWorld(l.getWorld(), world));

View File

@ -12,14 +12,14 @@ public interface AdapterInterface<S,V> {
/**
* Serialize object
* @param object - object
* @param object - object to serialize
* @return serialized object
*/
S deserialize(Object object);
/**
* Deserialize object
* @param object
* @param object - object to deserialize
* @return deserialized object
*/
V serialize(Object object);

View File

@ -26,7 +26,6 @@ import org.bukkit.block.Sign;
import org.bukkit.block.banner.Pattern;
import org.bukkit.block.banner.PatternType;
import org.bukkit.configuration.ConfigurationSection;
import org.bukkit.configuration.InvalidConfigurationException;
import org.bukkit.configuration.file.YamlConfiguration;
import org.bukkit.inventory.Inventory;
import org.bukkit.inventory.InventoryHolder;
@ -126,7 +125,7 @@ public class Clipboard {
/**
* Pastes the clipboard to location
* @param location
* @param location - location to paste
*/
public void paste(Location location) {
blockConfig.getKeys(false).forEach(b -> pasteBlock(location, blockConfig.getConfigurationSection(b)));
@ -387,8 +386,6 @@ public class Clipboard {
/**
* Load a file to clipboard
* @throws IOException
* @throws InvalidConfigurationException
*/
public boolean load(User user, String string) {
File zipFile = new File(schemFolder, string + ".schem");
@ -429,9 +426,9 @@ public class Clipboard {
/**
* Save the clipboard to a file
* @param user
* @param string
* @return
* @param user - user who is copying
* @param string - filename
* @return - true if successful, false if error
*/
public boolean save(User user, String string) {
File file = new File(schemFolder, string);

View File

@ -18,17 +18,17 @@ public class BlockEndDragon implements Listener {
/**
* This handles end dragon spawning prevention
*
* @param event
* @param e - event
* @return true if dragon can spawn, false if not
*/
@EventHandler(priority = EventPriority.LOWEST, ignoreCancelled = true)
public boolean onDragonSpawn(CreatureSpawnEvent event) {
if (!event.getEntityType().equals(EntityType.ENDER_DRAGON) || plugin.getIWM().isDragonSpawn(event.getEntity().getWorld())) {
public boolean onDragonSpawn(CreatureSpawnEvent e) {
if (!e.getEntityType().equals(EntityType.ENDER_DRAGON) || plugin.getIWM().isDragonSpawn(e.getEntity().getWorld())) {
return true;
}
event.getEntity().setHealth(0);
event.getEntity().remove();
event.setCancelled(true);
e.getEntity().setHealth(0);
e.getEntity().remove();
e.setCancelled(true);
return false;
}

View File

@ -26,7 +26,7 @@ public class ObsidianToLava implements Listener {
private BSkyBlock plugin;
/**
* @param plugin
* @param plugin - plugin
*/
public ObsidianToLava(BSkyBlock plugin) {
this.plugin = plugin;

View File

@ -170,7 +170,7 @@ public abstract class AbstractFlagListener implements Listener {
/**
* Get the flag for this ID
* @param id
* @param id - the flag ID
* @return Flag denoted by the id
*/
protected Flag id(String id) {

View File

@ -113,7 +113,7 @@ public class FireListener extends AbstractFlagListener {
/**
* Protect TNT from being set light by a fire arrow
* @param e
* @param e - event
* @return true if cancelled
*/
@EventHandler(priority = EventPriority.NORMAL, ignoreCancelled = true)

View File

@ -59,20 +59,20 @@ public class HurtingListener extends AbstractFlagListener {
/**
* Finds the true attacker, even if the attack was via a projectile
* @param event
* @param damager
* @param hurtMobs
* @param e - event
* @param damager - damager
* @param flag - flag
*/
private void respond(EntityDamageByEntityEvent event, Entity damager, Flag hurtMobs) {
private void respond(EntityDamageByEntityEvent e, Entity damager, Flag flag) {
// Get the attacker
if (damager instanceof Player) {
setUser(User.getInstance(damager)).checkIsland(event, damager.getLocation(), hurtMobs);
setUser(User.getInstance(damager)).checkIsland(e, damager.getLocation(), flag);
} else if (damager instanceof Projectile) {
// Find out who fired the projectile
Projectile p = (Projectile) damager;
if (p.getShooter() instanceof Player) {
if (!setUser(User.getInstance((Player)p.getShooter())).checkIsland(event, damager.getLocation(), hurtMobs)) {
event.getEntity().setFireTicks(0);
if (!setUser(User.getInstance((Player)p.getShooter())).checkIsland(e, damager.getLocation(), flag)) {
e.getEntity().setFireTicks(0);
damager.remove();
}
}

View File

@ -92,9 +92,7 @@ public class InvincibleVisitorsListener extends AbstractFlagListener implements
if(e.getCause().equals(DamageCause.VOID)) {
// Will be set back after the teleport
p.setGameMode(GameMode.SPECTATOR);
getIslands().getIslandAt(p.getLocation()).ifPresent(i -> {
new SafeTeleportBuilder(getPlugin()).entity(p).island(i).build();
});
getIslands().getIslandAt(p.getLocation()).ifPresent(i -> new SafeTeleportBuilder(getPlugin()).entity(p).island(i).build());
}
}

View File

@ -138,7 +138,7 @@ public class LockAndBanListener implements Listener {
/**
* Sends player home
* @param player
* @param player - player
*/
private void eject(Player player) {
player.setGameMode(GameMode.SPECTATOR);

View File

@ -59,9 +59,9 @@ public class PVPListener extends AbstractFlagListener {
/**
* Checks how to respond to an attack
* @param e
* @param damager
* @param flag
* @param e - event
* @param damager - entity doing the damaging
* @param flag - flag
*/
private void respond(Cancellable e, Entity damager, Flag flag) {
// Get the attacker

View File

@ -24,7 +24,7 @@ public class IslandToggleClickListener implements ClickHandler {
private String id;
/**
* @param id
* @param id - the flag ID that this click listener is associated with
*/
public IslandToggleClickListener(String id) {
this.id = id;

View File

@ -24,7 +24,7 @@ public class WorldToggleClickListener implements ClickHandler {
private String id;
/**
* @param id
* @param id - the flag ID that this click listener is associated with
*/
public WorldToggleClickListener(String id) {
this.id = id;

View File

@ -81,7 +81,7 @@ public class FlyingMobEvents implements Listener {
/**
* Protects entities exploding. However, I am not sure if this will ever be called as pre-explosions should prevent it.
* @param e
* @param e - event
* @return true if cancelled
*/
@EventHandler(priority = EventPriority.LOW, ignoreCancelled = true)

View File

@ -12,8 +12,8 @@ public class InventoryStore {
private ItemStack[] armor;
/**
* @param inventory
* @param armor
* @param inventory - item stack array
* @param armor - armor item stack array
*/
public InventoryStore(ItemStack[] inventory, ItemStack[] armor) {
this.inventory = inventory;

View File

@ -412,7 +412,7 @@ public class IslandWorldManager {
/**
* Gets world from friendly name
* @param friendlyWorldName
* @param friendlyWorldName - friendly world name. Used for commands.
* @return world, or null if not known
*/
public World getIslandWorld(String friendlyWorldName) {
@ -448,7 +448,7 @@ public class IslandWorldManager {
/**
* Get the permission prefix for this world
* @param world
* @param world - world
* @return permission prefix for this world
*/
public String getPermissionPrefix(World world) {
@ -458,7 +458,7 @@ public class IslandWorldManager {
/**
* Get the invincible visitor settings for this world
* @param world
* @param world - world
* @return invisible visitor settings
*/
public List<String> getIvSettings(World world) {

View File

@ -126,7 +126,7 @@ public class IslandsManager {
/**
* Islands Manager
* @param plugin
* @param plugin - plugin
*/
public IslandsManager(BSkyBlock plugin){
this.plugin = plugin;
@ -421,7 +421,7 @@ public class IslandsManager {
/**
* Get the island that is defined as spawn in this world
* @param world
* @param world - world
* @return island or null
*/
public Island getSpawn(World world){
@ -430,7 +430,7 @@ public class IslandsManager {
/**
* Get the spawn point on the spawn island if it exists
* @param world
* @param world - world
* @return the spawnPoint or null if spawn does not exist
*/
public Location getSpawnPoint(World world) {
@ -524,7 +524,7 @@ public class IslandsManager {
/**
* Indicates whether a player is at an island spawn or not
*
* @param playerLoc
* @param playerLoc - player's location
* @return true if they are, false if they are not, or spawn does not exist
*/
public boolean isAtSpawn(Location playerLoc) {
@ -730,8 +730,8 @@ public class IslandsManager {
/**
* Puts a player in a team. Removes them from their old island if required.
* @param teamIsland - team island
* @param playerUUID - the player's UUID
* @return true if successful, false if not
*/
public void setJoinTeam(Island teamIsland, UUID playerUUID) {
// Add player to new island

View File

@ -32,7 +32,7 @@ public class LocalesManager {
/**
* Gets the reference from the locale file for this user
* @param user - the User
* @param reference
* @param reference - a reference that can be found in a locale file
* @return the translated string, or if the translation does not exist, the default language version, or if that does not exist null
*/
public String get(User user, String reference) {

View File

@ -182,7 +182,7 @@ public class PlayersManager {
/**
* Clears any home locations for player
* @param world
* @param world - world
* @param playerUUID - the player's UUID
*/
public void clearHomeLocations(World world, UUID playerUUID) {
@ -192,7 +192,7 @@ public class PlayersManager {
/**
* Returns the home location, or null if none
* @param world
* @param world - world
*
* @param user - the player
* @param number - a number
@ -205,7 +205,7 @@ public class PlayersManager {
/**
* Returns the home location, or null if none
* @param world
* @param world - world
*
* @param playerUUID - the player's UUID
* @param number - a number
@ -238,25 +238,25 @@ public class PlayersManager {
/**
* Attempts to return a UUID for a given player's name.
* @param string
* @param name - name of player
* @return UUID of player or null if unknown
*/
@SuppressWarnings("deprecation")
public UUID getUUID(String string) {
public UUID getUUID(String name) {
// See if this is a UUID
// example: 5988eecd-1dcd-4080-a843-785b62419abb
if (string.length() == 36 && string.contains("-")) {
if (name.length() == 36 && name.contains("-")) {
try {
return UUID.fromString(string);
return UUID.fromString(name);
} catch (Exception ignored) {}
}
// Look in the name cache, then the data base and finally Bukkit blocking request
return playerCache.values().stream()
.filter(p -> p.getPlayerName().equalsIgnoreCase(string)).findFirst()
.filter(p -> p.getPlayerName().equalsIgnoreCase(name)).findFirst()
.map(p -> UUID.fromString(p.getUniqueId()))
.orElse(names.objectExists(string)
? names.loadObject(string).getUuid()
: Bukkit.getOfflinePlayer(string).getUniqueId());
.orElse(names.objectExists(name)
? names.loadObject(name).getUuid()
: Bukkit.getOfflinePlayer(name).getUniqueId());
}
/**
@ -300,7 +300,7 @@ public class PlayersManager {
* Sets how many resets the player has left
*
* @param playerUUID - the player's UUID
* @param resets
* @param resets - number of resets
*/
public void setResetsLeft(UUID playerUUID, int resets) {
addPlayer(playerUUID);
@ -349,7 +349,7 @@ public class PlayersManager {
/**
* Sets the locale this player wants to use
* @param playerUUID - the player's UUID
* @param localeName
* @param localeName - locale name, e.g., en-US
*/
public void setLocale(UUID playerUUID, String localeName) {
addPlayer(playerUUID);
@ -368,7 +368,7 @@ public class PlayersManager {
/**
* Set death number for player
* @param playerUUID - the player's UUID
* @param deaths
* @param deaths - number of deaths
*/
public void setDeaths(UUID playerUUID, int deaths) {
addPlayer(playerUUID);
@ -421,11 +421,11 @@ public class PlayersManager {
/**
* Tries to get the user from this name
* @param string
* @return user
* @param name - name
* @return user - user
*/
public User getUser(String string) {
return User.getInstance(getUUID(string));
public User getUser(String name) {
return User.getInstance(getUUID(name));
}
}

View File

@ -57,8 +57,8 @@ public class RanksManager {
/**
* Try to add a new rank. Owner, member, visitor and banned ranks cannot be changed.
* @param reference
* @param value
* @param reference - a reference that can be found in a locale file
* @param value - the rank value
* @return true if the rank was successfully added
*/
public boolean addRank(String reference, int value) {
@ -86,7 +86,7 @@ public class RanksManager {
/**
* Try to remove a rank. Owner, member, visitor and banned ranks cannot be removed.
* @param reference
* @param reference - a reference that can be found in a locale file
* @return true if removed
*/
public boolean removeRank(String reference) {
@ -119,7 +119,7 @@ public class RanksManager {
/**
* Gets the next rank value above the current rank. Highest is {@link RanksManager#OWNER_RANK}
* @param currentRank
* @param currentRank - current rank value
* @return Optional rank value
*/
public int getRankUpValue(int currentRank) {
@ -133,7 +133,7 @@ public class RanksManager {
/**
* Gets the previous rank value below the current rank. Lowest is {@link RanksManager#VISITOR_RANK}
* @param currentRank
* @param currentRank - current rank value
* @return Optional rank value
*/
public int getRankDownValue(int currentRank) {

View File

@ -33,7 +33,7 @@ public class IslandCache {
/**
* Adds an island to the grid
* @param island
* @param island - island to add
* @return true if successfully added, false if not
*/
public boolean addIsland(Island island) {
@ -56,7 +56,7 @@ public class IslandCache {
/**
* Adds an island to the grid register
* @param newIsland
* @param newIsland - new island
* @return true if successfully added, false if not
*/
private boolean addToGrid(Island newIsland) {
@ -71,7 +71,7 @@ public class IslandCache {
/**
* Deletes an island from the database. Does not remove blocks
* @param island
* @param island - island to delete
* @return true if successful, false if not
*/
public boolean deleteIslandFromCache(Island island) {
@ -86,7 +86,7 @@ public class IslandCache {
/**
* Get island based on the exact center location of the island
* @param location
* @param location - location to search for
* @return island or null if it does not exist
*/
public Island get(Location location) {

View File

@ -183,7 +183,7 @@ public class NewIsland {
* Finds the next free island spot based off the last known island Uses
* island_distance setting from the config file Builds up in a grid fashion
*
* @param lastIsland
* @param lastIsland - last island location
* @return Location of next free island
*/
private Location nextGridLocation(final Location lastIsland) {

View File

@ -21,7 +21,7 @@ public class DeleteIslandChunks {
/**
* Deletes the island
* @param plugin - BSkyBlock plugin object
* @param island
* @param island - island to delete
*/
public DeleteIslandChunks(final BSkyBlock plugin, final Island island) {
// Fire event

View File

@ -29,7 +29,7 @@ public class FileLister{
/**
* Returns a list of yml files in the folder given. If the folder does not exist in the file system
* it can check the plugin jar instead.
* @param folderPath
* @param folderPath - folder path
* @param checkJar - if true, the jar will be checked
* @return List of file names

View File

@ -21,7 +21,7 @@ public class HeadGetter {
private static Map<String,Set<HeadRequester>> headRequesters = new HashMap<>();
/**
* @param plugin
* @param plugin - plugin
*/
public HeadGetter(BSkyBlock plugin) {
super();

View File

@ -94,7 +94,7 @@ public class Util {
/**
* Get a list of parameter types for the collection argument in this method
* @param writeMethod
* @param writeMethod - write method
* @return a list of parameter types for the collection argument in this method
*/
public static List<Type> getCollectionParameterTypes(Method writeMethod) {
@ -162,8 +162,8 @@ public class Util {
* Returns all of the items that begin with the given start,
* ignoring case. Intended for tabcompletion.
*
* @param list
* @param start
* @param list - string list
* @param start - first few chars of a string
* @return List of items that start with the letters
*/
public static List<String> tabLimit(final List<String> list, final String start) {
@ -220,8 +220,8 @@ public class Util {
/**
* Checks is world = world2 irrespective of the world type
* @param world
* @param world2
* @param world - world
* @param world2 - world
* @return true if the same
*/
public static boolean sameWorld(World world, World world2) {

View File

@ -50,11 +50,11 @@ public class SafeSpotTeleport {
/**
* Teleports and entity to a safe spot on island
* @param plugin - BSkyBlock plugin object
* @param entity
* @param entity - entity to teleport
* @param location - the location
* @param failureMessage - already translated failure message
* @param portal
* @param homeNumber
* @param portal - true if this is a portal teleport
* @param homeNumber - home number to go to
*/
protected SafeSpotTeleport(BSkyBlock plugin, final Entity entity, final Location location, final String failureMessage, boolean portal,
int homeNumber) {
@ -116,7 +116,7 @@ public class SafeSpotTeleport {
/**
* Gets a set of chunk coords that will be scanned.
* @return
* @return - list of chunk coords to be scanned
*/
private List<Pair<Integer, Integer>> getChunksToScan() {
List<Pair<Integer, Integer>> result = new ArrayList<>();
@ -159,7 +159,7 @@ public class SafeSpotTeleport {
/**
* Loops through the chunks and if a safe spot is found, fires off the teleportation
* @param chunkSnapshot
* @param chunkSnapshot - list of chunk snapshots to check
*/
private void checkChunks(final List<ChunkSnapshot> chunkSnapshot) {
// Run async task to scan chunks
@ -177,7 +177,7 @@ public class SafeSpotTeleport {
/**
* @param chunk
* @param chunk - chunk snapshot
* @return true if a safe spot was found
*/
private boolean scanChunk(ChunkSnapshot chunk) {
@ -225,11 +225,11 @@ public class SafeSpotTeleport {
/**
* Returns true if the location is a safe one.
* @param chunk
* @param chunk - chunk snapshot
* @param x - x coordinate
* @param y
* @param y - y coordinate
* @param z - z coordinate
* @param worldHeight
* @param worldHeight - height of world
* @return true if this is a safe spot, false if this is a portal scan
*/
private boolean checkBlock(ChunkSnapshot chunk, int x, int y, int z, int worldHeight) {

View File

@ -24,7 +24,7 @@ public class SafeTeleportBuilder {
/**
* Set who or what is going to teleport
* @param entity
* @param entity - entity to teleport
* @return SafeTeleportBuilder
*/
public SafeTeleportBuilder entity(Entity entity) {
@ -34,7 +34,7 @@ public class SafeTeleportBuilder {
/**
* Set the island to teleport to
* @param island
* @param island - island destination
* @return SafeTeleportBuilder
*/
public SafeTeleportBuilder island(Island island) {
@ -44,7 +44,7 @@ public class SafeTeleportBuilder {
/**
* Set the home number to this number
* @param homeNumber
* @param homeNumber - home number
* @return SafeTeleportBuilder
*/
public SafeTeleportBuilder homeNumber(int homeNumber) {
@ -63,7 +63,7 @@ public class SafeTeleportBuilder {
/**
* Set the failure message if this teleport cannot happen
* @param failureMessage
* @param failureMessage - failure message to report to user
* @return SafeTeleportBuilder
*/
public SafeTeleportBuilder failureMessage(String failureMessage) {