Clean up Javadocs

The Javadocs have been completely cleaned up and now have no warnings or
errors
Edited gitignore to ignore javadocs and *.jardesc files
This commit is contained in:
Esophose 2017-02-15 22:32:57 -07:00
parent 69dddacd92
commit 1a3c9e6a13
14 changed files with 54 additions and 58 deletions

4
.gitignore vendored
View file

@ -34,8 +34,10 @@ Icon
# Personal stuff
*.project
*.classpath
*.jardesc
/bin
/.settings
/.settings
/doc
# Files that might appear on external disk
.Spotlight-V100

View file

@ -63,13 +63,17 @@ public class FixedParticleEffect {
* This is basically the same thing as a PPlayer, maybe we can extend it in the future?
*
* @param pplayerUUID The UUID of the player who owns the effect
* @param id The id this effect has, unique to the owner pplayer
* @param worldName The world name this effect will be displayed in
* @param xPos The X position in the world
* @param yPos The Y position in the world
* @param zPos The Z position in the world
* @param particleEffect The particle effect to use
* @param particleStyle The particle style to use
* @param particleData The particle data to use with the effect
* @param itemData The item data for the effect
* @param blockData The block data for the effect
* @param colorData The color data for the effect
* @param noteColorData The note color data for the effect
*/
public FixedParticleEffect(UUID pplayerUUID, int id, String worldName, double xPos, double yPos, double zPos, ParticleEffect particleEffect, ParticleStyle particleStyle, ItemData itemData, BlockData blockData, OrdinaryColor colorData, NoteColor noteColorData) {
this.pplayerUUID = pplayerUUID;

View file

@ -142,7 +142,7 @@ public class PPlayer {
/**
* Sets the player's particle style
*
* @param effect The player's new particle style
* @param style The player's new particle style
*/
public void setParticleStyle(ParticleStyle style) {
if (style == null) style = DefaultStyles.NONE;
@ -152,7 +152,7 @@ public class PPlayer {
/**
* Sets the player's item data
*
* @param effect The player's new item data
* @param itemData The player's new item data
*/
public void setItemData(ItemData itemData) {
if (itemData == null) itemData = new ItemData(Material.IRON_SPADE, (byte) 0);
@ -162,7 +162,7 @@ public class PPlayer {
/**
* Sets the player's block data
*
* @param effect The player's new block data
* @param blockData The player's new block data
*/
public void setBlockData(BlockData blockData) {
if (blockData == null) blockData = new BlockData(Material.STONE, (byte) 0);
@ -172,7 +172,7 @@ public class PPlayer {
/**
* Sets the player's color data
*
* @param effect The player's new color data
* @param colorData The player's new color data
*/
public void setColorData(OrdinaryColor colorData) {
if (colorData == null) colorData = new OrdinaryColor(0, 0, 0);
@ -182,7 +182,7 @@ public class PPlayer {
/**
* Sets the player's note color data
*
* @param effect The player's new note color data
* @param noteColorData The player's new note color data
*/
public void setNoteColorData(NoteColor noteColorData) {
if (noteColorData == null) noteColorData = new NoteColor(0);

View file

@ -316,6 +316,7 @@ public class ParticleCommandExecutor implements CommandExecutor {
* Can be executed for another player by having their name as the final command argument
*
* @param p The player who used the command
* @param args Additional arguments
*/
private void onReset(Player p, String[] args) {
if (args.length >= 1) {
@ -478,7 +479,7 @@ public class ParticleCommandExecutor implements CommandExecutor {
String cmd = args[0];
if (cmd.equalsIgnoreCase("create")) {
if (ConfigManager.getInstance().getNumberOfFixedEffectsForPlayer(p.getUniqueId()) > PlayerParticles.getPlugin().getConfig().getInt("max-fixed-effects")) {
if (ConfigManager.getInstance().getNumberOfFixedEffectsForPlayer(p.getUniqueId()) >= PlayerParticles.getPlugin().getConfig().getInt("max-fixed-effects")) {
}

View file

@ -165,6 +165,7 @@ public enum ParticleEffect {
/**
* Determine if this particle effect has a specific property
*
* @param property The property to check
* @return Whether it has the property or not
*/
public boolean hasProperty(ParticleProperty property) {
@ -185,7 +186,7 @@ public enum ParticleEffect {
}
/**
* Returns a List<ParticleEffect> of all supported effects for the server
* Returns a ParticleEffect List of all supported effects for the server
* version
*
* @return Supported effects
@ -245,6 +246,7 @@ public enum ParticleEffect {
* exceeds 256
*
* @param location Location to check
* @param players The list of players to check against
* @return Whether the distance exceeds 256 or not
*/
private static boolean isLongDistance(Location location, List<Player> players) {
@ -395,9 +397,6 @@ public enum ParticleEffect {
* @throws IllegalArgumentException If the particle effect is not
* directional or if it requires water and none is at the center
* location
* @see ParticlePacket#ParticlePacket(ParticleEffect, Vector, float,
* boolean, ParticleData)
* @see ParticlePacket#sendTo(Location, double)
*/
public void display(Vector direction, float speed, Location center, double range) throws ParticleVersionException, ParticleDataException, IllegalArgumentException {
if (!isSupported()) {
@ -430,9 +429,6 @@ public enum ParticleEffect {
* @throws IllegalArgumentException If the particle effect is not
* directional or if it requires water and none is at the center
* location
* @see ParticlePacket#ParticlePacket(ParticleEffect, Vector, float,
* boolean, ParticleData)
* @see ParticlePacket#sendTo(Location, List)
*/
public void display(Vector direction, float speed, Location center, List<Player> players) throws ParticleVersionException, ParticleDataException, IllegalArgumentException {
if (!isSupported()) {
@ -482,9 +478,6 @@ public enum ParticleEffect {
* by the server version
* @throws ParticleColorException If the particle effect is not colorable or
* the color type is incorrect
* @see ParticlePacket#ParticlePacket(ParticleEffect, ParticleColor,
* boolean)
* @see ParticlePacket#sendTo(Location, double)
*/
public void display(ParticleColor color, Location center, double range) throws ParticleVersionException, ParticleColorException {
if (!isSupported()) {
@ -510,9 +503,6 @@ public enum ParticleEffect {
* by the server version
* @throws ParticleColorException If the particle effect is not colorable or
* the color type is incorrect
* @see ParticlePacket#ParticlePacket(ParticleEffect, ParticleColor,
* boolean)
* @see ParticlePacket#sendTo(Location, List)
*/
public void display(ParticleColor color, Location center, List<Player> players) throws ParticleVersionException, ParticleColorException {
if (!isSupported()) {
@ -828,7 +818,6 @@ public enum ParticleEffect {
*
* @param material Material of the item
* @param data Data value of the item
* @see ParticleData#ParticleData(Material, byte)
*/
public ItemData(Material material, byte data) {
super(material, data);
@ -852,7 +841,6 @@ public enum ParticleEffect {
* @param material Material of the block
* @param data Data value of the block
* @throws IllegalArgumentException If the material is not a block
* @see ParticleData#ParticleData(Material, byte)
*/
public BlockData(Material material, byte data) throws IllegalArgumentException {
super(material, data);
@ -863,8 +851,8 @@ public enum ParticleEffect {
}
/**
* Represents the color for effects like {@link ParticleEffect#SPELL_MOB},
* {@link ParticleEffect#SPELL_MOB_AMBIENT}, {@link ParticleEffect#REDSTONE}
* Represents the color for effects like {@link ParticleEffect#MOB_SPELL},
* {@link ParticleEffect#MOB_SPELL_AMBIENT}, {@link ParticleEffect#RED_DUST}
* and {@link ParticleEffect#NOTE}
* <p>
* This class is part of the <b>ParticleEffect Library</b> and follows the
@ -897,8 +885,8 @@ public enum ParticleEffect {
}
/**
* Represents the color for effects like {@link ParticleEffect#SPELL_MOB},
* {@link ParticleEffect#SPELL_MOB_AMBIENT} and {@link ParticleEffect#NOTE}
* Represents the color for effects like {@link ParticleEffect#MOB_SPELL},
* {@link ParticleEffect#MOB_SPELL_AMBIENT} and {@link ParticleEffect#NOTE}
* <p>
* This class is part of the <b>ParticleEffect Library</b> and follows the
* same usage conditions
@ -1223,8 +1211,6 @@ public enum ParticleEffect {
* increased from 256 to 65536
* @param data Data of the effect
* @throws IllegalArgumentException If the speed is lower than 0
* @see #ParticleEffect(ParticleEffect, float, float, float, float, int,
* boolean, ParticleData)
*/
public ParticlePacket(ParticleEffect effect, Vector direction, float speed, boolean longDistance, ParticleData data) throws IllegalArgumentException {
this(effect, (float) direction.getX(), (float) direction.getY(), (float) direction.getZ(), speed, 0, longDistance, data);
@ -1237,8 +1223,6 @@ public enum ParticleEffect {
* @param color Color of the particle
* @param longDistance Indicates whether the maximum distance is
* increased from 256 to 65536
* @see #ParticleEffect(ParticleEffect, float, float, float, float, int,
* boolean, ParticleData)
*/
public ParticlePacket(ParticleEffect effect, ParticleColor color, boolean longDistance) {
this(effect, color.getValueX(), color.getValueY(), color.getValueZ(), 1, 0, longDistance, null);

View file

@ -71,8 +71,6 @@ public final class ReflectionUtils {
* @throws ClassNotFoundException ClassNotFoundException If the desired
* target class with the specified name and package cannot be
* found
* @see #getClass(String, PackageType)
* @see #getConstructor(Class, Class...)
*/
public static Constructor<?> getConstructor(String className, PackageType packageType, Class<?>... parameterTypes) throws NoSuchMethodException, ClassNotFoundException {
return getConstructor(packageType.getClass(className), parameterTypes);
@ -125,8 +123,6 @@ public final class ReflectionUtils {
* specified arguments cannot be found
* @throws ClassNotFoundException If the desired target class with the
* specified name and package cannot be found
* @see #getClass(String, PackageType)
* @see #instantiateObject(Class, Object...)
*/
public static Object instantiateObject(String className, PackageType packageType, Object... arguments) throws InstantiationException, IllegalAccessException, IllegalArgumentException, InvocationTargetException, NoSuchMethodException, ClassNotFoundException {
return instantiateObject(packageType.getClass(className), arguments);
@ -170,8 +166,6 @@ public final class ReflectionUtils {
* found
* @throws ClassNotFoundException If the desired target class with the
* specified name and package cannot be found
* @see #getClass(String, PackageType)
* @see #getMethod(Class, String, Class...)
*/
public static Method getMethod(String className, PackageType packageType, String methodName, Class<?>... parameterTypes) throws NoSuchMethodException, ClassNotFoundException {
return getMethod(packageType.getClass(className), methodName, parameterTypes);
@ -195,8 +189,6 @@ public final class ReflectionUtils {
* @throws NoSuchMethodException If the desired method of the class of the
* target object with the specified name and arguments cannot be
* found
* @see #getMethod(Class, String, Class...)
* @see DataType#getPrimitive(Object[])
*/
public static Object invokeMethod(Object instance, String methodName, Object... arguments) throws IllegalAccessException, IllegalArgumentException, InvocationTargetException, NoSuchMethodException {
return getMethod(instance.getClass(), methodName, DataType.getPrimitive(arguments)).invoke(instance, arguments);
@ -249,8 +241,6 @@ public final class ReflectionUtils {
* class with the specified name and arguments cannot be found
* @throws ClassNotFoundException If the desired target class with the
* specified name and package cannot be found
* @see #getClass(String, PackageType)
* @see #invokeMethod(Object, Class, String, Object...)
*/
public static Object invokeMethod(Object instance, String className, PackageType packageType, String methodName, Object... arguments) throws IllegalAccessException, IllegalArgumentException, InvocationTargetException, NoSuchMethodException, ClassNotFoundException {
return invokeMethod(instance, packageType.getClass(className), methodName, arguments);
@ -607,7 +597,7 @@ public final class ReflectionUtils {
/**
* Returns the primitive class array of the given object array
*
* @param object Given object array
* @param objects Given object array
* @return The primitive class array
*/
public static Class<?>[] getPrimitive(Object[] objects) {
@ -622,7 +612,7 @@ public final class ReflectionUtils {
/**
* Returns the reference class array of the given object array
*
* @param object Given object array
* @param objects Given object array
* @return The reference class array
*/
public static Class<?>[] getReference(Object[] objects) {

View file

@ -94,6 +94,10 @@ public class ConfigManager {
/**
* Gets a player from the save data, creates one if it doesn't exist and adds it to the list
*
* @param playerUUID The pplayer to get
* @param addIfNotFound Adds the pplayer to the processing queue if they are not already in it
* @return The found pplayer, or a newly generated one
*/
public PPlayer getPPlayer(UUID playerUUID, boolean addIfNotFound) {
for (PPlayer pp : ParticleManager.particlePlayers) {
@ -114,7 +118,7 @@ public class ConfigManager {
* One will be created if it doesn't exist
*
* @param playerUUID The UUID to match the PPlayer to
* @return
* @return A newly built pplayer
*/
private PPlayer buildPPlayer(UUID playerUUID) {
if (!PlayerParticles.useMySQL) {
@ -254,7 +258,7 @@ public class ConfigManager {
* Resets all saved information about a PPlayer
* This should be made into a single batch query in the future
*
* @param playerUUID
* @param playerUUID The pplayer to reset
*/
public void resetPPlayer(UUID playerUUID) {
PPlayer pplayer = PPlayer.getNewPPlayer(playerUUID);
@ -270,7 +274,7 @@ public class ConfigManager {
* Saves the effect to the player's save file or database entry
*
* @param playerUUID The UUID of the player
* @param particleStyle The effect that is being saved
* @param particleEffect The effect that is being saved
*/
public void savePPlayer(UUID playerUUID, ParticleEffect particleEffect) {
if (!PlayerParticles.useMySQL) {
@ -628,6 +632,12 @@ public class ConfigManager {
return null; // Something went wrong somewhere
}
/**
* Gets the number of fixed effects a player has created
*
* @param pplayerUUID The player to check
* @return The number of fixed effects the player has created
*/
public int getNumberOfFixedEffectsForPlayer(UUID pplayerUUID) {
if (!PlayerParticles.useMySQL) {
if (config.isConfigurationSection(pplayerUUID.toString() + ".fixedEffect")) {

View file

@ -52,6 +52,7 @@ public class MessageManager {
// Fixed Effects
NO_PERMISSION_FIXED("message-no-permission-fixed"),
MAX_FIXED_EFFECTS_REACHED("message-max-fixed-effects-reached"),
INVALID_FIXED_COMMAND("message-invalid-fixed-command"),
FIXED_COMMAND_DESC_CREATE("message-fixed-command-desc-create"),
FIXED_COMMAND_DESC_REMOVE("message-fixed-command-desc-remove"),
@ -163,7 +164,7 @@ public class MessageManager {
}
/**
* Translates all & symbols into the Minecraft chat color symbol
* Translates all ampersand symbols into the Minecraft chat color symbol
*
* @param message The input
* @return The output, parsed

View file

@ -245,7 +245,7 @@ public class ParticleManager extends BukkitRunnable implements Listener {
* An alternative method used for custom handled styles
*
* @param pplayer The PPlayer to use for getting particle settings
* @param location The location to display at
* @param particles The particles to display
*/
public static void displayParticles(PPlayer pplayer, PParticle[] particles) {
ParticleEffect effect = pplayer.getParticleEffect();

View file

@ -40,8 +40,8 @@ public class PermissionManager {
* Always returns true for 'none' so they can be reset
*
* @param player The player to check the permission for
* @param effect The style to check
* @return True if the player has permission to use the style
* @param style The style to check
* @return If the player has permission to use the style
*/
public static boolean hasStylePermission(Player player, ParticleStyle style) {
if (player.hasPermission("playerparticles.*") || player.hasPermission("playerparticles.style.*")) return true;
@ -51,10 +51,10 @@ public class PermissionManager {
}
/**
* Gets a List<String> of all effect names a player has permission for
* Gets a String List of all effect names a player has permission for
*
* @param p The player to get effect names for
* @return A List<String> of all effect names the given player has permission for
* @return A String List of all effect names the given player has permission for
*/
public static List<String> getParticlesUserHasPermissionFor(Player p) {
List<String> list = new ArrayList<String>();
@ -65,10 +65,10 @@ public class PermissionManager {
}
/**
* Gets a List<String> of all style names a player has permission for
* Gets a String List of all style names a player has permission for
*
* @param p The player to get style names for
* @return A List<String> of all style names the given player has permission for
* @return A String List of all style names the given player has permission for
*/
public static List<String> getStylesUserHasPermissionFor(Player p) {
List<String> list = new ArrayList<String>();

View file

@ -53,7 +53,7 @@ public class ParticleStyleArrows implements ParticleStyle, Listener {
* The event used to get all arrows fired by players
* Adds all arrows fired from players to the array
*
* @param e
* @param e The EntityShootBowEvent
*/
@EventHandler
public void onArrowFired(EntityShootBowEvent e) {

View file

@ -65,7 +65,7 @@ public class ParticleStyleManager {
/**
* Gets the ParticleStyle with the name given, returns null if not found
*
* @param particle The string of the style to search for
* @param styleName The string of the style to search for
* @return The ParticleStyle with the name requested
*/
public static ParticleStyle styleFromString(String styleName) {

View file

@ -148,8 +148,8 @@ public final class VectorUtils {
/**
* Gets the angle toward the X axis
*
* @param vector
* @return
* @param vector The vector to check
* @return The angle toward the X axis
*/
public static final double angleToXAxis(Vector vector) {
return Math.atan2(vector.getX(), vector.getY());

View file

@ -209,6 +209,10 @@ message-failed-execute-no-permission: '&cFailed to execute command for &b{TYPE}&
# Default: '&cYou do not have permission to use fixed effects!'
message-no-permission-fixed: '&cYou do not have permission to use fixed effects!'
# Reached Max Allowed
# Default: '&cYou have reached the maximum allowed fixed effects!'
message-max-fixed-effects-reached: '&cYou have reached the maximum allowed fixed effects!'
# Invalid Fixed Command
# Default: '&cInvalid sub-command for &b/pp fixed&c!'
message-invalid-fixed-command: '&cInvalid subcommand for &b/pp fixed&c! &eCommands: '