mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2025-07-31 11:35:28 +02:00
clean up if/else formatting
This commit is contained in:
@@ -77,8 +77,7 @@ public final class CombatUtils {
|
||||
}
|
||||
|
||||
//Add Stab Damage
|
||||
if (swordsManager.canUseStab())
|
||||
{
|
||||
if (swordsManager.canUseStab()) {
|
||||
boostedDamage += (swordsManager.getStabDamage() * mcMMOPlayer.getAttackStrength());
|
||||
}
|
||||
|
||||
@@ -86,8 +85,7 @@ public final class CombatUtils {
|
||||
swordsManager.serratedStrikes(target, event.getDamage());
|
||||
}
|
||||
|
||||
if (canUseLimitBreak(player, target, SubSkillType.SWORDS_SWORDS_LIMIT_BREAK))
|
||||
{
|
||||
if (canUseLimitBreak(player, target, SubSkillType.SWORDS_SWORDS_LIMIT_BREAK)) {
|
||||
boostedDamage += (getLimitBreakDamage(player, target, SubSkillType.SWORDS_SWORDS_LIMIT_BREAK) * mcMMOPlayer.getAttackStrength());
|
||||
}
|
||||
|
||||
@@ -264,8 +262,7 @@ public final class CombatUtils {
|
||||
|
||||
if (axesManager.canImpact(target)) {
|
||||
axesManager.impactCheck(target);
|
||||
}
|
||||
else if (axesManager.canGreaterImpact(target)) {
|
||||
} else if (axesManager.canGreaterImpact(target)) {
|
||||
boostedDamage+=axesManager.greaterImpact(target);
|
||||
}
|
||||
|
||||
@@ -277,8 +274,7 @@ public final class CombatUtils {
|
||||
boostedDamage+=(axesManager.criticalHit(target, boostedDamage) * mcMMOPlayer.getAttackStrength());
|
||||
}
|
||||
|
||||
if (canUseLimitBreak(player, target, SubSkillType.AXES_AXES_LIMIT_BREAK))
|
||||
{
|
||||
if (canUseLimitBreak(player, target, SubSkillType.AXES_AXES_LIMIT_BREAK)) {
|
||||
boostedDamage+=(getLimitBreakDamage(player, target, SubSkillType.AXES_AXES_LIMIT_BREAK) * mcMMOPlayer.getAttackStrength());
|
||||
}
|
||||
|
||||
@@ -320,8 +316,7 @@ public final class CombatUtils {
|
||||
unarmedManager.disarmCheck((Player) target);
|
||||
}
|
||||
|
||||
if (canUseLimitBreak(player, target, SubSkillType.UNARMED_UNARMED_LIMIT_BREAK))
|
||||
{
|
||||
if (canUseLimitBreak(player, target, SubSkillType.UNARMED_UNARMED_LIMIT_BREAK)) {
|
||||
boostedDamage+=(getLimitBreakDamage(player, target, SubSkillType.UNARMED_UNARMED_LIMIT_BREAK) * mcMMOPlayer.getAttackStrength());
|
||||
}
|
||||
|
||||
@@ -394,8 +389,7 @@ public final class CombatUtils {
|
||||
archeryManager.retrieveArrows(target, arrow);
|
||||
}
|
||||
|
||||
if (canUseLimitBreak(player, target, SubSkillType.ARCHERY_ARCHERY_LIMIT_BREAK))
|
||||
{
|
||||
if (canUseLimitBreak(player, target, SubSkillType.ARCHERY_ARCHERY_LIMIT_BREAK)) {
|
||||
boostedDamage+=getLimitBreakDamage(player, target, SubSkillType.ARCHERY_ARCHERY_LIMIT_BREAK);
|
||||
}
|
||||
|
||||
@@ -494,8 +488,7 @@ public final class CombatUtils {
|
||||
processSwordCombat(target, player, event);
|
||||
|
||||
}
|
||||
}
|
||||
else if (ItemUtils.isAxe(heldItem)) {
|
||||
} else if (ItemUtils.isAxe(heldItem)) {
|
||||
if (!mcMMO.p.getSkillTools().canCombatSkillsTrigger(PrimarySkillType.AXES, target)) {
|
||||
return;
|
||||
}
|
||||
@@ -503,8 +496,7 @@ public final class CombatUtils {
|
||||
if (mcMMO.p.getSkillTools().doesPlayerHaveSkillPermission(player, PrimarySkillType.AXES)) {
|
||||
processAxeCombat(target, player, event);
|
||||
}
|
||||
}
|
||||
else if (ItemUtils.isUnarmed(heldItem)) {
|
||||
} else if (ItemUtils.isUnarmed(heldItem)) {
|
||||
if (!mcMMO.p.getSkillTools().canCombatSkillsTrigger(PrimarySkillType.UNARMED, target)) {
|
||||
return;
|
||||
}
|
||||
@@ -512,8 +504,7 @@ public final class CombatUtils {
|
||||
if (mcMMO.p.getSkillTools().doesPlayerHaveSkillPermission(player, PrimarySkillType.UNARMED)) {
|
||||
processUnarmedCombat(target, player, event);
|
||||
}
|
||||
}
|
||||
else if (ItemUtils.isTrident(heldItem)) {
|
||||
} else if (ItemUtils.isTrident(heldItem)) {
|
||||
if (!mcMMO.p.getSkillTools().canCombatSkillsTrigger(PrimarySkillType.TRIDENTS, target)) {
|
||||
return;
|
||||
}
|
||||
@@ -521,8 +512,7 @@ public final class CombatUtils {
|
||||
if (mcMMO.p.getSkillTools().doesPlayerHaveSkillPermission(player, PrimarySkillType.TRIDENTS)) {
|
||||
processTridentCombatMelee(target, player, event);
|
||||
}
|
||||
}
|
||||
else if (ItemUtils.isMace(heldItem)) {
|
||||
} else if (ItemUtils.isMace(heldItem)) {
|
||||
if (!mcMMO.p.getSkillTools().canCombatSkillsTrigger(PrimarySkillType.MACES, target)) {
|
||||
return;
|
||||
}
|
||||
@@ -543,8 +533,7 @@ public final class CombatUtils {
|
||||
processTamingCombat(target, master, wolf, event);
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (painSource instanceof Trident trident) {
|
||||
} else if (painSource instanceof Trident trident) {
|
||||
ProjectileSource projectileSource = trident.getShooter();
|
||||
|
||||
if (projectileSource instanceof Player player) {
|
||||
@@ -554,8 +543,7 @@ public final class CombatUtils {
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (painSource instanceof Arrow arrow) {
|
||||
} else if (painSource instanceof Arrow arrow) {
|
||||
ProjectileSource projectileSource = arrow.getShooter();
|
||||
boolean isCrossbow = arrow.isShotFromCrossbow();
|
||||
if (projectileSource instanceof Player player) {
|
||||
@@ -590,8 +578,7 @@ public final class CombatUtils {
|
||||
* This cleans up names from displaying in chat as hearts
|
||||
* @param entity target entity
|
||||
*/
|
||||
public static void fixNames(@NotNull LivingEntity entity)
|
||||
{
|
||||
public static void fixNames(@NotNull LivingEntity entity) {
|
||||
List<MetadataValue> metadataValue = entity.getMetadata(MetadataConstants.METADATA_KEY_OLD_NAME_KEY);
|
||||
|
||||
if (metadataValue.size() <= 0)
|
||||
@@ -887,37 +874,27 @@ public final class CombatUtils {
|
||||
&& SkillUtils.cooldownExpired(mcMMOPlayer.getRespawnATS(), Misc.PLAYER_RESPAWN_COOLDOWN_SECONDS)) {
|
||||
baseXP = 20 * ExperienceConfig.getInstance().getPlayerVersusPlayerXP();
|
||||
}
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
if (mcMMO.getModManager().isCustomEntity(target)) {
|
||||
baseXP = mcMMO.getModManager().getEntity(target).getXpMultiplier();
|
||||
}
|
||||
else if (target instanceof Animals) {
|
||||
} else if (target instanceof Animals) {
|
||||
EntityType type = target.getType();
|
||||
baseXP = ExperienceConfig.getInstance().getAnimalsXP(type);
|
||||
}
|
||||
else if (target instanceof Monster)
|
||||
{
|
||||
} else if (target instanceof Monster) {
|
||||
EntityType type = target.getType();
|
||||
baseXP = ExperienceConfig.getInstance().getCombatXP(type);
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
EntityType type = target.getType();
|
||||
|
||||
if (ExperienceConfig.getInstance().hasCombatXP(type)) {
|
||||
if (type == EntityType.IRON_GOLEM)
|
||||
{
|
||||
if (type == EntityType.IRON_GOLEM) {
|
||||
if (!((IronGolem) target).isPlayerCreated()) {
|
||||
baseXP = ExperienceConfig.getInstance().getCombatXP(type);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
} else {
|
||||
baseXP = ExperienceConfig.getInstance().getCombatXP(type);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
} else {
|
||||
baseXP = 1.0;
|
||||
mcMMO.getModManager().addCustomEntity(target);
|
||||
}
|
||||
@@ -1036,22 +1013,17 @@ public final class CombatUtils {
|
||||
|
||||
if (ItemUtils.isWoodTool(inHand)) {
|
||||
tier = 1;
|
||||
}
|
||||
else if (ItemUtils.isStoneTool(inHand)) {
|
||||
} else if (ItemUtils.isStoneTool(inHand)) {
|
||||
tier = 2;
|
||||
}
|
||||
else if (ItemUtils.isIronTool(inHand)) {
|
||||
} else if (ItemUtils.isIronTool(inHand)) {
|
||||
tier = 3;
|
||||
}
|
||||
else if (ItemUtils.isGoldTool(inHand)) {
|
||||
} else if (ItemUtils.isGoldTool(inHand)) {
|
||||
tier = 1;
|
||||
}
|
||||
else if (ItemUtils.isDiamondTool(inHand)) {
|
||||
} else if (ItemUtils.isDiamondTool(inHand)) {
|
||||
tier = 4;
|
||||
} else if (ItemUtils.isNetheriteTool(inHand)) {
|
||||
tier = 5;
|
||||
}
|
||||
else if (mcMMO.getModManager().isCustomTool(inHand)) {
|
||||
} else if (mcMMO.getModManager().isCustomTool(inHand)) {
|
||||
tier = mcMMO.getModManager().getTool(inHand).getTier();
|
||||
}
|
||||
|
||||
|
@@ -19,11 +19,9 @@ public final class PerksUtils {
|
||||
public static int handleCooldownPerks(Player player, int cooldown) {
|
||||
if (Permissions.halvedCooldowns(player)) {
|
||||
cooldown *= 0.5;
|
||||
}
|
||||
else if (Permissions.thirdedCooldowns(player)) {
|
||||
} else if (Permissions.thirdedCooldowns(player)) {
|
||||
cooldown *= (2.0 / 3.0);
|
||||
}
|
||||
else if (Permissions.quarteredCooldowns(player)) {
|
||||
} else if (Permissions.quarteredCooldowns(player)) {
|
||||
cooldown *= 0.75;
|
||||
}
|
||||
|
||||
@@ -37,11 +35,9 @@ public final class PerksUtils {
|
||||
|
||||
if (Permissions.twelveSecondActivationBoost(player)) {
|
||||
ticks += 12;
|
||||
}
|
||||
else if (Permissions.eightSecondActivationBoost(player)) {
|
||||
} else if (Permissions.eightSecondActivationBoost(player)) {
|
||||
ticks += 8;
|
||||
}
|
||||
else if (Permissions.fourSecondActivationBoost(player)) {
|
||||
} else if (Permissions.fourSecondActivationBoost(player)) {
|
||||
ticks += 4;
|
||||
}
|
||||
|
||||
@@ -59,26 +55,19 @@ public final class PerksUtils {
|
||||
}
|
||||
|
||||
modifier = ExperienceConfig.getInstance().getCustomXpPerkBoost();
|
||||
}
|
||||
else if (Permissions.quadrupleXp(player, skill)) {
|
||||
} else if (Permissions.quadrupleXp(player, skill)) {
|
||||
modifier = 4;
|
||||
}
|
||||
else if (Permissions.tripleXp(player, skill)) {
|
||||
} else if (Permissions.tripleXp(player, skill)) {
|
||||
modifier = 3;
|
||||
}
|
||||
else if (Permissions.doubleAndOneHalfXp(player, skill)) {
|
||||
} else if (Permissions.doubleAndOneHalfXp(player, skill)) {
|
||||
modifier = 2.5;
|
||||
}
|
||||
else if (Permissions.doubleXp(player, skill)) {
|
||||
} else if (Permissions.doubleXp(player, skill)) {
|
||||
modifier = 2;
|
||||
}
|
||||
else if (Permissions.oneAndOneHalfXp(player, skill)) {
|
||||
} else if (Permissions.oneAndOneHalfXp(player, skill)) {
|
||||
modifier = 1.5;
|
||||
}
|
||||
else if (Permissions.oneAndAQuarterXp(player, skill)) {
|
||||
} else if (Permissions.oneAndAQuarterXp(player, skill)) {
|
||||
modifier = 1.25;
|
||||
}
|
||||
else if (Permissions.oneAndOneTenthXp(player, skill)) {
|
||||
} else if (Permissions.oneAndOneTenthXp(player, skill)) {
|
||||
modifier = 1.1;
|
||||
}
|
||||
|
||||
|
@@ -27,10 +27,8 @@ public class RankUtils {
|
||||
* @param primarySkillType the skill to check
|
||||
* @param newLevel the new level of this skill
|
||||
*/
|
||||
public static void executeSkillUnlockNotifications(Plugin plugin, McMMOPlayer mcMMOPlayer, PrimarySkillType primarySkillType, int newLevel)
|
||||
{
|
||||
for(SubSkillType subSkillType : mcMMO.p.getSkillTools().getSubSkills(primarySkillType))
|
||||
{
|
||||
public static void executeSkillUnlockNotifications(Plugin plugin, McMMOPlayer mcMMOPlayer, PrimarySkillType primarySkillType, int newLevel) {
|
||||
for(SubSkillType subSkillType : mcMMO.p.getSkillTools().getSubSkills(primarySkillType)) {
|
||||
int playerRankInSkill = getRank(mcMMOPlayer.getPlayer(), subSkillType);
|
||||
|
||||
HashMap<Integer, Integer> innerMap = subSkillRanks.get(subSkillType.toString());
|
||||
@@ -44,8 +42,7 @@ public class RankUtils {
|
||||
continue;
|
||||
|
||||
//The players level is the exact level requirement for this skill
|
||||
if (newLevel == innerMap.get(playerRankInSkill))
|
||||
{
|
||||
if (newLevel == innerMap.get(playerRankInSkill)) {
|
||||
SkillUnlockNotificationTask skillUnlockNotificationTask = new SkillUnlockNotificationTask(mcMMOPlayer, subSkillType, newLevel);
|
||||
|
||||
mcMMO.p.getFoliaLib().getImpl().runAtEntityLater(mcMMOPlayer.getPlayer(), skillUnlockNotificationTask, (count * 100L));
|
||||
@@ -58,17 +55,14 @@ public class RankUtils {
|
||||
/**
|
||||
* Reset the interval between skill unlock notifications
|
||||
*/
|
||||
public static void resetUnlockDelayTimer()
|
||||
{
|
||||
public static void resetUnlockDelayTimer() {
|
||||
count = 0;
|
||||
}
|
||||
|
||||
/* NEW SYSTEM */
|
||||
private static void addRanks(AbstractSubSkill abstractSubSkill)
|
||||
{
|
||||
private static void addRanks(AbstractSubSkill abstractSubSkill) {
|
||||
//Fill out the rank array
|
||||
for(int i = 0; i < abstractSubSkill.getNumRanks(); i++)
|
||||
{
|
||||
for(int i = 0; i < abstractSubSkill.getNumRanks(); i++) {
|
||||
//This adds the highest ranks first
|
||||
addRank(abstractSubSkill, abstractSubSkill.getNumRanks()-i);
|
||||
|
||||
@@ -77,11 +71,9 @@ public class RankUtils {
|
||||
}
|
||||
}
|
||||
|
||||
private static void addRanks(SubSkillType subSkillType)
|
||||
{
|
||||
private static void addRanks(SubSkillType subSkillType) {
|
||||
//Fill out the rank array
|
||||
for(int i = 0; i < subSkillType.getNumRanks(); i++)
|
||||
{
|
||||
for(int i = 0; i < subSkillType.getNumRanks(); i++) {
|
||||
//This adds the highest ranks first
|
||||
addRank(subSkillType, subSkillType.getNumRanks()-i);
|
||||
|
||||
@@ -93,15 +85,12 @@ public class RankUtils {
|
||||
/**
|
||||
* Populates the ranks for every skill we know about
|
||||
*/
|
||||
public static void populateRanks()
|
||||
{
|
||||
for(SubSkillType subSkillType : SubSkillType.values())
|
||||
{
|
||||
public static void populateRanks() {
|
||||
for(SubSkillType subSkillType : SubSkillType.values()) {
|
||||
addRanks(subSkillType);
|
||||
}
|
||||
|
||||
for(AbstractSubSkill abstractSubSkill : InteractionManager.getSubSkillList())
|
||||
{
|
||||
for(AbstractSubSkill abstractSubSkill : InteractionManager.getSubSkillList()) {
|
||||
addRanks(abstractSubSkill);
|
||||
}
|
||||
}
|
||||
@@ -112,8 +101,7 @@ public class RankUtils {
|
||||
* @param subSkillType the target subskill
|
||||
* @return true if the player has at least one rank in the skill
|
||||
*/
|
||||
public static boolean hasUnlockedSubskill(Player player, SubSkillType subSkillType)
|
||||
{
|
||||
public static boolean hasUnlockedSubskill(Player player, SubSkillType subSkillType) {
|
||||
int curRank = getRank(player, subSkillType);
|
||||
|
||||
//-1 means the skill has no unlockable levels and is therefor unlocked
|
||||
@@ -126,8 +114,7 @@ public class RankUtils {
|
||||
* @param abstractSubSkill the target subskill
|
||||
* @return true if the player has at least one rank in the skill
|
||||
*/
|
||||
public static boolean hasUnlockedSubskill(Player player, AbstractSubSkill abstractSubSkill)
|
||||
{
|
||||
public static boolean hasUnlockedSubskill(Player player, AbstractSubSkill abstractSubSkill) {
|
||||
int curRank = getRank(player, abstractSubSkill);
|
||||
|
||||
//-1 means the skill has no unlockable levels and is therefor unlocked
|
||||
@@ -141,8 +128,7 @@ public class RankUtils {
|
||||
* @param subSkillType the target subskill
|
||||
* @return true if the player is at least that rank in this subskill
|
||||
*/
|
||||
public static boolean hasReachedRank(int rank, Player player, SubSkillType subSkillType)
|
||||
{
|
||||
public static boolean hasReachedRank(int rank, Player player, SubSkillType subSkillType) {
|
||||
return getRank(player, subSkillType) >= rank;
|
||||
}
|
||||
|
||||
@@ -153,8 +139,7 @@ public class RankUtils {
|
||||
* @param abstractSubSkill the target subskill
|
||||
* @return true if the player is at least that rank in this subskill
|
||||
*/
|
||||
public static boolean hasReachedRank(int rank, Player player, AbstractSubSkill abstractSubSkill)
|
||||
{
|
||||
public static boolean hasReachedRank(int rank, Player player, AbstractSubSkill abstractSubSkill) {
|
||||
return getRank(player, abstractSubSkill) >= rank;
|
||||
}
|
||||
|
||||
@@ -164,8 +149,7 @@ public class RankUtils {
|
||||
* @param subSkillType Target subskill
|
||||
* @return The rank the player currently has achieved in this skill. -1 for skills without ranks.
|
||||
*/
|
||||
public static int getRank(McMMOPlayer mmoPlayer, SubSkillType subSkillType)
|
||||
{
|
||||
public static int getRank(McMMOPlayer mmoPlayer, SubSkillType subSkillType) {
|
||||
return getRank(mmoPlayer.getPlayer(), subSkillType);
|
||||
}
|
||||
|
||||
@@ -175,8 +159,7 @@ public class RankUtils {
|
||||
* @param subSkillType Target subskill
|
||||
* @return The rank the player currently has achieved in this skill. -1 for skills without ranks.
|
||||
*/
|
||||
public static int getRank(Player player, SubSkillType subSkillType)
|
||||
{
|
||||
public static int getRank(Player player, SubSkillType subSkillType) {
|
||||
String skillName = subSkillType.toString();
|
||||
int numRanks = subSkillType.getNumRanks();
|
||||
|
||||
@@ -198,8 +181,7 @@ public class RankUtils {
|
||||
//Skill level of parent skill
|
||||
int currentSkillLevel = UserManager.getPlayer(player).getSkillLevel(subSkillType.getParentSkill());
|
||||
|
||||
for(int i = 0; i < numRanks; i++)
|
||||
{
|
||||
for(int i = 0; i < numRanks; i++) {
|
||||
//Compare against the highest to lowest rank in that order
|
||||
int rank = numRanks-i;
|
||||
int unlockLevel = getRankUnlockLevel(subSkillType, rank);
|
||||
@@ -222,8 +204,7 @@ public class RankUtils {
|
||||
* @param abstractSubSkill Target subskill
|
||||
* @return The rank the player currently has achieved in this skill. -1 for skills without ranks.
|
||||
*/
|
||||
public static int getRank(Player player, AbstractSubSkill abstractSubSkill)
|
||||
{
|
||||
public static int getRank(Player player, AbstractSubSkill abstractSubSkill) {
|
||||
String skillName = abstractSubSkill.getConfigKeyName();
|
||||
int numRanks = abstractSubSkill.getNumRanks();
|
||||
|
||||
@@ -245,8 +226,7 @@ public class RankUtils {
|
||||
//Skill level of parent skill
|
||||
int currentSkillLevel = UserManager.getPlayer(player).getSkillLevel(abstractSubSkill.getPrimarySkill());
|
||||
|
||||
for(int i = 0; i < numRanks; i++)
|
||||
{
|
||||
for(int i = 0; i < numRanks; i++) {
|
||||
//Compare against the highest to lowest rank in that order
|
||||
int rank = numRanks-i;
|
||||
int unlockLevel = getRankUnlockLevel(abstractSubSkill, rank);
|
||||
@@ -268,8 +248,7 @@ public class RankUtils {
|
||||
* @param abstractSubSkill The subskill to add ranks for
|
||||
* @param rank The rank to add
|
||||
*/
|
||||
private static void addRank(AbstractSubSkill abstractSubSkill, int rank)
|
||||
{
|
||||
private static void addRank(AbstractSubSkill abstractSubSkill, int rank) {
|
||||
initMaps(abstractSubSkill.getConfigKeyName());
|
||||
|
||||
HashMap<Integer, Integer> rankMap = subSkillRanks.get(abstractSubSkill.getConfigKeyName());
|
||||
@@ -278,8 +257,7 @@ public class RankUtils {
|
||||
}
|
||||
|
||||
@Deprecated
|
||||
private static void addRank(SubSkillType subSkillType, int rank)
|
||||
{
|
||||
private static void addRank(SubSkillType subSkillType, int rank) {
|
||||
initMaps(subSkillType.toString());
|
||||
|
||||
HashMap<Integer, Integer> rankMap = subSkillRanks.get(subSkillType.toString());
|
||||
@@ -300,13 +278,11 @@ public class RankUtils {
|
||||
* @param rank The target rank
|
||||
* @return The level at which this rank unlocks
|
||||
*/
|
||||
public static int getRankUnlockLevel(SubSkillType subSkillType, int rank)
|
||||
{
|
||||
public static int getRankUnlockLevel(SubSkillType subSkillType, int rank) {
|
||||
return RankConfig.getInstance().getSubSkillUnlockLevel(subSkillType, rank);
|
||||
}
|
||||
|
||||
public static int getRankUnlockLevel(AbstractSubSkill abstractSubSkill, int rank)
|
||||
{
|
||||
public static int getRankUnlockLevel(AbstractSubSkill abstractSubSkill, int rank) {
|
||||
return RankConfig.getInstance().getSubSkillUnlockLevel(abstractSubSkill, rank);
|
||||
}
|
||||
|
||||
@@ -315,8 +291,7 @@ public class RankUtils {
|
||||
* @param subSkillType target subskill
|
||||
* @return The unlock requirements for rank 1 in this skill
|
||||
*/
|
||||
public static int getUnlockLevel(SubSkillType subSkillType)
|
||||
{
|
||||
public static int getUnlockLevel(SubSkillType subSkillType) {
|
||||
return RankConfig.getInstance().getSubSkillUnlockLevel(subSkillType, 1);
|
||||
}
|
||||
|
||||
@@ -325,8 +300,7 @@ public class RankUtils {
|
||||
* @param abstractSubSkill target subskill
|
||||
* @return The unlock requirements for rank 1 in this skill
|
||||
*/
|
||||
public static int getUnlockLevel(AbstractSubSkill abstractSubSkill)
|
||||
{
|
||||
public static int getUnlockLevel(AbstractSubSkill abstractSubSkill) {
|
||||
return RankConfig.getInstance().getSubSkillUnlockLevel(abstractSubSkill, 1);
|
||||
}
|
||||
|
||||
@@ -335,13 +309,11 @@ public class RankUtils {
|
||||
* @param subSkillType target subskill
|
||||
* @return the last rank of a subskill
|
||||
*/
|
||||
public static int getHighestRank(SubSkillType subSkillType)
|
||||
{
|
||||
public static int getHighestRank(SubSkillType subSkillType) {
|
||||
return subSkillType.getNumRanks();
|
||||
}
|
||||
|
||||
public static String getHighestRankStr(SubSkillType subSkillType)
|
||||
{
|
||||
public static String getHighestRankStr(SubSkillType subSkillType) {
|
||||
return String.valueOf(subSkillType.getNumRanks());
|
||||
}
|
||||
|
||||
@@ -350,13 +322,11 @@ public class RankUtils {
|
||||
* @param abstractSubSkill target subskill
|
||||
* @return the last rank of a subskill
|
||||
*/
|
||||
public static int getHighestRank(AbstractSubSkill abstractSubSkill)
|
||||
{
|
||||
public static int getHighestRank(AbstractSubSkill abstractSubSkill) {
|
||||
return abstractSubSkill.getNumRanks();
|
||||
}
|
||||
|
||||
public static int getSuperAbilityUnlockRequirement(SuperAbilityType superAbilityType)
|
||||
{
|
||||
public static int getSuperAbilityUnlockRequirement(SuperAbilityType superAbilityType) {
|
||||
return getRankUnlockLevel(superAbilityType.getSubSkillTypeDefinition(), 1);
|
||||
}
|
||||
|
||||
|
@@ -61,8 +61,7 @@ public final class SkillUtils {
|
||||
|
||||
int length;
|
||||
|
||||
if (abilityLengthCap > 0)
|
||||
{
|
||||
if (abilityLengthCap > 0) {
|
||||
length = (int) Math.min(abilityLengthCap, 2 + (skillValue / abilityLengthVar));
|
||||
} else {
|
||||
length = 2 + (int) (skillValue / abilityLengthVar);
|
||||
@@ -181,8 +180,7 @@ public final class SkillUtils {
|
||||
|
||||
int ticks;
|
||||
|
||||
if (abilityLengthCap > 0)
|
||||
{
|
||||
if (abilityLengthCap > 0) {
|
||||
ticks = PerksUtils.handleActivationPerks(player, Math.min(abilityLengthCap, 2 + (mcMMOPlayer.getSkillLevel(skill) / abilityLengthVar)),
|
||||
mcMMO.p.getSkillTools().getSuperAbilityMaxLength(mcMMO.p.getSkillTools().getSuperAbility(skill))) * Misc.TICK_CONVERSION_FACTOR;
|
||||
} else {
|
||||
@@ -284,26 +282,19 @@ public final class SkillUtils {
|
||||
public static Material getRepairAndSalvageItem(@NotNull ItemStack inHand) {
|
||||
if (ItemUtils.isDiamondTool(inHand) || ItemUtils.isDiamondArmor(inHand)) {
|
||||
return Material.DIAMOND;
|
||||
}
|
||||
else if (ItemUtils.isGoldTool(inHand) || ItemUtils.isGoldArmor(inHand)) {
|
||||
} else if (ItemUtils.isGoldTool(inHand) || ItemUtils.isGoldArmor(inHand)) {
|
||||
return Material.GOLD_INGOT;
|
||||
}
|
||||
else if (ItemUtils.isIronTool(inHand) || ItemUtils.isIronArmor(inHand)) {
|
||||
} else if (ItemUtils.isIronTool(inHand) || ItemUtils.isIronArmor(inHand)) {
|
||||
return Material.IRON_INGOT;
|
||||
}
|
||||
else if (ItemUtils.isStoneTool(inHand)) {
|
||||
} else if (ItemUtils.isStoneTool(inHand)) {
|
||||
return Material.COBBLESTONE;
|
||||
}
|
||||
else if (ItemUtils.isWoodTool(inHand)) {
|
||||
} else if (ItemUtils.isWoodTool(inHand)) {
|
||||
return Material.OAK_WOOD;
|
||||
}
|
||||
else if (ItemUtils.isLeatherArmor(inHand)) {
|
||||
} else if (ItemUtils.isLeatherArmor(inHand)) {
|
||||
return Material.LEATHER;
|
||||
}
|
||||
else if (ItemUtils.isStringTool(inHand)) {
|
||||
} else if (ItemUtils.isStringTool(inHand)) {
|
||||
return Material.STRING;
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user