My formatter picked this up

This commit is contained in:
TfT_02 2013-10-18 15:37:00 +02:00
parent e8e2dcff46
commit c211874a27
65 changed files with 472 additions and 278 deletions

View File

@ -73,6 +73,7 @@ public final class ChatAPI {
* Check if a player is currently talking in party chat. * Check if a player is currently talking in party chat.
* *
* @param player The player to check * @param player The player to check
*
* @return true if the player is using party chat, false otherwise * @return true if the player is using party chat, false otherwise
*/ */
public static boolean isUsingPartyChat(Player player) { public static boolean isUsingPartyChat(Player player) {
@ -83,6 +84,7 @@ public final class ChatAPI {
* Check if a player is currently talking in party chat. * Check if a player is currently talking in party chat.
* *
* @param playerName The name of the player to check * @param playerName The name of the player to check
*
* @return true if the player is using party chat, false otherwise * @return true if the player is using party chat, false otherwise
*/ */
public static boolean isUsingPartyChat(String playerName) { public static boolean isUsingPartyChat(String playerName) {
@ -93,6 +95,7 @@ public final class ChatAPI {
* Check if a player is currently talking in admin chat. * Check if a player is currently talking in admin chat.
* *
* @param player The player to check * @param player The player to check
*
* @return true if the player is using admin chat, false otherwise * @return true if the player is using admin chat, false otherwise
*/ */
public static boolean isUsingAdminChat(Player player) { public static boolean isUsingAdminChat(Player player) {
@ -103,6 +106,7 @@ public final class ChatAPI {
* Check if a player is currently talking in admin chat. * Check if a player is currently talking in admin chat.
* *
* @param playerName The name of the player to check * @param playerName The name of the player to check
*
* @return true if the player is using admin chat, false otherwise * @return true if the player is using admin chat, false otherwise
*/ */
public static boolean isUsingAdminChat(String playerName) { public static boolean isUsingAdminChat(String playerName) {

View File

@ -24,6 +24,7 @@ public final class ExperienceAPI {
* This function is designed for API usage. * This function is designed for API usage.
* *
* @param skillType A string that may or may not be a skill * @param skillType A string that may or may not be a skill
*
* @return true if this is a valid mcMMO skill * @return true if this is a valid mcMMO skill
*/ */
public static boolean isValidSkillType(String skillType) { public static boolean isValidSkillType(String skillType) {
@ -38,12 +39,15 @@ public final class ExperienceAPI {
* This function is designed for API usage. * This function is designed for API usage.
* *
* @param skillType the skill to check * @param skillType the skill to check
*
* @return true if this is a valid, non-child mcMMO skill * @return true if this is a valid, non-child mcMMO skill
*/ */
public static boolean isNonChildSkill(String skillType) { public static boolean isNonChildSkill(String skillType) {
SkillType skill = SkillType.getSkill(skillType); SkillType skill = SkillType.getSkill(skillType);
if (skill == null) return false; if (skill == null) {
return false;
}
return !skill.isChildSkill(); return !skill.isChildSkill();
} }
@ -178,6 +182,7 @@ public final class ExperienceAPI {
* *
* @param player The player to get XP for * @param player The player to get XP for
* @param skillType The skill to get XP for * @param skillType The skill to get XP for
*
* @return the amount of XP in a given skill * @return the amount of XP in a given skill
* *
* @throws InvalidSkillException if the given skill is not valid * @throws InvalidSkillException if the given skill is not valid
@ -194,6 +199,7 @@ public final class ExperienceAPI {
* *
* @param playerName The player to get XP for * @param playerName The player to get XP for
* @param skillType The skill to get XP for * @param skillType The skill to get XP for
*
* @return the amount of XP in a given skill * @return the amount of XP in a given skill
* *
* @throws InvalidSkillException if the given skill is not valid * @throws InvalidSkillException if the given skill is not valid
@ -211,6 +217,7 @@ public final class ExperienceAPI {
* *
* @param player The player to get XP for * @param player The player to get XP for
* @param skillType The skill to get XP for * @param skillType The skill to get XP for
*
* @return the amount of XP in a given skill * @return the amount of XP in a given skill
* *
* @throws InvalidSkillException if the given skill is not valid * @throws InvalidSkillException if the given skill is not valid
@ -227,6 +234,7 @@ public final class ExperienceAPI {
* *
* @param playerName The player to get XP for * @param playerName The player to get XP for
* @param skillType The skill to get XP for * @param skillType The skill to get XP for
*
* @return the amount of XP in a given skill * @return the amount of XP in a given skill
* *
* @throws InvalidSkillException if the given skill is not valid * @throws InvalidSkillException if the given skill is not valid
@ -244,6 +252,7 @@ public final class ExperienceAPI {
* *
* @param player The player to get the XP amount for * @param player The player to get the XP amount for
* @param skillType The skill to get the XP amount for * @param skillType The skill to get the XP amount for
*
* @return the total amount of XP needed to reach the next level * @return the total amount of XP needed to reach the next level
* *
* @throws InvalidSkillException if the given skill is not valid * @throws InvalidSkillException if the given skill is not valid
@ -260,6 +269,7 @@ public final class ExperienceAPI {
* *
* @param playerName The player to get XP for * @param playerName The player to get XP for
* @param skillType The skill to get XP for * @param skillType The skill to get XP for
*
* @return the total amount of XP needed to reach the next level * @return the total amount of XP needed to reach the next level
* *
* @throws InvalidSkillException if the given skill is not valid * @throws InvalidSkillException if the given skill is not valid
@ -277,6 +287,7 @@ public final class ExperienceAPI {
* *
* @param player The player to get the XP amount for * @param player The player to get the XP amount for
* @param skillType The skill to get the XP amount for * @param skillType The skill to get the XP amount for
*
* @return the amount of XP remaining until the next level * @return the amount of XP remaining until the next level
* *
* @throws InvalidSkillException if the given skill is not valid * @throws InvalidSkillException if the given skill is not valid
@ -297,6 +308,7 @@ public final class ExperienceAPI {
* *
* @param playerName The player to get XP for * @param playerName The player to get XP for
* @param skillType The skill to get XP for * @param skillType The skill to get XP for
*
* @return the amount of XP needed to reach the next level * @return the amount of XP needed to reach the next level
* *
* @throws InvalidSkillException if the given skill is not valid * @throws InvalidSkillException if the given skill is not valid
@ -364,6 +376,7 @@ public final class ExperienceAPI {
* *
* @param player The player to get the level for * @param player The player to get the level for
* @param skillType The skill to get the level for * @param skillType The skill to get the level for
*
* @return the level of a given skill * @return the level of a given skill
* *
* @throws InvalidSkillException if the given skill is not valid * @throws InvalidSkillException if the given skill is not valid
@ -379,6 +392,7 @@ public final class ExperienceAPI {
* *
* @param playerName The player to get the level for * @param playerName The player to get the level for
* @param skillType The skill to get the level for * @param skillType The skill to get the level for
*
* @return the level of a given skill * @return the level of a given skill
* *
* @throws InvalidSkillException if the given skill is not valid * @throws InvalidSkillException if the given skill is not valid
@ -394,6 +408,7 @@ public final class ExperienceAPI {
* This function is designed for API usage. * This function is designed for API usage.
* *
* @param player The player to get the power level for * @param player The player to get the power level for
*
* @return the power level of the player * @return the power level of the player
*/ */
public static int getPowerLevel(Player player) { public static int getPowerLevel(Player player) {
@ -406,6 +421,7 @@ public final class ExperienceAPI {
* This function is designed for API usage. * This function is designed for API usage.
* *
* @param playerName The player to get the power level for * @param playerName The player to get the power level for
*
* @return the power level of the player * @return the power level of the player
* *
* @throws InvalidPlayerException if the given player does not exist in the database * @throws InvalidPlayerException if the given player does not exist in the database
@ -427,6 +443,7 @@ public final class ExperienceAPI {
* This function is designed for API usage. * This function is designed for API usage.
* *
* @param skillType The skill to get the level cap for * @param skillType The skill to get the level cap for
*
* @return the level cap of a given skill * @return the level cap of a given skill
* *
* @throws InvalidSkillException if the given skill is not valid * @throws InvalidSkillException if the given skill is not valid
@ -454,11 +471,11 @@ public final class ExperienceAPI {
* @param playerName The name of the player to check * @param playerName The name of the player to check
* @param skillType The skill to check * @param skillType The skill to check
* *
* @return the position on the leaderboard
*
* @throws InvalidSkillException if the given skill is not valid * @throws InvalidSkillException if the given skill is not valid
* @throws InvalidPlayerException if the given player does not exist in the database * @throws InvalidPlayerException if the given player does not exist in the database
* @throws UnsupportedOperationException if the given skill is a child skill * @throws UnsupportedOperationException if the given skill is a child skill
*
* @return the position on the leaderboard
*/ */
public static int getPlayerRankSkill(String playerName, String skillType) { public static int getPlayerRankSkill(String playerName, String skillType) {
return mcMMO.getDatabaseManager().readRank(getOfflineProfile(playerName).getPlayerName()).get(getNonChildSkillType(skillType).toString()); return mcMMO.getDatabaseManager().readRank(getOfflineProfile(playerName).getPlayerName()).get(getNonChildSkillType(skillType).toString());
@ -472,9 +489,9 @@ public final class ExperienceAPI {
* *
* @param playerName The name of the player to check * @param playerName The name of the player to check
* *
* @throws InvalidPlayerException if the given player does not exist in the database
*
* @return the position on the power level leaderboard * @return the position on the power level leaderboard
*
* @throws InvalidPlayerException if the given player does not exist in the database
*/ */
public static int getPlayerRankOverall(String playerName) { public static int getPlayerRankOverall(String playerName) {
return mcMMO.getDatabaseManager().readRank(getOfflineProfile(playerName).getPlayerName()).get("ALL"); return mcMMO.getDatabaseManager().readRank(getOfflineProfile(playerName).getPlayerName()).get("ALL");

View File

@ -21,6 +21,7 @@ public final class PartyAPI {
* This function is designed for API usage. * This function is designed for API usage.
* *
* @param player The player to check the party name of * @param player The player to check the party name of
*
* @return the name of the player's party, or null if not in a party * @return the name of the player's party, or null if not in a party
*/ */
public static String getPartyName(Player player) { public static String getPartyName(Player player) {
@ -37,6 +38,7 @@ public final class PartyAPI {
* This function is designed for API usage. * This function is designed for API usage.
* *
* @param player The player to check * @param player The player to check
*
* @return true if the player is in a party, false otherwise * @return true if the player is in a party, false otherwise
*/ */
public static boolean inParty(Player player) { public static boolean inParty(Player player) {
@ -50,6 +52,7 @@ public final class PartyAPI {
* *
* @param playera The first player to check * @param playera The first player to check
* @param playerb The second player to check * @param playerb The second player to check
*
* @return true if the two players are in the same party, false otherwise * @return true if the two players are in the same party, false otherwise
*/ */
public static boolean inSameParty(Player playera, Player playerb) { public static boolean inSameParty(Player playera, Player playerb) {
@ -102,6 +105,7 @@ public final class PartyAPI {
* This function is designed for API usage. * This function is designed for API usage.
* *
* @param partyName The party name * @param partyName The party name
*
* @return the leader of the party * @return the leader of the party
*/ */
public static String getPartyLeader(String partyName) { public static String getPartyLeader(String partyName) {
@ -126,6 +130,7 @@ public final class PartyAPI {
* This function is designed for API usage. * This function is designed for API usage.
* *
* @param player The player to check * @param player The player to check
*
* @return all the players in the player's party * @return all the players in the player's party
*/ */
@Deprecated @Deprecated
@ -145,6 +150,7 @@ public final class PartyAPI {
* This function is designed for API usage. * This function is designed for API usage.
* *
* @param player The player to check * @param player The player to check
*
* @return all the player names in the player's party * @return all the player names in the player's party
*/ */
public static LinkedHashSet<String> getMembers(Player player) { public static LinkedHashSet<String> getMembers(Player player) {
@ -157,6 +163,7 @@ public final class PartyAPI {
* This function is designed for API usage. * This function is designed for API usage.
* *
* @param partyName The party to check * @param partyName The party to check
*
* @return all online players in this party * @return all online players in this party
*/ */
public static List<Player> getOnlineMembers(String partyName) { public static List<Player> getOnlineMembers(String partyName) {
@ -169,6 +176,7 @@ public final class PartyAPI {
* This function is designed for API usage. * This function is designed for API usage.
* *
* @param player The player to check * @param player The player to check
*
* @return all online players in the player's party * @return all online players in the player's party
*/ */
public static List<Player> getOnlineMembers(Player player) { public static List<Player> getOnlineMembers(Player player) {

View File

@ -15,6 +15,7 @@ import com.gmail.nossr50.datatypes.player.PlayerProfile;
import com.gmail.nossr50.locale.LocaleLoader; import com.gmail.nossr50.locale.LocaleLoader;
import com.gmail.nossr50.util.commands.CommandUtils; import com.gmail.nossr50.util.commands.CommandUtils;
import com.gmail.nossr50.util.player.UserManager; import com.gmail.nossr50.util.player.UserManager;
import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableList;
public class MobhealthCommand implements TabExecutor { public class MobhealthCommand implements TabExecutor {

View File

@ -80,7 +80,10 @@ public abstract class ToggleCommand implements TabExecutor {
} }
protected abstract boolean hasOtherPermission(CommandSender sender); protected abstract boolean hasOtherPermission(CommandSender sender);
protected abstract boolean hasSelfPermission(CommandSender sender); protected abstract boolean hasSelfPermission(CommandSender sender);
protected abstract void applyCommandAction(); protected abstract void applyCommandAction();
protected abstract void sendSuccessMessage(CommandSender sender); protected abstract void sendSuccessMessage(CommandSender sender);
} }

View File

@ -108,9 +108,13 @@ public abstract class ExperienceCommand implements TabExecutor {
} }
protected abstract boolean permissionsCheckSelf(CommandSender sender); protected abstract boolean permissionsCheckSelf(CommandSender sender);
protected abstract boolean permissionsCheckOthers(CommandSender sender); protected abstract boolean permissionsCheckOthers(CommandSender sender);
protected abstract void handleCommand(SkillType skill); protected abstract void handleCommand(SkillType skill);
protected abstract void handlePlayerMessageAll(); protected abstract void handlePlayerMessageAll();
protected abstract void handlePlayerMessageSkill(); protected abstract void handlePlayerMessageSkill();
private boolean validateArguments(CommandSender sender, String skillName, String value) { private boolean validateArguments(CommandSender sender, String skillName, String value) {

View File

@ -129,10 +129,15 @@ public abstract class HardcoreModeCommand implements TabExecutor {
} }
protected abstract boolean checkTogglePermissions(); protected abstract boolean checkTogglePermissions();
protected abstract boolean checkModifyPermissions(); protected abstract boolean checkModifyPermissions();
protected abstract boolean checkEnabled(String skill); protected abstract boolean checkEnabled(String skill);
protected abstract void enable(String skill); protected abstract void enable(String skill);
protected abstract void disable(String skill); protected abstract void disable(String skill);
protected abstract void modify(); protected abstract void modify();
private boolean isInvalidPercentage(CommandSender sender, String value) { private boolean isInvalidPercentage(CommandSender sender, String value) {

View File

@ -150,7 +150,7 @@ public abstract class SkillCommand implements TabExecutor {
length = Math.min(length, maxLength); length = Math.min(length, maxLength);
} }
return new String[] { String.valueOf(length), String.valueOf(enduranceLength) }; return new String[]{String.valueOf(length), String.valueOf(enduranceLength)};
} }
protected void luckyEffectsDisplay() { protected void luckyEffectsDisplay() {

View File

@ -26,6 +26,7 @@ public interface DatabaseManager {
* Remove a user from the database. * Remove a user from the database.
* *
* @param playerName The name of the user to remove * @param playerName The name of the user to remove
*
* @return true if the user was successfully removed, false otherwise * @return true if the user was successfully removed, false otherwise
*/ */
public boolean removeUser(String playerName); public boolean removeUser(String playerName);
@ -34,6 +35,7 @@ public interface DatabaseManager {
* Save a user to the database. * Save a user to the database.
* *
* @param profile The profile of the player to save * @param profile The profile of the player to save
*
* @return true if successful, false on failure * @return true if successful, false on failure
*/ */
public boolean saveUser(PlayerProfile profile); public boolean saveUser(PlayerProfile profile);
@ -44,6 +46,7 @@ public interface DatabaseManager {
* @param skillName The skill to retrieve info on * @param skillName The skill to retrieve info on
* @param pageNumber Which page in the leaderboards to retrieve * @param pageNumber Which page in the leaderboards to retrieve
* @param statsPerPage The number of stats per page * @param statsPerPage The number of stats per page
*
* @return the requested leaderboard information * @return the requested leaderboard information
*/ */
public List<PlayerStat> readLeaderboard(String skillName, int pageNumber, int statsPerPage); public List<PlayerStat> readLeaderboard(String skillName, int pageNumber, int statsPerPage);
@ -52,6 +55,7 @@ public interface DatabaseManager {
* Retrieve rank info. * Retrieve rank info.
* *
* @param playerName The name of the user to retrieve the rankings for * @param playerName The name of the user to retrieve the rankings for
*
* @return the requested rank information * @return the requested rank information
*/ */
public Map<String, Integer> readRank(String playerName); public Map<String, Integer> readRank(String playerName);
@ -69,6 +73,7 @@ public interface DatabaseManager {
* @param playerName The name of the player to load from the database * @param playerName The name of the player to load from the database
* @param createNew Whether to create a new record if the player is not * @param createNew Whether to create a new record if the player is not
* found * found
*
* @return The player's data, or an unloaded PlayerProfile if not found * @return The player's data, or an unloaded PlayerProfile if not found
* and createNew is false * and createNew is false
*/ */

View File

@ -478,11 +478,11 @@ public final class SQLDatabaseManager implements DatabaseManager {
/** /**
* Check connection status and re-establish if dead or stale. * Check connection status and re-establish if dead or stale.
* * <p/>
* If the very first immediate attempt fails, further attempts * If the very first immediate attempt fails, further attempts
* will be made in progressively larger intervals up to MAX_WAIT * will be made in progressively larger intervals up to MAX_WAIT
* intervals. * intervals.
* * <p/>
* This allows for MySQL to time out idle connections as needed by * This allows for MySQL to time out idle connections as needed by
* server operator, without affecting McMMO, while still providing * server operator, without affecting McMMO, while still providing
* protection against a database outage taking down Bukkit's tick * protection against a database outage taking down Bukkit's tick
@ -846,6 +846,7 @@ public final class SQLDatabaseManager implements DatabaseManager {
* Attempt to write the SQL query. * Attempt to write the SQL query.
* *
* @param sql Query to write. * @param sql Query to write.
*
* @return true if the query was successfully written, false otherwise. * @return true if the query was successfully written, false otherwise.
*/ */
private boolean write(String sql) { private boolean write(String sql) {
@ -881,6 +882,7 @@ public final class SQLDatabaseManager implements DatabaseManager {
* Returns the number of rows affected by either a DELETE or UPDATE query * Returns the number of rows affected by either a DELETE or UPDATE query
* *
* @param sql SQL query to execute * @param sql SQL query to execute
*
* @return the number of rows affected * @return the number of rows affected
*/ */
private int update(String sql) { private int update(String sql) {
@ -915,6 +917,7 @@ public final class SQLDatabaseManager implements DatabaseManager {
* Read SQL query. * Read SQL query.
* *
* @param sql SQL query to read * @param sql SQL query to read
*
* @return the rows in this SQL query * @return the rows in this SQL query
*/ */
private HashMap<Integer, ArrayList<String>> read(String sql) { private HashMap<Integer, ArrayList<String>> read(String sql) {
@ -960,6 +963,7 @@ public final class SQLDatabaseManager implements DatabaseManager {
* Get the Integer. Only return first row / first field. * Get the Integer. Only return first row / first field.
* *
* @param statement SQL query to execute * @param statement SQL query to execute
*
* @return the value in the first row / first field * @return the value in the first row / first field
*/ */
private int readInt(PreparedStatement statement) { private int readInt(PreparedStatement statement) {
@ -1103,6 +1107,7 @@ public final class SQLDatabaseManager implements DatabaseManager {
* Retrieve the database id for a player * Retrieve the database id for a player
* *
* @param playerName The name of the user to retrieve the id for * @param playerName The name of the user to retrieve the id for
*
* @return the requested id or -1 if not found * @return the requested id or -1 if not found
*/ */
private int readId(String playerName) { private int readId(String playerName) {

View File

@ -7,6 +7,5 @@ public enum DatabaseUpdateType {
MOB_HEALTHBARS, MOB_HEALTHBARS,
PARTY_NAMES, PARTY_NAMES,
KILL_ORPHANS, KILL_ORPHANS,
DROPPED_SPOUT DROPPED_SPOUT;
;
} }

View File

@ -266,6 +266,7 @@ public class McMMOPlayer {
* Get the mode of an ability. * Get the mode of an ability.
* *
* @param ability The ability to check * @param ability The ability to check
*
* @return true if the ability is enabled, false otherwise * @return true if the ability is enabled, false otherwise
*/ */
public boolean getAbilityMode(AbilityType ability) { public boolean getAbilityMode(AbilityType ability) {
@ -286,6 +287,7 @@ public class McMMOPlayer {
* Get the informed state of an ability * Get the informed state of an ability
* *
* @param ability The ability to check * @param ability The ability to check
*
* @return true if the ability is informed, false otherwise * @return true if the ability is informed, false otherwise
*/ */
public boolean getAbilityInformed(AbilityType ability) { public boolean getAbilityInformed(AbilityType ability) {
@ -306,6 +308,7 @@ public class McMMOPlayer {
* Get the current prep mode of a tool. * Get the current prep mode of a tool.
* *
* @param tool Tool to get the mode for * @param tool Tool to get the mode for
*
* @return true if the tool is prepped, false otherwise * @return true if the tool is prepped, false otherwise
*/ */
public boolean getToolPreparationMode(ToolType tool) { public boolean getToolPreparationMode(ToolType tool) {
@ -347,6 +350,7 @@ public class McMMOPlayer {
* Get the current prep ATS of a tool. * Get the current prep ATS of a tool.
* *
* @param tool Tool to get the ATS for * @param tool Tool to get the ATS for
*
* @return the ATS for the tool * @return the ATS for the tool
*/ */
public long getToolPreparationATS(ToolType tool) { public long getToolPreparationATS(ToolType tool) {
@ -782,6 +786,7 @@ public class McMMOPlayer {
* *
* @param skillType Skill being used * @param skillType Skill being used
* @param xp Experience amount to process * @param xp Experience amount to process
*
* @return Modified experience * @return Modified experience
*/ */
private float modifyXpGain(SkillType skillType, float xp) { private float modifyXpGain(SkillType skillType, float xp) {

View File

@ -116,6 +116,7 @@ public class PlayerProfile {
* Get the current DATS of a skill. * Get the current DATS of a skill.
* *
* @param abilityType Ability to get the DATS for * @param abilityType Ability to get the DATS for
*
* @return the DATS for the ability * @return the DATS for the ability
*/ */
public long getSkillDATS(AbilityType abilityType) { public long getSkillDATS(AbilityType abilityType) {
@ -247,6 +248,7 @@ public class PlayerProfile {
* Get the total amount of Xp before the next level. * Get the total amount of Xp before the next level.
* *
* @param skillType Type of skill to check * @param skillType Type of skill to check
*
* @return the total amount of Xp until next level * @return the total amount of Xp until next level
*/ */
public int getXpToLevel(SkillType skillType) { public int getXpToLevel(SkillType skillType) {

View File

@ -150,6 +150,7 @@ public enum AbilityType {
* Get the permissions for this ability. * Get the permissions for this ability.
* *
* @param player Player to check permissions for * @param player Player to check permissions for
*
* @return true if the player has permissions, false otherwise * @return true if the player has permissions, false otherwise
*/ */
public boolean getPermissions(Player player) { public boolean getPermissions(Player player) {
@ -193,6 +194,7 @@ public enum AbilityType {
* Check if a block is affected by this ability. * Check if a block is affected by this ability.
* *
* @param blockState the block to check * @param blockState the block to check
*
* @return true if the block is affected by this ability, false otherwise * @return true if the block is affected by this ability, false otherwise
*/ */
public boolean blockCheck(BlockState blockState) { public boolean blockCheck(BlockState blockState) {
@ -228,6 +230,7 @@ public enum AbilityType {
* *
* @param player The player using the ability * @param player The player using the ability
* @param block The block modified by the ability * @param block The block modified by the ability
*
* @return true if the ability should activate, false otherwise * @return true if the ability should activate, false otherwise
*/ */
public boolean triggerCheck(Player player, Block block) { public boolean triggerCheck(Player player, Block block) {

View File

@ -34,6 +34,7 @@ public enum ToolType {
* Check to see if the item is of the appropriate type. * Check to see if the item is of the appropriate type.
* *
* @param itemStack The item to check * @param itemStack The item to check
*
* @return true if the item is the right type, false otherwise * @return true if the item is the right type, false otherwise
*/ */
public boolean inHand(ItemStack itemStack) { public boolean inHand(ItemStack itemStack) {

View File

@ -69,7 +69,7 @@ public class PlayerListener implements Listener {
/** /**
* Monitor PlayerTeleportEvents. * Monitor PlayerTeleportEvents.
* <p> * <p/>
* These events are monitored for the purpose of setting the * These events are monitored for the purpose of setting the
* player's last teleportation timestamp, in order to prevent * player's last teleportation timestamp, in order to prevent
* possible Acrobatics exploitation. * possible Acrobatics exploitation.
@ -89,7 +89,7 @@ public class PlayerListener implements Listener {
/** /**
* Handle PlayerDeathEvents at the lowest priority. * Handle PlayerDeathEvents at the lowest priority.
* <p> * <p/>
* These events are used to modify the death message of a player when * These events are used to modify the death message of a player when
* needed to correct issues potentially caused by the custom naming used * needed to correct issues potentially caused by the custom naming used
* for mob healthbars. * for mob healthbars.
@ -115,7 +115,7 @@ public class PlayerListener implements Listener {
/** /**
* Monitor PlayerDeathEvents. * Monitor PlayerDeathEvents.
* <p> * <p/>
* These events are monitored for the purpose of dealing the penalties * These events are monitored for the purpose of dealing the penalties
* associated with hardcore and vampirism modes. If neither of these * associated with hardcore and vampirism modes. If neither of these
* modes are enabled, or if the player who died has hardcore bypass * modes are enabled, or if the player who died has hardcore bypass
@ -151,7 +151,7 @@ public class PlayerListener implements Listener {
/** /**
* Monitor PlayerChangedWorldEvents. * Monitor PlayerChangedWorldEvents.
* <p> * <p/>
* These events are monitored for the purpose of removing god mode or * These events are monitored for the purpose of removing god mode or
* player parties if they are not allowed on the world the player has * player parties if they are not allowed on the world the player has
* changed to. * changed to.
@ -174,7 +174,7 @@ public class PlayerListener implements Listener {
/** /**
* Monitor PlayerDropItemEvents. * Monitor PlayerDropItemEvents.
* <p> * <p/>
* These events are monitored for the purpose of flagging sharable * These events are monitored for the purpose of flagging sharable
* dropped items, as well as removing ability buffs from pickaxes * dropped items, as well as removing ability buffs from pickaxes
* and shovels. * and shovels.
@ -195,7 +195,7 @@ public class PlayerListener implements Listener {
/** /**
* Handle PlayerFishEvents at the highest priority. * Handle PlayerFishEvents at the highest priority.
* <p> * <p/>
* These events are used for the purpose of handling our anti-exploit * These events are used for the purpose of handling our anti-exploit
* code, as well as dealing with ice fishing. * code, as well as dealing with ice fishing.
* *
@ -240,7 +240,7 @@ public class PlayerListener implements Listener {
/** /**
* Monitor PlayerFishEvents. * Monitor PlayerFishEvents.
* <p> * <p/>
* These events are monitored for the purpose of handling the various * These events are monitored for the purpose of handling the various
* Fishing skills and abilities. * Fishing skills and abilities.
* *
@ -281,7 +281,7 @@ public class PlayerListener implements Listener {
/** /**
* Handle PlayerPickupItemEvents at the highest priority. * Handle PlayerPickupItemEvents at the highest priority.
* <p> * <p/>
* These events are used to handle item sharing between party members and * These events are used to handle item sharing between party members and
* are also used to handle item pickup for the Unarmed skill. * are also used to handle item pickup for the Unarmed skill.
* *
@ -322,7 +322,7 @@ public class PlayerListener implements Listener {
/** /**
* Monitor PlayerQuitEvents. * Monitor PlayerQuitEvents.
* <p> * <p/>
* These events are monitored for the purpose of resetting player * These events are monitored for the purpose of resetting player
* variables and other garbage collection tasks that must take place when * variables and other garbage collection tasks that must take place when
* a player exits the server. * a player exits the server.
@ -347,7 +347,7 @@ public class PlayerListener implements Listener {
/** /**
* Monitor PlayerJoinEvents. * Monitor PlayerJoinEvents.
* <p> * <p/>
* These events are monitored for the purpose of initializing player * These events are monitored for the purpose of initializing player
* variables, as well as handling the MOTD display and other important * variables, as well as handling the MOTD display and other important
* join messages. * join messages.
@ -381,7 +381,7 @@ public class PlayerListener implements Listener {
/** /**
* Monitor PlayerRespawnEvents. * Monitor PlayerRespawnEvents.
* <p> * <p/>
* These events are monitored for the purpose of setting the * These events are monitored for the purpose of setting the
* player's last respawn timestamp, in order to prevent * player's last respawn timestamp, in order to prevent
* possible exploitation. * possible exploitation.

View File

@ -14,7 +14,7 @@ public final class LocaleLoader {
private static ResourceBundle bundle = null; private static ResourceBundle bundle = null;
private static ResourceBundle enBundle = null; private static ResourceBundle enBundle = null;
private LocaleLoader() {}; private LocaleLoader() {}
public static String getString(String key) { public static String getString(String key) {
return getString(key, (Object[]) null); return getString(key, (Object[]) null);
@ -25,6 +25,7 @@ public final class LocaleLoader {
* *
* @param key The key to look up the string with * @param key The key to look up the string with
* @param messageArguments Any arguments to be added to the string * @param messageArguments Any arguments to be added to the string
*
* @return The properly formatted locale string * @return The properly formatted locale string
*/ */
public static String getString(String key, Object... messageArguments) { public static String getString(String key, Object... messageArguments) {

View File

@ -186,7 +186,8 @@ public class mcMMO extends JavaPlugin {
placeStore.saveAll(); // Save our metadata placeStore.saveAll(); // Save our metadata
placeStore.cleanUp(); // Cleanup empty metadata stores placeStore.cleanUp(); // Cleanup empty metadata stores
} }
catch (NullPointerException e) {} catch (NullPointerException e) {
}
getServer().getScheduler().cancelTasks(this); // This removes our tasks getServer().getScheduler().cancelTasks(this); // This removes our tasks
HandlerList.unregisterAll(this); // Cancel event registrations HandlerList.unregisterAll(this); // Cancel event registrations

View File

@ -33,6 +33,7 @@ public final class PartyManager {
* *
* @param player The player to notify * @param player The player to notify
* @param partyName The name of the party to check * @param partyName The name of the party to check
*
* @return true if a party with that name exists, false otherwise * @return true if a party with that name exists, false otherwise
*/ */
public static boolean checkPartyExistence(Player player, String partyName) { public static boolean checkPartyExistence(Player player, String partyName) {
@ -49,6 +50,7 @@ public final class PartyManager {
* *
* @param mcMMOPlayer The player changing or joining parties * @param mcMMOPlayer The player changing or joining parties
* @param newPartyName The name of the party being joined * @param newPartyName The name of the party being joined
*
* @return true if the party was joined successfully, false otherwise * @return true if the party was joined successfully, false otherwise
*/ */
public static boolean changeOrJoinParty(McMMOPlayer mcMMOPlayer, String newPartyName) { public static boolean changeOrJoinParty(McMMOPlayer mcMMOPlayer, String newPartyName) {
@ -75,6 +77,7 @@ public final class PartyManager {
* *
* @param firstPlayer The first player * @param firstPlayer The first player
* @param secondPlayer The second player * @param secondPlayer The second player
*
* @return true if they are in the same party, false otherwise * @return true if they are in the same party, false otherwise
*/ */
public static boolean inSameParty(Player firstPlayer, Player secondPlayer) { public static boolean inSameParty(Player firstPlayer, Player secondPlayer) {
@ -92,6 +95,7 @@ public final class PartyManager {
* Get the near party members. * Get the near party members.
* *
* @param mcMMOPlayer The player to check * @param mcMMOPlayer The player to check
*
* @return the near party members * @return the near party members
*/ */
public static List<Player> getNearMembers(McMMOPlayer mcMMOPlayer) { public static List<Player> getNearMembers(McMMOPlayer mcMMOPlayer) {
@ -116,6 +120,7 @@ public final class PartyManager {
* Get a list of all players in this player's party. * Get a list of all players in this player's party.
* *
* @param player The player to check * @param player The player to check
*
* @return all the players in the player's party * @return all the players in the player's party
*/ */
public static LinkedHashSet<String> getAllMembers(Player player) { public static LinkedHashSet<String> getAllMembers(Player player) {
@ -128,6 +133,7 @@ public final class PartyManager {
* Get a list of all online players in this party. * Get a list of all online players in this party.
* *
* @param partyName The party to check * @param partyName The party to check
*
* @return all online players in this party * @return all online players in this party
*/ */
public static List<Player> getOnlineMembers(String partyName) { public static List<Player> getOnlineMembers(String partyName) {
@ -138,6 +144,7 @@ public final class PartyManager {
* Get a list of all online players in this party. * Get a list of all online players in this party.
* *
* @param player The player to check * @param player The player to check
*
* @return all online players in this party * @return all online players in this party
*/ */
public static List<Player> getOnlineMembers(Player player) { public static List<Player> getOnlineMembers(Player player) {
@ -152,6 +159,7 @@ public final class PartyManager {
* Retrieve a party by its name * Retrieve a party by its name
* *
* @param partyName The party name * @param partyName The party name
*
* @return the existing party, null otherwise * @return the existing party, null otherwise
*/ */
public static Party getParty(String partyName) { public static Party getParty(String partyName) {
@ -168,6 +176,7 @@ public final class PartyManager {
* Retrieve a party by a members name * Retrieve a party by a members name
* *
* @param playerName The members name * @param playerName The members name
*
* @return the existing party, null otherwise * @return the existing party, null otherwise
*/ */
public static Party getPlayerParty(String playerName) { public static Party getPlayerParty(String playerName) {
@ -184,6 +193,7 @@ public final class PartyManager {
* Retrieve a party by member * Retrieve a party by member
* *
* @param player The member * @param player The member
*
* @return the existing party, null otherwise * @return the existing party, null otherwise
*/ */
public static Party getParty(Player player) { public static Party getParty(Player player) {
@ -278,6 +288,7 @@ public final class PartyManager {
* @param player The player trying to join a party * @param player The player trying to join a party
* @param party The party * @param party The party
* @param password The password provided by the player * @param password The password provided by the player
*
* @return true if the player can join the party * @return true if the player can join the party
*/ */
public static boolean checkPartyPassword(Player player, Party party, String password) { public static boolean checkPartyPassword(Player player, Party party, String password) {
@ -340,6 +351,7 @@ public final class PartyManager {
* Get the leader of a party. * Get the leader of a party.
* *
* @param partyName The party name * @param partyName The party name
*
* @return the leader of the party * @return the leader of the party
*/ */
public static String getPartyLeader(String partyName) { public static String getPartyLeader(String partyName) {
@ -389,6 +401,7 @@ public final class PartyManager {
* Check if a string is a valid party name. * Check if a string is a valid party name.
* *
* @param partyName The party name to check * @param partyName The party name to check
*
* @return true if this is a valid party, false otherwise * @return true if this is a valid party, false otherwise
*/ */
public static boolean isParty(String partyName) { public static boolean isParty(String partyName) {
@ -478,6 +491,7 @@ public final class PartyManager {
* @param oldPartyName The name of the old party * @param oldPartyName The name of the old party
* @param newPartyName The name of the new party * @param newPartyName The name of the new party
* @param reason The reason for changing parties * @param reason The reason for changing parties
*
* @return true if the change event was successful, false otherwise * @return true if the change event was successful, false otherwise
*/ */
public static boolean handlePartyChangeEvent(Player player, String oldPartyName, String newPartyName, EventReason reason) { public static boolean handlePartyChangeEvent(Player player, String oldPartyName, String newPartyName, EventReason reason) {

View File

@ -25,6 +25,7 @@ public final class ShareHandler {
* @param xp Xp without party sharing * @param xp Xp without party sharing
* @param mcMMOPlayer Player initiating the Xp gain * @param mcMMOPlayer Player initiating the Xp gain
* @param skillType Skill being used * @param skillType Skill being used
*
* @return True is the xp has been shared * @return True is the xp has been shared
*/ */
public static boolean handleXpShare(float xp, McMMOPlayer mcMMOPlayer, SkillType skillType) { public static boolean handleXpShare(float xp, McMMOPlayer mcMMOPlayer, SkillType skillType) {
@ -58,6 +59,7 @@ public final class ShareHandler {
* *
* @param drop Item that will get shared * @param drop Item that will get shared
* @param mcMMOPlayer Player who picked up the item * @param mcMMOPlayer Player who picked up the item
*
* @return True if the item has been shared * @return True if the item has been shared
*/ */
public static boolean handleItemShare(Item drop, McMMOPlayer mcMMOPlayer) { public static boolean handleItemShare(Item drop, McMMOPlayer mcMMOPlayer) {

View File

@ -26,7 +26,7 @@ public final class Acrobatics {
public static boolean afkLevelingDisabled = Config.getInstance().getAcrobaticsAFKDisabled(); public static boolean afkLevelingDisabled = Config.getInstance().getAcrobaticsAFKDisabled();
public static boolean dodgeLightningDisabled = Config.getInstance().getDodgeLightningDisabled(); public static boolean dodgeLightningDisabled = Config.getInstance().getDodgeLightningDisabled();
private Acrobatics() {}; private Acrobatics() {}
protected static double calculateModifiedDodgeDamage(double damage, double damageModifier) { protected static double calculateModifiedDodgeDamage(double damage, double damageModifier) {
return Math.max(damage / damageModifier, 1.0); return Math.max(damage / damageModifier, 1.0);

View File

@ -44,6 +44,7 @@ public class AcrobaticsManager extends SkillManager {
* Handle the damage reduction and XP gain from the Dodge ability * Handle the damage reduction and XP gain from the Dodge ability
* *
* @param damage The amount of damage initially dealt by the event * @param damage The amount of damage initially dealt by the event
*
* @return the modified event damage if the ability was successful, the original event damage otherwise * @return the modified event damage if the ability was successful, the original event damage otherwise
*/ */
public double dodgeCheck(double damage) { public double dodgeCheck(double damage) {
@ -72,6 +73,7 @@ public class AcrobaticsManager extends SkillManager {
* Handle the damage reduction and XP gain from the Roll ability * Handle the damage reduction and XP gain from the Roll ability
* *
* @param damage The amount of damage initially dealt by the event * @param damage The amount of damage initially dealt by the event
*
* @return the modified event damage if the ability was successful, the original event damage otherwise * @return the modified event damage if the ability was successful, the original event damage otherwise
*/ */
public double rollCheck(double damage) { public double rollCheck(double damage) {
@ -100,6 +102,7 @@ public class AcrobaticsManager extends SkillManager {
* Handle the damage reduction and XP gain from the Graceful Roll ability * Handle the damage reduction and XP gain from the Graceful Roll ability
* *
* @param damage The amount of damage initially dealt by the event * @param damage The amount of damage initially dealt by the event
*
* @return the modified event damage if the ability was successful, the original event damage otherwise * @return the modified event damage if the ability was successful, the original event damage otherwise
*/ */
private double gracefulRollCheck(double damage) { private double gracefulRollCheck(double damage) {

View File

@ -16,6 +16,7 @@ public class Excavation {
* Get the list of possible {@link ExcavationTreasure|ExcavationTreasures} obtained from a given block. * Get the list of possible {@link ExcavationTreasure|ExcavationTreasures} obtained from a given block.
* *
* @param blockState The {@link BlockState} of the block to check. * @param blockState The {@link BlockState} of the block to check.
*
* @return the list of treasures that could be found * @return the list of treasures that could be found
*/ */
protected static List<ExcavationTreasure> getTreasures(BlockState blockState) { protected static List<ExcavationTreasure> getTreasures(BlockState blockState) {

View File

@ -62,6 +62,7 @@ public final class Fishing {
* Finds the possible drops of an entity * Finds the possible drops of an entity
* *
* @param target Targeted entity * @param target Targeted entity
*
* @return possibleDrops List of ItemStack that can be dropped * @return possibleDrops List of ItemStack that can be dropped
*/ */
protected static List<ShakeTreasure> findPossibleDrops(LivingEntity target) { protected static List<ShakeTreasure> findPossibleDrops(LivingEntity target) {
@ -135,6 +136,7 @@ public final class Fishing {
* Randomly chooses a drop among the list * Randomly chooses a drop among the list
* *
* @param possibleDrops List of ItemStack that can be dropped * @param possibleDrops List of ItemStack that can be dropped
*
* @return Chosen ItemStack * @return Chosen ItemStack
*/ */
protected static ItemStack chooseDrop(List<ShakeTreasure> possibleDrops) { protected static ItemStack chooseDrop(List<ShakeTreasure> possibleDrops) {

View File

@ -33,6 +33,7 @@ public class Herbalism {
* Convert blocks affected by the Green Thumb & Green Terra abilities. * Convert blocks affected by the Green Thumb & Green Terra abilities.
* *
* @param blockState The {@link BlockState} to check ability activation for * @param blockState The {@link BlockState} to check ability activation for
*
* @return true if the ability was successful, false otherwise * @return true if the ability was successful, false otherwise
*/ */
protected static boolean convertGreenTerraBlocks(BlockState blockState) { protected static boolean convertGreenTerraBlocks(BlockState blockState) {
@ -62,6 +63,7 @@ public class Herbalism {
* Calculate the drop amounts for cacti & sugar cane based on the blocks above them. * Calculate the drop amounts for cacti & sugar cane based on the blocks above them.
* *
* @param blockState The {@link BlockState} of the bottom block of the plant * @param blockState The {@link BlockState} of the bottom block of the plant
*
* @return the number of bonus drops to award from the blocks in this plant * @return the number of bonus drops to award from the blocks in this plant
*/ */
protected static int calculateCatciAndSugarDrops(BlockState blockState) { protected static int calculateCatciAndSugarDrops(BlockState blockState) {
@ -92,6 +94,7 @@ public class Herbalism {
* Convert blocks affected by the Green Thumb & Green Terra abilities. * Convert blocks affected by the Green Thumb & Green Terra abilities.
* *
* @param blockState The {@link BlockState} to check ability activation for * @param blockState The {@link BlockState} to check ability activation for
*
* @return true if the ability was successful, false otherwise * @return true if the ability was successful, false otherwise
*/ */
protected static boolean convertShroomThumb(BlockState blockState) { protected static boolean convertShroomThumb(BlockState blockState) {

View File

@ -80,6 +80,7 @@ public class HerbalismManager extends SkillManager {
* *
* @param rankChange The # of levels to change rank for the food * @param rankChange The # of levels to change rank for the food
* @param eventFoodLevel The initial change in hunger from the event * @param eventFoodLevel The initial change in hunger from the event
*
* @return the modified change in hunger for the event * @return the modified change in hunger for the event
*/ */
public int farmersDiet(int rankChange, int eventFoodLevel) { public int farmersDiet(int rankChange, int eventFoodLevel) {
@ -90,6 +91,7 @@ public class HerbalismManager extends SkillManager {
* Process the Green Terra ability. * Process the Green Terra ability.
* *
* @param blockState The {@link BlockState} to check ability activation for * @param blockState The {@link BlockState} to check ability activation for
*
* @return true if the ability was successful, false otherwise * @return true if the ability was successful, false otherwise
*/ */
public boolean processGreenTerra(BlockState blockState) { public boolean processGreenTerra(BlockState blockState) {
@ -114,8 +116,6 @@ public class HerbalismManager extends SkillManager {
} }
/** /**
*
*
* @param blockState The {@link BlockState} to check ability activation for * @param blockState The {@link BlockState} to check ability activation for
*/ */
public void herbalismBlockCheck(BlockState blockState) { public void herbalismBlockCheck(BlockState blockState) {
@ -180,6 +180,7 @@ public class HerbalismManager extends SkillManager {
* Process the Green Thumb ability for blocks. * Process the Green Thumb ability for blocks.
* *
* @param blockState The {@link BlockState} to check ability activation for * @param blockState The {@link BlockState} to check ability activation for
*
* @return true if the ability was successful, false otherwise * @return true if the ability was successful, false otherwise
*/ */
public boolean processGreenThumbBlocks(BlockState blockState) { public boolean processGreenThumbBlocks(BlockState blockState) {
@ -195,6 +196,7 @@ public class HerbalismManager extends SkillManager {
* Process the Hylian Luck ability. * Process the Hylian Luck ability.
* *
* @param blockState The {@link BlockState} to check ability activation for * @param blockState The {@link BlockState} to check ability activation for
*
* @return true if the ability was successful, false otherwise * @return true if the ability was successful, false otherwise
*/ */
public boolean processHylianLuck(BlockState blockState) { public boolean processHylianLuck(BlockState blockState) {
@ -246,6 +248,7 @@ public class HerbalismManager extends SkillManager {
* Process the Shroom Thumb ability. * Process the Shroom Thumb ability.
* *
* @param blockState The {@link BlockState} to check ability activation for * @param blockState The {@link BlockState} to check ability activation for
*
* @return true if the ability was successful, false otherwise * @return true if the ability was successful, false otherwise
*/ */
public boolean processShroomThumb(BlockState blockState) { public boolean processShroomThumb(BlockState blockState) {

View File

@ -173,6 +173,7 @@ public class MiningManager extends SkillManager {
* Increases the blast radius of the explosion. * Increases the blast radius of the explosion.
* *
* @param radius to modify * @param radius to modify
*
* @return modified radius * @return modified radius
*/ */
public float biggerBombs(float radius) { public float biggerBombs(float radius) {

View File

@ -255,6 +255,7 @@ public class RepairManager extends SkillManager {
* *
* @param durability The durability of the item being repaired * @param durability The durability of the item being repaired
* @param repairAmount The base amount of durability repaired to the item * @param repairAmount The base amount of durability repaired to the item
*
* @return The final amount of durability repaired to the item * @return The final amount of durability repaired to the item
*/ */
private short repairCalculate(short durability, int repairAmount) { private short repairCalculate(short durability, int repairAmount) {

View File

@ -13,6 +13,7 @@ public enum RepairItemType {
* Get the base permissions associated with this RepairItemType. * Get the base permissions associated with this RepairItemType.
* *
* @param player The player to check the permissions for * @param player The player to check the permissions for
*
* @return true if the player has permissions, false otherwise * @return true if the player has permissions, false otherwise
*/ */
public boolean getPermissions(Player player) { public boolean getPermissions(Player player) {

View File

@ -41,7 +41,7 @@ public interface Repairable {
/** /**
* Gets the minimum quantity of repair materials ignoring all other repair bonuses * Gets the minimum quantity of repair materials ignoring all other repair bonuses
* * <p/>
* This is typically set to the number of items needed to create that item, for example 5 for helmets or 2 for swords * This is typically set to the number of items needed to create that item, for example 5 for helmets or 2 for swords
* *
* @return the minimum number of items * @return the minimum number of items
@ -57,7 +57,7 @@ public interface Repairable {
/** /**
* Gets the base repair durability on which to calculate bonuses. * Gets the base repair durability on which to calculate bonuses.
* * <p/>
* This is actually the maximum durability divided by the minimum quantity * This is actually the maximum durability divided by the minimum quantity
* *
* @return the base repair durability * @return the base repair durability

View File

@ -35,6 +35,7 @@ public class SmeltingManager extends SkillManager {
* Process the Flux Mining ability. * Process the Flux Mining ability.
* *
* @param blockState The {@link BlockState} to check ability activation for * @param blockState The {@link BlockState} to check ability activation for
*
* @return true if the ability was successful, false otherwise * @return true if the ability was successful, false otherwise
*/ */
public boolean processFluxMining(BlockState blockState) { public boolean processFluxMining(BlockState blockState) {

View File

@ -2,10 +2,10 @@ package com.gmail.nossr50.skills.taming;
import org.bukkit.entity.Entity; import org.bukkit.entity.Entity;
import org.bukkit.entity.EntityType; import org.bukkit.entity.EntityType;
import org.bukkit.entity.Horse;
import org.bukkit.entity.LivingEntity; import org.bukkit.entity.LivingEntity;
import org.bukkit.entity.Ocelot; import org.bukkit.entity.Ocelot;
import org.bukkit.entity.Player; import org.bukkit.entity.Player;
import org.bukkit.entity.Horse;
import org.bukkit.entity.Tameable; import org.bukkit.entity.Tameable;
import org.bukkit.entity.Wolf; import org.bukkit.entity.Wolf;
import org.bukkit.inventory.ItemStack; import org.bukkit.inventory.ItemStack;

View File

@ -80,7 +80,8 @@ public class Unarmed {
nextSlot++; nextSlot++;
} }
} else if (firstEmpty != -1) { }
else if (firstEmpty != -1) {
drop.remove(); drop.remove();
dropStack.setAmount(dropAmount); dropStack.setAmount(dropAmount);
inventory.setItem(firstEmpty, dropStack); inventory.setItem(firstEmpty, dropStack);

View File

@ -132,6 +132,7 @@ public class UnarmedManager extends SkillManager {
* Check Iron Grip ability success * Check Iron Grip ability success
* *
* @param defender The defending player * @param defender The defending player
*
* @return true if the defender was not disarmed, false otherwise * @return true if the defender was not disarmed, false otherwise
*/ */
private boolean hasIronGrip(Player defender) { private boolean hasIronGrip(Player defender) {

View File

@ -32,7 +32,7 @@ public final class Woodcutting {
protected enum ExperienceGainMethod { protected enum ExperienceGainMethod {
DEFAULT, DEFAULT,
TREE_FELLER, TREE_FELLER,
}; }
private Woodcutting() {} private Woodcutting() {}
@ -41,6 +41,7 @@ public final class Woodcutting {
* *
* @param blockState Log being broken * @param blockState Log being broken
* @param experienceGainMethod How the log is being broken * @param experienceGainMethod How the log is being broken
*
* @return Amount of experience * @return Amount of experience
*/ */
protected static int getExperienceFromLog(BlockState blockState, ExperienceGainMethod experienceGainMethod) { protected static int getExperienceFromLog(BlockState blockState, ExperienceGainMethod experienceGainMethod) {
@ -209,6 +210,7 @@ public final class Woodcutting {
* *
* @param treeFellerBlocks List of blocks to be removed * @param treeFellerBlocks List of blocks to be removed
* @param inHand tool being used * @param inHand tool being used
*
* @return True if the tool can sustain the durability loss * @return True if the tool can sustain the durability loss
*/ */
protected static boolean handleDurabilityLoss(Set<BlockState> treeFellerBlocks, ItemStack inHand) { protected static boolean handleDurabilityLoss(Set<BlockState> treeFellerBlocks, ItemStack inHand) {
@ -244,6 +246,7 @@ public final class Woodcutting {
* @param futureCenterBlocks List of blocks that will be used to call * @param futureCenterBlocks List of blocks that will be used to call
* 'processTree()' * 'processTree()'
* @param treeFellerBlocks List of blocks to be removed * @param treeFellerBlocks List of blocks to be removed
*
* @return true if and only if the given blockState was a Log not already * @return true if and only if the given blockState was a Log not already
* in treeFellerBlocks. * in treeFellerBlocks.
*/ */

View File

@ -21,6 +21,7 @@ public final class BlockUtils {
* Checks to see if a given block awards XP. * Checks to see if a given block awards XP.
* *
* @param blockState The {@link BlockState} of the block to check * @param blockState The {@link BlockState} of the block to check
*
* @return true if the block awards XP, false otherwise * @return true if the block awards XP, false otherwise
*/ */
public static boolean shouldBeWatched(BlockState blockState) { public static boolean shouldBeWatched(BlockState blockState) {
@ -31,6 +32,7 @@ public final class BlockUtils {
* Check if a given block should allow for the activation of abilities * Check if a given block should allow for the activation of abilities
* *
* @param blockState The {@link BlockState} of the block to check * @param blockState The {@link BlockState} of the block to check
*
* @return true if the block should allow ability activation, false otherwise * @return true if the block should allow ability activation, false otherwise
*/ */
public static boolean canActivateAbilities(BlockState blockState) { public static boolean canActivateAbilities(BlockState blockState) {
@ -72,6 +74,7 @@ public final class BlockUtils {
* Check if a given block is an ore * Check if a given block is an ore
* *
* @param blockState The {@link BlockState} of the block to check * @param blockState The {@link BlockState} of the block to check
*
* @return true if the block is an ore, false otherwise * @return true if the block is an ore, false otherwise
*/ */
public static boolean isOre(BlockState blockState) { public static boolean isOre(BlockState blockState) {
@ -96,6 +99,7 @@ public final class BlockUtils {
* Determine if a given block can be made mossy * Determine if a given block can be made mossy
* *
* @param blockState The {@link BlockState} of the block to check * @param blockState The {@link BlockState} of the block to check
*
* @return true if the block can be made mossy, false otherwise * @return true if the block can be made mossy, false otherwise
*/ */
public static boolean canMakeMossy(BlockState blockState) { public static boolean canMakeMossy(BlockState blockState) {
@ -119,6 +123,7 @@ public final class BlockUtils {
* Determine if a given block should be affected by Green Terra * Determine if a given block should be affected by Green Terra
* *
* @param blockState The {@link BlockState} of the block to check * @param blockState The {@link BlockState} of the block to check
*
* @return true if the block should affected by Green Terra, false otherwise * @return true if the block should affected by Green Terra, false otherwise
*/ */
public static boolean affectedByGreenTerra(BlockState blockState) { public static boolean affectedByGreenTerra(BlockState blockState) {
@ -157,6 +162,7 @@ public final class BlockUtils {
* Determine if a given block should be affected by Super Breaker * Determine if a given block should be affected by Super Breaker
* *
* @param blockState The {@link BlockState} of the block to check * @param blockState The {@link BlockState} of the block to check
*
* @return true if the block should affected by Super Breaker, false otherwise * @return true if the block should affected by Super Breaker, false otherwise
*/ */
public static Boolean affectedBySuperBreaker(BlockState blockState) { public static Boolean affectedBySuperBreaker(BlockState blockState) {
@ -179,6 +185,7 @@ public final class BlockUtils {
* Determine if a given block should be affected by Giga Drill Breaker * Determine if a given block should be affected by Giga Drill Breaker
* *
* @param blockState The {@link BlockState} of the block to check * @param blockState The {@link BlockState} of the block to check
*
* @return true if the block should affected by Giga Drill Breaker, false otherwise * @return true if the block should affected by Giga Drill Breaker, false otherwise
*/ */
public static boolean affectedByGigaDrillBreaker(BlockState blockState) { public static boolean affectedByGigaDrillBreaker(BlockState blockState) {
@ -203,6 +210,7 @@ public final class BlockUtils {
* Check if a given block is a log * Check if a given block is a log
* *
* @param blockState The {@link BlockState} of the block to check * @param blockState The {@link BlockState} of the block to check
*
* @return true if the block is a log, false otherwise * @return true if the block is a log, false otherwise
*/ */
public static boolean isLog(BlockState blockState) { public static boolean isLog(BlockState blockState) {
@ -221,6 +229,7 @@ public final class BlockUtils {
* Check if a given block is a leaf * Check if a given block is a leaf
* *
* @param blockState The {@link BlockState} of the block to check * @param blockState The {@link BlockState} of the block to check
*
* @return true if the block is a leaf, false otherwise * @return true if the block is a leaf, false otherwise
*/ */
public static boolean isLeaves(BlockState blockState) { public static boolean isLeaves(BlockState blockState) {
@ -237,6 +246,7 @@ public final class BlockUtils {
* Determine if a given block should be affected by Flux Mining * Determine if a given block should be affected by Flux Mining
* *
* @param blockState The {@link BlockState} of the block to check * @param blockState The {@link BlockState} of the block to check
*
* @return true if the block should affected by Flux Mining, false otherwise * @return true if the block should affected by Flux Mining, false otherwise
*/ */
public static boolean affectedByFluxMining(BlockState blockState) { public static boolean affectedByFluxMining(BlockState blockState) {
@ -254,6 +264,7 @@ public final class BlockUtils {
* Determine if a given block can activate Herbalism abilities * Determine if a given block can activate Herbalism abilities
* *
* @param blockState The {@link BlockState} of the block to check * @param blockState The {@link BlockState} of the block to check
*
* @return true if the block can be activate Herbalism abilities, false otherwise * @return true if the block can be activate Herbalism abilities, false otherwise
*/ */
public static boolean canActivateHerbalism(BlockState blockState) { public static boolean canActivateHerbalism(BlockState blockState) {
@ -272,6 +283,7 @@ public final class BlockUtils {
* Determine if a given block should be affected by Block Cracker * Determine if a given block should be affected by Block Cracker
* *
* @param blockState The {@link BlockState} of the block to check * @param blockState The {@link BlockState} of the block to check
*
* @return true if the block should affected by Block Cracker, false otherwise * @return true if the block should affected by Block Cracker, false otherwise
*/ */
public static boolean affectedByBlockCracker(BlockState blockState) { public static boolean affectedByBlockCracker(BlockState blockState) {
@ -288,6 +300,7 @@ public final class BlockUtils {
* Determine if a given block can be made into Mycelium * Determine if a given block can be made into Mycelium
* *
* @param blockState The {@link BlockState} of the block to check * @param blockState The {@link BlockState} of the block to check
*
* @return true if the block can be made in Mycelium, false otherwise * @return true if the block can be made in Mycelium, false otherwise
*/ */
public static boolean canMakeShroomy(BlockState blockState) { public static boolean canMakeShroomy(BlockState blockState) {
@ -305,6 +318,7 @@ public final class BlockUtils {
* Determine if a given block is an mcMMO anvil * Determine if a given block is an mcMMO anvil
* *
* @param blockState The {@link BlockState} of the block to check * @param blockState The {@link BlockState} of the block to check
*
* @return true if the block is an mcMMO anvil, false otherwise * @return true if the block is an mcMMO anvil, false otherwise
*/ */
public static boolean isMcMMOAnvil(BlockState blockState) { public static boolean isMcMMOAnvil(BlockState blockState) {

View File

@ -66,7 +66,7 @@ public final class ChimaeraWing {
long lastTeleport = mcMMOPlayer.getChimeraWingLastUse(); long lastTeleport = mcMMOPlayer.getChimeraWingLastUse();
int cooldown = Config.getInstance().getChimaeraCooldown(); int cooldown = Config.getInstance().getChimaeraCooldown();
if (cooldown > 0 ) { if (cooldown > 0) {
int timeRemaining = SkillUtils.calculateTimeLeft(lastTeleport * Misc.TIME_CONVERSION_FACTOR, cooldown, player); int timeRemaining = SkillUtils.calculateTimeLeft(lastTeleport * Misc.TIME_CONVERSION_FACTOR, cooldown, player);
if (timeRemaining > 0) { if (timeRemaining > 0) {

View File

@ -71,6 +71,7 @@ public class EventUtils {
* @param block The block to break * @param block The block to break
* @param player The player breaking the block * @param player The player breaking the block
* @param shouldArmSwing true if an armswing event should be fired, false otherwise * @param shouldArmSwing true if an armswing event should be fired, false otherwise
*
* @return true if the event wasn't cancelled, false otherwise * @return true if the event wasn't cancelled, false otherwise
*/ */
public static boolean simulateBlockBreak(Block block, Player player, boolean shouldArmSwing) { public static boolean simulateBlockBreak(Block block, Player player, boolean shouldArmSwing) {

View File

@ -19,6 +19,7 @@ public class ItemUtils {
* Checks if the item is a bow. * Checks if the item is a bow.
* *
* @param item Item to check * @param item Item to check
*
* @return true if the item is a bow, false otherwise * @return true if the item is a bow, false otherwise
*/ */
public static boolean isBow(ItemStack item) { public static boolean isBow(ItemStack item) {
@ -37,6 +38,7 @@ public class ItemUtils {
* Checks if the item is a sword. * Checks if the item is a sword.
* *
* @param item Item to check * @param item Item to check
*
* @return true if the item is a sword, false otherwise * @return true if the item is a sword, false otherwise
*/ */
public static boolean isSword(ItemStack item) { public static boolean isSword(ItemStack item) {
@ -59,6 +61,7 @@ public class ItemUtils {
* Checks if the item is a hoe. * Checks if the item is a hoe.
* *
* @param item Item to check * @param item Item to check
*
* @return true if the item is a hoe, false otherwise * @return true if the item is a hoe, false otherwise
*/ */
public static boolean isHoe(ItemStack item) { public static boolean isHoe(ItemStack item) {
@ -81,6 +84,7 @@ public class ItemUtils {
* Checks if the item is a shovel. * Checks if the item is a shovel.
* *
* @param item Item to check * @param item Item to check
*
* @return true if the item is a shovel, false otherwise * @return true if the item is a shovel, false otherwise
*/ */
public static boolean isShovel(ItemStack item) { public static boolean isShovel(ItemStack item) {
@ -103,6 +107,7 @@ public class ItemUtils {
* Checks if the item is an axe. * Checks if the item is an axe.
* *
* @param item Item to check * @param item Item to check
*
* @return true if the item is an axe, false otherwise * @return true if the item is an axe, false otherwise
*/ */
public static boolean isAxe(ItemStack item) { public static boolean isAxe(ItemStack item) {
@ -125,6 +130,7 @@ public class ItemUtils {
* Checks if the item is a pickaxe. * Checks if the item is a pickaxe.
* *
* @param item Item to check * @param item Item to check
*
* @return true if the item is a pickaxe, false otherwise * @return true if the item is a pickaxe, false otherwise
*/ */
public static boolean isPickaxe(ItemStack item) { public static boolean isPickaxe(ItemStack item) {
@ -147,6 +153,7 @@ public class ItemUtils {
* Checks if the item is a helmet. * Checks if the item is a helmet.
* *
* @param item Item to check * @param item Item to check
*
* @return true if the item is a helmet, false otherwise * @return true if the item is a helmet, false otherwise
*/ */
public static boolean isHelmet(ItemStack item) { public static boolean isHelmet(ItemStack item) {
@ -169,6 +176,7 @@ public class ItemUtils {
* Checks if the item is a chestplate. * Checks if the item is a chestplate.
* *
* @param item Item to check * @param item Item to check
*
* @return true if the item is a chestplate, false otherwise * @return true if the item is a chestplate, false otherwise
*/ */
public static boolean isChestplate(ItemStack item) { public static boolean isChestplate(ItemStack item) {
@ -191,6 +199,7 @@ public class ItemUtils {
* Checks if the item is a pair of pants. * Checks if the item is a pair of pants.
* *
* @param item Item to check * @param item Item to check
*
* @return true if the item is a pair of pants, false otherwise * @return true if the item is a pair of pants, false otherwise
*/ */
public static boolean isLeggings(ItemStack item) { public static boolean isLeggings(ItemStack item) {
@ -213,6 +222,7 @@ public class ItemUtils {
* Checks if the item is a pair of boots. * Checks if the item is a pair of boots.
* *
* @param item Item to check * @param item Item to check
*
* @return true if the item is a pair of boots, false otherwise * @return true if the item is a pair of boots, false otherwise
*/ */
public static boolean isBoots(ItemStack item) { public static boolean isBoots(ItemStack item) {
@ -235,6 +245,7 @@ public class ItemUtils {
* Checks to see if an item is a wearable armor piece. * Checks to see if an item is a wearable armor piece.
* *
* @param item Item to check * @param item Item to check
*
* @return true if the item is armor, false otherwise * @return true if the item is armor, false otherwise
*/ */
public static boolean isArmor(ItemStack item) { public static boolean isArmor(ItemStack item) {
@ -245,6 +256,7 @@ public class ItemUtils {
* Checks to see if an item is a wearable *vanilla* armor piece. * Checks to see if an item is a wearable *vanilla* armor piece.
* *
* @param item Item to check * @param item Item to check
*
* @return true if the item is armor, false otherwise * @return true if the item is armor, false otherwise
*/ */
public static boolean isMinecraftArmor(ItemStack item) { public static boolean isMinecraftArmor(ItemStack item) {
@ -255,6 +267,7 @@ public class ItemUtils {
* Checks to see if an item is a leather armor piece. * Checks to see if an item is a leather armor piece.
* *
* @param item Item to check * @param item Item to check
*
* @return true if the item is leather armor, false otherwise * @return true if the item is leather armor, false otherwise
*/ */
public static boolean isLeatherArmor(ItemStack item) { public static boolean isLeatherArmor(ItemStack item) {
@ -274,6 +287,7 @@ public class ItemUtils {
* Checks to see if an item is a gold armor piece. * Checks to see if an item is a gold armor piece.
* *
* @param item Item to check * @param item Item to check
*
* @return true if the item is gold armor, false otherwise * @return true if the item is gold armor, false otherwise
*/ */
public static boolean isGoldArmor(ItemStack item) { public static boolean isGoldArmor(ItemStack item) {
@ -293,6 +307,7 @@ public class ItemUtils {
* Checks to see if an item is an iron armor piece. * Checks to see if an item is an iron armor piece.
* *
* @param item Item to check * @param item Item to check
*
* @return true if the item is iron armor, false otherwise * @return true if the item is iron armor, false otherwise
*/ */
public static boolean isIronArmor(ItemStack item) { public static boolean isIronArmor(ItemStack item) {
@ -312,6 +327,7 @@ public class ItemUtils {
* Checks to see if an item is a diamond armor piece. * Checks to see if an item is a diamond armor piece.
* *
* @param item Item to check * @param item Item to check
*
* @return true if the item is diamond armor, false otherwise * @return true if the item is diamond armor, false otherwise
*/ */
public static boolean isDiamondArmor(ItemStack item) { public static boolean isDiamondArmor(ItemStack item) {
@ -331,6 +347,7 @@ public class ItemUtils {
* Checks to see if an item is a chainmail armor piece. * Checks to see if an item is a chainmail armor piece.
* *
* @param item Item to check * @param item Item to check
*
* @return true if the item is chainmail armor, false otherwise * @return true if the item is chainmail armor, false otherwise
*/ */
public static boolean isChainmailArmor(ItemStack item) { public static boolean isChainmailArmor(ItemStack item) {
@ -350,6 +367,7 @@ public class ItemUtils {
* Checks to see if an item is a *vanilla* tool. * Checks to see if an item is a *vanilla* tool.
* *
* @param item Item to check * @param item Item to check
*
* @return true if the item is a tool, false otherwise * @return true if the item is a tool, false otherwise
*/ */
public static boolean isMinecraftTool(ItemStack item) { public static boolean isMinecraftTool(ItemStack item) {
@ -360,6 +378,7 @@ public class ItemUtils {
* Checks to see if an item is a stone tool. * Checks to see if an item is a stone tool.
* *
* @param item Item to check * @param item Item to check
*
* @return true if the item is a stone tool, false otherwise * @return true if the item is a stone tool, false otherwise
*/ */
public static boolean isStoneTool(ItemStack item) { public static boolean isStoneTool(ItemStack item) {
@ -380,6 +399,7 @@ public class ItemUtils {
* Checks to see if an item is a wooden tool. * Checks to see if an item is a wooden tool.
* *
* @param item Item to check * @param item Item to check
*
* @return true if the item is a wooden tool, false otherwise * @return true if the item is a wooden tool, false otherwise
*/ */
public static boolean isWoodTool(ItemStack item) { public static boolean isWoodTool(ItemStack item) {
@ -400,6 +420,7 @@ public class ItemUtils {
* Checks to see if an item is a string tool. * Checks to see if an item is a string tool.
* *
* @param item Item to check * @param item Item to check
*
* @return true if the item is a string tool, false otherwise * @return true if the item is a string tool, false otherwise
*/ */
public static boolean isStringTool(ItemStack item) { public static boolean isStringTool(ItemStack item) {
@ -418,6 +439,7 @@ public class ItemUtils {
* Checks to see if an item is a gold tool. * Checks to see if an item is a gold tool.
* *
* @param item Item to check * @param item Item to check
*
* @return true if the item is a stone tool, false otherwise * @return true if the item is a stone tool, false otherwise
*/ */
public static boolean isGoldTool(ItemStack item) { public static boolean isGoldTool(ItemStack item) {
@ -438,6 +460,7 @@ public class ItemUtils {
* Checks to see if an item is an iron tool. * Checks to see if an item is an iron tool.
* *
* @param item Item to check * @param item Item to check
*
* @return true if the item is an iron tool, false otherwise * @return true if the item is an iron tool, false otherwise
*/ */
public static boolean isIronTool(ItemStack item) { public static boolean isIronTool(ItemStack item) {
@ -461,6 +484,7 @@ public class ItemUtils {
* Checks to see if an item is a diamond tool. * Checks to see if an item is a diamond tool.
* *
* @param item Item to check * @param item Item to check
*
* @return true if the item is a diamond tool, false otherwise * @return true if the item is a diamond tool, false otherwise
*/ */
public static boolean isDiamondTool(ItemStack item) { public static boolean isDiamondTool(ItemStack item) {
@ -481,6 +505,7 @@ public class ItemUtils {
* Checks to see if an item is enchantable. * Checks to see if an item is enchantable.
* *
* @param item Item to check * @param item Item to check
*
* @return true if the item is enchantable, false otherwise * @return true if the item is enchantable, false otherwise
*/ */
public static boolean isEnchantable(ItemStack item) { public static boolean isEnchantable(ItemStack item) {
@ -545,6 +570,7 @@ public class ItemUtils {
* Check if an item is sharable. * Check if an item is sharable.
* *
* @param item Item that will get shared * @param item Item that will get shared
*
* @return True if the item can be shared. * @return True if the item can be shared.
*/ */
public static boolean isSharable(ItemStack item) { public static boolean isSharable(ItemStack item) {
@ -559,6 +585,7 @@ public class ItemUtils {
* Checks to see if an item is a mining drop. * Checks to see if an item is a mining drop.
* *
* @param item Item to check * @param item Item to check
*
* @return true if the item is a mining drop, false otherwise * @return true if the item is a mining drop, false otherwise
*/ */
public static boolean isMiningDrop(ItemStack item) { public static boolean isMiningDrop(ItemStack item) {
@ -591,6 +618,7 @@ public class ItemUtils {
* Checks to see if an item is a herbalism drop. * Checks to see if an item is a herbalism drop.
* *
* @param item Item to check * @param item Item to check
*
* @return true if the item is a herbalism drop, false otherwise * @return true if the item is a herbalism drop, false otherwise
*/ */
public static boolean isHerbalismDrop(ItemStack item) { public static boolean isHerbalismDrop(ItemStack item) {
@ -626,6 +654,7 @@ public class ItemUtils {
* Checks to see if an item is a mob drop. * Checks to see if an item is a mob drop.
* *
* @param item Item to check * @param item Item to check
*
* @return true if the item is a mob drop, false otherwise * @return true if the item is a mob drop, false otherwise
*/ */
public static boolean isMobDrop(ItemStack item) { public static boolean isMobDrop(ItemStack item) {
@ -668,6 +697,7 @@ public class ItemUtils {
* Checks to see if an item is a woodcutting drop. * Checks to see if an item is a woodcutting drop.
* *
* @param item Item to check * @param item Item to check
*
* @return true if the item is a woodcutting drop, false otherwise * @return true if the item is a woodcutting drop, false otherwise
*/ */
public static boolean isWoodcuttingDrop(ItemStack item) { public static boolean isWoodcuttingDrop(ItemStack item) {
@ -687,6 +717,7 @@ public class ItemUtils {
* Checks to see if an item is a miscellaneous drop. These items are read from the config file * Checks to see if an item is a miscellaneous drop. These items are read from the config file
* *
* @param item Item to check * @param item Item to check
*
* @return true if the item is a miscellaneous drop, false otherwise * @return true if the item is a miscellaneous drop, false otherwise
*/ */
public static boolean isMiscDrop(ItemStack item) { public static boolean isMiscDrop(ItemStack item) {

View File

@ -22,8 +22,8 @@ import org.bukkit.inventory.Inventory;
import org.bukkit.inventory.ItemStack; import org.bukkit.inventory.ItemStack;
import org.bukkit.metadata.MetadataValue; import org.bukkit.metadata.MetadataValue;
import com.gmail.nossr50.config.Config;
import com.gmail.nossr50.mcMMO; import com.gmail.nossr50.mcMMO;
import com.gmail.nossr50.config.Config;
import com.gmail.nossr50.events.items.McMMOItemSpawnEvent; import com.gmail.nossr50.events.items.McMMOItemSpawnEvent;
import com.gmail.nossr50.util.player.UserManager; import com.gmail.nossr50.util.player.UserManager;
@ -47,7 +47,7 @@ public final class Misc {
public static final float LEVELUP_PITCH = 0.5F; // Reduced to differentiate between vanilla level-up public static final float LEVELUP_PITCH = 0.5F; // Reduced to differentiate between vanilla level-up
public static final float LEVELUP_VOLUME = 0.75F; // Use max volume always public static final float LEVELUP_VOLUME = 0.75F; // Use max volume always
private Misc() {}; private Misc() {}
public static float getFizzPitch() { public static float getFizzPitch() {
return 2.6F + (getRandom().nextFloat() - getRandom().nextFloat()) * 0.8F; return 2.6F + (getRandom().nextFloat() - getRandom().nextFloat()) * 0.8F;
@ -69,6 +69,7 @@ public final class Misc {
* Get the upgrade tier of the item in hand. * Get the upgrade tier of the item in hand.
* *
* @param inHand The item to check the tier of * @param inHand The item to check the tier of
*
* @return the tier of the item * @return the tier of the item
*/ */
public static int getTier(ItemStack inHand) { public static int getTier(ItemStack inHand) {
@ -102,6 +103,7 @@ public final class Misc {
* @param first The first location * @param first The first location
* @param second The second location * @param second The second location
* @param maxDistance The max distance apart * @param maxDistance The max distance apart
*
* @return true if the distance between {@code first} and {@code second} is less than {@code maxDistance}, false otherwise * @return true if the distance between {@code first} and {@code second} is less than {@code maxDistance}, false otherwise
*/ */
public static boolean isNear(Location first, Location second, double maxDistance) { public static boolean isNear(Location first, Location second, double maxDistance) {
@ -258,11 +260,12 @@ public final class Misc {
/** /**
* Attempts to match any player names with the given name, and returns a list of all possibly matches. * Attempts to match any player names with the given name, and returns a list of all possibly matches.
* * <p/>
* This list is not sorted in any particular order. * This list is not sorted in any particular order.
* If an exact match is found, the returned list will only contain a single result. * If an exact match is found, the returned list will only contain a single result.
* *
* @param partialName Name to match * @param partialName Name to match
*
* @return List of all possible names * @return List of all possible names
*/ */
public static List<String> matchPlayer(String partialName) { public static List<String> matchPlayer(String partialName) {

View File

@ -16,13 +16,14 @@ import com.gmail.nossr50.runnables.MobHealthDisplayUpdaterTask;
import com.gmail.nossr50.util.player.UserManager; import com.gmail.nossr50.util.player.UserManager;
public final class MobHealthbarUtils { public final class MobHealthbarUtils {
private MobHealthbarUtils() {}; private MobHealthbarUtils() {}
/** /**
* Fix issues with death messages caused by the mob healthbars. * Fix issues with death messages caused by the mob healthbars.
* *
* @param deathMessage The original death message * @param deathMessage The original death message
* @param player The player who died * @param player The player who died
*
* @return the fixed death message * @return the fixed death message
*/ */
public static String fixDeathMessage(String deathMessage, Player player) { public static String fixDeathMessage(String deathMessage, Player player) {
@ -158,6 +159,7 @@ public final class MobHealthbarUtils {
* Check if a given LivingEntity is a boss. * Check if a given LivingEntity is a boss.
* *
* @param livingEntity The {@link LivingEntity} of the livingEntity to check * @param livingEntity The {@link LivingEntity} of the livingEntity to check
*
* @return true if the livingEntity is a boss, false otherwise * @return true if the livingEntity is a boss, false otherwise
*/ */
public static boolean isBoss(LivingEntity livingEntity) { public static boolean isBoss(LivingEntity livingEntity) {

View File

@ -31,6 +31,7 @@ public final class ModUtils {
* Get the custom tool associated with an item. * Get the custom tool associated with an item.
* *
* @param item The item to check * @param item The item to check
*
* @return the tool if it exists, null otherwise * @return the tool if it exists, null otherwise
*/ */
public static CustomTool getToolFromItemStack(ItemStack item) { public static CustomTool getToolFromItemStack(ItemStack item) {
@ -41,6 +42,7 @@ public final class ModUtils {
* Get the custom entity associated with an entity. * Get the custom entity associated with an entity.
* *
* @param entity The entity to check * @param entity The entity to check
*
* @return the entity is if exists, null otherwise * @return the entity is if exists, null otherwise
*/ */
public static CustomEntity getCustomEntity(Entity entity) { public static CustomEntity getCustomEntity(Entity entity) {
@ -51,6 +53,7 @@ public final class ModUtils {
* Get the custom block associated with an block. * Get the custom block associated with an block.
* *
* @param blockState The BlockState of the bloc to check * @param blockState The BlockState of the bloc to check
*
* @return the block if it exists, null otherwise * @return the block if it exists, null otherwise
*/ */
public static CustomBlock getCustomBlock(BlockState blockState) { public static CustomBlock getCustomBlock(BlockState blockState) {
@ -61,6 +64,7 @@ public final class ModUtils {
* Check if a custom block is a woodcutting block. * Check if a custom block is a woodcutting block.
* *
* @param blockState The BlockState of the block to check * @param blockState The BlockState of the block to check
*
* @return true if the block represents a custom woodcutting block, false otherwise * @return true if the block represents a custom woodcutting block, false otherwise
*/ */
public static boolean isCustomWoodcuttingBlock(BlockState blockState) { public static boolean isCustomWoodcuttingBlock(BlockState blockState) {
@ -71,6 +75,7 @@ public final class ModUtils {
* Check if a custom block should not activate abilites. * Check if a custom block should not activate abilites.
* *
* @param blockState The BlockState of the block to check * @param blockState The BlockState of the block to check
*
* @return true if the block represents an ability block, false otherwise * @return true if the block represents an ability block, false otherwise
*/ */
public static boolean isCustomAbilityBlock(BlockState blockState) { public static boolean isCustomAbilityBlock(BlockState blockState) {
@ -81,6 +86,7 @@ public final class ModUtils {
* Check if a custom block is a mining block. * Check if a custom block is a mining block.
* *
* @param blockState The BlockState of the block to check * @param blockState The BlockState of the block to check
*
* @return true if the block represents a custom mining block, false otherwise * @return true if the block represents a custom mining block, false otherwise
*/ */
public static boolean isCustomMiningBlock(BlockState blockState) { public static boolean isCustomMiningBlock(BlockState blockState) {
@ -91,6 +97,7 @@ public final class ModUtils {
* Check if a custom block is an excavation block. * Check if a custom block is an excavation block.
* *
* @param blockState The BlockState of the block to check * @param blockState The BlockState of the block to check
*
* @return true if the block represents a custom excavation block, false otherwise * @return true if the block represents a custom excavation block, false otherwise
*/ */
public static boolean isCustomExcavationBlock(BlockState blockState) { public static boolean isCustomExcavationBlock(BlockState blockState) {
@ -101,6 +108,7 @@ public final class ModUtils {
* Check if a custom block is an herbalism block. * Check if a custom block is an herbalism block.
* *
* @param blockState The BlockState of the block to check * @param blockState The BlockState of the block to check
*
* @return true if the block represents a custom herbalism block, false otherwise * @return true if the block represents a custom herbalism block, false otherwise
*/ */
public static boolean isCustomHerbalismBlock(BlockState blockState) { public static boolean isCustomHerbalismBlock(BlockState blockState) {
@ -111,6 +119,7 @@ public final class ModUtils {
* Check if a custom block is a leaf block. * Check if a custom block is a leaf block.
* *
* @param blockState The BlockState of the block to check * @param blockState The BlockState of the block to check
*
* @return true if the block represents leaves, false otherwise * @return true if the block represents leaves, false otherwise
*/ */
public static boolean isCustomLeafBlock(BlockState blockState) { public static boolean isCustomLeafBlock(BlockState blockState) {
@ -121,6 +130,7 @@ public final class ModUtils {
* Check if a custom block is a log block. * Check if a custom block is a log block.
* *
* @param blockState The BlockState of the block to check * @param blockState The BlockState of the block to check
*
* @return true if the block represents a log, false otherwise * @return true if the block represents a log, false otherwise
*/ */
public static boolean isCustomLogBlock(BlockState blockState) { public static boolean isCustomLogBlock(BlockState blockState) {
@ -131,6 +141,7 @@ public final class ModUtils {
* Check if a custom block is an ore block. * Check if a custom block is an ore block.
* *
* @param blockState The BlockState of the block to check * @param blockState The BlockState of the block to check
*
* @return true if the block represents an ore, false otherwise * @return true if the block represents an ore, false otherwise
*/ */
public static boolean isCustomOreBlock(BlockState blockState) { public static boolean isCustomOreBlock(BlockState blockState) {
@ -141,6 +152,7 @@ public final class ModUtils {
* Checks to see if an item is a custom tool. * Checks to see if an item is a custom tool.
* *
* @param item Item to check * @param item Item to check
*
* @return true if the item is a custom tool, false otherwise * @return true if the item is a custom tool, false otherwise
*/ */
public static boolean isCustomTool(ItemStack item) { public static boolean isCustomTool(ItemStack item) {
@ -151,6 +163,7 @@ public final class ModUtils {
* Checks to see if an entity is a custom entity. * Checks to see if an entity is a custom entity.
* *
* @param entity Entity to check * @param entity Entity to check
*
* @return true if the entity is a custom entity, false otherwise * @return true if the entity is a custom entity, false otherwise
*/ */
public static boolean isCustomEntity(Entity entity) { public static boolean isCustomEntity(Entity entity) {
@ -161,6 +174,7 @@ public final class ModUtils {
* Check if a custom entity is a boss. * Check if a custom entity is a boss.
* *
* @param entity The entity to check * @param entity The entity to check
*
* @return true if the entity represents a boss, false otherwise * @return true if the entity represents a boss, false otherwise
*/ */
public static boolean isCustomBossEntity(Entity entity) { public static boolean isCustomBossEntity(Entity entity) {

View File

@ -8,6 +8,7 @@ public class StringUtils {
* Gets a capitalized version of the target string. * Gets a capitalized version of the target string.
* *
* @param target String to capitalize * @param target String to capitalize
*
* @return the capitalized string * @return the capitalized string
*/ */
public static String getCapitalized(String target) { public static String getCapitalized(String target) {
@ -44,6 +45,7 @@ public class StringUtils {
* Gets the int represented by this string. * Gets the int represented by this string.
* *
* @param string The string to parse * @param string The string to parse
*
* @return the int represented by this string * @return the int represented by this string
*/ */
public static int getInt(String string) { public static int getInt(String string) {
@ -59,6 +61,7 @@ public class StringUtils {
* Gets the long represented by this string. * Gets the long represented by this string.
* *
* @param string The string to parse * @param string The string to parse
*
* @return the long represented by this string * @return the long represented by this string
*/ */
public static long getLong(String string) { public static long getLong(String string) {
@ -74,6 +77,7 @@ public class StringUtils {
* Determine if a string represents an Integer * Determine if a string represents an Integer
* *
* @param string String to check * @param string String to check
*
* @return true if the string is an Integer, false otherwise * @return true if the string is an Integer, false otherwise
*/ */
public static boolean isInt(String string) { public static boolean isInt(String string) {
@ -90,6 +94,7 @@ public class StringUtils {
* Determine if a string represents a Double * Determine if a string represents a Double
* *
* @param string String to check * @param string String to check
*
* @return true if the string is a Double, false otherwise * @return true if the string is a Double, false otherwise
*/ */
public static boolean isDouble(String string) { public static boolean isDouble(String string) {

View File

@ -98,6 +98,7 @@ public interface ChunkletManager {
* @param y Y coordinate to check * @param y Y coordinate to check
* @param z Z coordinate to check * @param z Z coordinate to check
* @param world World to check in * @param world World to check in
*
* @return true if the given location is set to true, false if otherwise * @return true if the given location is set to true, false if otherwise
*/ */
public boolean isTrue(int x, int y, int z, World world); public boolean isTrue(int x, int y, int z, World world);
@ -106,6 +107,7 @@ public interface ChunkletManager {
* Check to see if a given block location is set to true * Check to see if a given block location is set to true
* *
* @param block Block location to check * @param block Block location to check
*
* @return true if the given block location is set to true, false if otherwise * @return true if the given block location is set to true, false if otherwise
*/ */
public boolean isTrue(Block block); public boolean isTrue(Block block);

View File

@ -12,6 +12,7 @@ public interface ChunkletStore extends Serializable {
* @param x x coordinate in current chunklet * @param x x coordinate in current chunklet
* @param y y coordinate in current chunklet * @param y y coordinate in current chunklet
* @param z z coordinate in current chunklet * @param z z coordinate in current chunklet
*
* @return true if the value is true at the given coordinates, false if otherwise * @return true if the value is true at the given coordinates, false if otherwise
*/ */
public boolean isTrue(int x, int y, int z); public boolean isTrue(int x, int y, int z);

View File

@ -345,6 +345,7 @@ public class HashChunkletManager implements ChunkletManager {
/** /**
* @param location Where on the disk to read from * @param location Where on the disk to read from
*
* @return ChunkletStore from the specified location * @return ChunkletStore from the specified location
*/ */
private ChunkletStore deserializeChunkletStore(File location) { private ChunkletStore deserializeChunkletStore(File location) {

View File

@ -5,7 +5,7 @@ import org.bukkit.block.Block;
/** /**
* A ChunkletManager implementation that does nothing and returns false for all checks. * A ChunkletManager implementation that does nothing and returns false for all checks.
* * <p/>
* Useful for turning off Chunklets without actually doing much work * Useful for turning off Chunklets without actually doing much work
*/ */
public class NullChunkletManager implements ChunkletManager { public class NullChunkletManager implements ChunkletManager {

View File

@ -121,6 +121,7 @@ public interface ChunkManager {
* @param y Y coordinate to check * @param y Y coordinate to check
* @param z Z coordinate to check * @param z Z coordinate to check
* @param world World to check in * @param world World to check in
*
* @return true if the given location is set to true, false if otherwise * @return true if the given location is set to true, false if otherwise
*/ */
public boolean isTrue(int x, int y, int z, World world); public boolean isTrue(int x, int y, int z, World world);
@ -129,6 +130,7 @@ public interface ChunkManager {
* Check to see if a given block location is set to true * Check to see if a given block location is set to true
* *
* @param block Block location to check * @param block Block location to check
*
* @return true if the given block location is set to true, false if otherwise * @return true if the given block location is set to true, false if otherwise
*/ */
public boolean isTrue(Block block); public boolean isTrue(Block block);
@ -137,6 +139,7 @@ public interface ChunkManager {
* Check to see if a given BlockState location is set to true * Check to see if a given BlockState location is set to true
* *
* @param blockState BlockState to check * @param blockState BlockState to check
*
* @return true if the given BlockState location is set to true, false if otherwise * @return true if the given BlockState location is set to true, false if otherwise
*/ */
public boolean isTrue(BlockState blockState); public boolean isTrue(BlockState blockState);

View File

@ -42,6 +42,7 @@ public interface ChunkStore extends Serializable {
* @param x x coordinate in current chunklet * @param x x coordinate in current chunklet
* @param y y coordinate in current chunklet * @param y y coordinate in current chunklet
* @param z z coordinate in current chunklet * @param z z coordinate in current chunklet
*
* @return true if the value is true at the given coordinates, false if otherwise * @return true if the value is true at the given coordinates, false if otherwise
*/ */
public boolean isTrue(int x, int y, int z); public boolean isTrue(int x, int y, int z);

View File

@ -160,7 +160,8 @@ public class HashChunkManager implements ChunkManager {
try { try {
chunkStore = readChunkStore(world, cx, cz); chunkStore = readChunkStore(world, cx, cz);
} }
catch (Exception e) {} catch (Exception e) {
}
if (chunkStore == null) { if (chunkStore == null) {
return; return;

View File

@ -143,7 +143,8 @@ public class PrimitiveChunkStore implements ChunkStore {
try { try {
store[x][z][y] = temp[x][y][z]; store[x][z][y] = temp[x][y][z];
} }
catch (Exception e) {} catch (Exception e) {
}
} }
} }
} }

View File

@ -117,7 +117,8 @@ public class BlockStoreConversionZDirectory implements Runnable {
this.newManager.setTrue(this.cxPos, this.y2, this.czPos, this.world); this.newManager.setTrue(this.cxPos, this.y2, this.czPos, this.world);
} }
catch (Exception e) {} catch (Exception e) {
}
} }
} }
} }

View File

@ -52,7 +52,7 @@ import com.gmail.nossr50.locale.LocaleLoader;
import com.gmail.nossr50.util.StringUtils; import com.gmail.nossr50.util.StringUtils;
public final class CommandRegistrationManager { public final class CommandRegistrationManager {
private CommandRegistrationManager() {}; private CommandRegistrationManager() {}
private static String permissionsMessage = LocaleLoader.getString("mcMMO.NoPermission"); private static String permissionsMessage = LocaleLoader.getString("mcMMO.NoPermission");

View File

@ -58,7 +58,7 @@ public final class CommandUtils {
} }
public static boolean hidden(CommandSender sender, Player target, boolean hasPermission) { public static boolean hidden(CommandSender sender, Player target, boolean hasPermission) {
if (sender instanceof Player && !((Player)sender).canSee(target) && !hasPermission) { if (sender instanceof Player && !((Player) sender).canSee(target) && !hasPermission) {
return true; return true;
} }

View File

@ -51,6 +51,7 @@ public class FormulaManager {
* *
* @param skillLevel Amount of levels * @param skillLevel Amount of levels
* @param skillXPLevel Amount of experience * @param skillXPLevel Amount of experience
*
* @return The total amount of experience * @return The total amount of experience
*/ */
public int calculateTotalExperience(int skillLevel, int skillXPLevel) { public int calculateTotalExperience(int skillLevel, int skillXPLevel) {
@ -72,6 +73,7 @@ public class FormulaManager {
* @param skillType skill where new levels and experience are calculated for * @param skillType skill where new levels and experience are calculated for
* @param experience total amount of experience * @param experience total amount of experience
* @param formulaType The new {@link FormulaType} * @param formulaType The new {@link FormulaType}
*
* @return the amount of levels and experience * @return the amount of levels and experience
*/ */
public int[] calculateNewLevel(SkillType skillType, int experience, FormulaType formulaType) { public int[] calculateNewLevel(SkillType skillType, int experience, FormulaType formulaType) {
@ -101,6 +103,7 @@ public class FormulaManager {
* *
* @param level level to check * @param level level to check
* @param formulaType The {@link FormulaType} used * @param formulaType The {@link FormulaType} used
*
* @return amount of experience needed to reach next level * @return amount of experience needed to reach next level
*/ */
public int getCachedXpToLevel(int level, FormulaType formulaType) { public int getCachedXpToLevel(int level, FormulaType formulaType) {

View File

@ -20,6 +20,7 @@ public final class UserManager {
* Add a new user. * Add a new user.
* *
* @param player The player to create a user record for * @param player The player to create a user record for
*
* @return the player's {@link McMMOPlayer} object * @return the player's {@link McMMOPlayer} object
*/ */
public static McMMOPlayer addUser(Player player) { public static McMMOPlayer addUser(Player player) {
@ -74,6 +75,7 @@ public final class UserManager {
* Get the McMMOPlayer of a player by name. * Get the McMMOPlayer of a player by name.
* *
* @param playerName The name of the player whose McMMOPlayer to retrieve * @param playerName The name of the player whose McMMOPlayer to retrieve
*
* @return the player's McMMOPlayer object * @return the player's McMMOPlayer object
*/ */
public static McMMOPlayer getPlayer(String playerName) { public static McMMOPlayer getPlayer(String playerName) {
@ -84,6 +86,7 @@ public final class UserManager {
* Get the McMMOPlayer of a player. * Get the McMMOPlayer of a player.
* *
* @param player The player whose McMMOPlayer to retrieve * @param player The player whose McMMOPlayer to retrieve
*
* @return the player's McMMOPlayer object * @return the player's McMMOPlayer object
*/ */
public static McMMOPlayer getPlayer(OfflinePlayer player) { public static McMMOPlayer getPlayer(OfflinePlayer player) {

View File

@ -541,6 +541,7 @@ public final class CombatUtils {
* *
* @param player The attacking Player * @param player The attacking Player
* @param entity The defending Entity * @param entity The defending Entity
*
* @return true if the Entity should be damaged, false otherwise. * @return true if the Entity should be damaged, false otherwise.
*/ */
private static boolean shouldBeAffected(Player player, Entity entity) { private static boolean shouldBeAffected(Player player, Entity entity) {
@ -579,6 +580,7 @@ public final class CombatUtils {
* *
* @param entity The {@link LivingEntity} to check * @param entity The {@link LivingEntity} to check
* @param eventDamage The damage from the event the entity is involved in * @param eventDamage The damage from the event the entity is involved in
*
* @return true if the entity is invincible, false otherwise * @return true if the entity is invincible, false otherwise
*/ */
public static boolean isInvincible(LivingEntity entity, double eventDamage) { public static boolean isInvincible(LivingEntity entity, double eventDamage) {
@ -594,6 +596,7 @@ public final class CombatUtils {
* *
* @param attacker The player to check. * @param attacker The player to check.
* @param pet The entity to check. * @param pet The entity to check.
*
* @return true if the entity is friendly, false otherwise * @return true if the entity is friendly, false otherwise
*/ */
public static boolean isFriendlyPet(Player attacker, Tameable pet) { public static boolean isFriendlyPet(Player attacker, Tameable pet) {

View File

@ -20,7 +20,7 @@ import com.gmail.nossr50.datatypes.skills.SkillType;
public final class ParticleEffectUtils { public final class ParticleEffectUtils {
private ParticleEffectUtils() {}; private ParticleEffectUtils() {}
public static void playBleedEffect(LivingEntity livingEntity) { public static void playBleedEffect(LivingEntity livingEntity) {
if (!Config.getInstance().getBleedEffectEnabled()) { if (!Config.getInstance().getBleedEffectEnabled()) {

View File

@ -9,7 +9,7 @@ public final class PerksUtils {
private static final int LUCKY_SKILL_ACTIVATION_CHANCE = 75; private static final int LUCKY_SKILL_ACTIVATION_CHANCE = 75;
private static final int NORMAL_SKILL_ACTIVATION_CHANCE = 100; private static final int NORMAL_SKILL_ACTIVATION_CHANCE = 100;
private PerksUtils() {}; private PerksUtils() {}
public static int handleCooldownPerks(Player player, int cooldown) { public static int handleCooldownPerks(Player player, int cooldown) {
if (Permissions.halvedCooldowns(player)) { if (Permissions.halvedCooldowns(player)) {
@ -68,6 +68,7 @@ public final class PerksUtils {
* *
* @param player Player to check the activation chance for * @param player Player to check the activation chance for
* @param skill SkillType to check the activation chance of * @param skill SkillType to check the activation chance of
*
* @return the activation chance with "lucky perk" accounted for * @return the activation chance with "lucky perk" accounted for
*/ */
public static int handleLuckyPerks(Player player, SkillType skill) { public static int handleLuckyPerks(Player player, SkillType skill) {

View File

@ -70,6 +70,7 @@ public class SkillUtils {
* Checks if the given string represents a valid skill * Checks if the given string represents a valid skill
* *
* @param skillName The name of the skill to check * @param skillName The name of the skill to check
*
* @return true if this is a valid skill, false otherwise * @return true if this is a valid skill, false otherwise
*/ */
public static boolean isSkill(String skillName) { public static boolean isSkill(String skillName) {
@ -171,6 +172,7 @@ public class SkillUtils {
* Modify the durability of an ItemStack. * Modify the durability of an ItemStack.
* *
* @param itemStack The ItemStack which durability should be modified * @param itemStack The ItemStack which durability should be modified
*
* @return the itemStack with modified durability * @return the itemStack with modified durability
*/ */
public static void handleDurabilityChange(ItemStack itemStack, int durabilityModifier) { public static void handleDurabilityChange(ItemStack itemStack, int durabilityModifier) {