mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2025-08-03 04:55:28 +02:00
Update code style
This commit is contained in:
@@ -47,9 +47,8 @@ public class SkillUtils {
|
||||
|
||||
int length;
|
||||
|
||||
if(abilityLengthCap > 0)
|
||||
{
|
||||
length = (int) Math.min(abilityLengthCap, 2 + (skillValue / abilityLengthVar));
|
||||
if (abilityLengthCap > 0) {
|
||||
length = (int) Math.min(abilityLengthCap, 2 + (skillValue / abilityLengthVar));
|
||||
} else {
|
||||
length = 2 + (int) (skillValue / abilityLengthVar);
|
||||
}
|
||||
@@ -60,7 +59,7 @@ public class SkillUtils {
|
||||
length = Math.min(length, maxLength);
|
||||
}
|
||||
|
||||
return new String[] { String.valueOf(length), String.valueOf(enduranceLength) };
|
||||
return new String[]{String.valueOf(length), String.valueOf(enduranceLength)};
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -73,7 +72,7 @@ public class SkillUtils {
|
||||
int currentFoodLevel = player.getFoodLevel();
|
||||
int foodChange = eventFoodLevel - currentFoodLevel;
|
||||
|
||||
foodChange+=curRank;
|
||||
foodChange += curRank;
|
||||
|
||||
return currentFoodLevel + foodChange;
|
||||
}
|
||||
@@ -82,9 +81,8 @@ public class SkillUtils {
|
||||
* Calculate the time remaining until the cooldown expires.
|
||||
*
|
||||
* @param deactivatedTimeStamp Time of deactivation
|
||||
* @param cooldown The length of the cooldown
|
||||
* @param player The Player to check for cooldown perks
|
||||
*
|
||||
* @param cooldown The length of the cooldown
|
||||
* @param player The Player to check for cooldown perks
|
||||
* @return the number of seconds remaining before the cooldown expires
|
||||
*/
|
||||
public static int calculateTimeLeft(long deactivatedTimeStamp, int cooldown, Player player) {
|
||||
@@ -96,8 +94,7 @@ public class SkillUtils {
|
||||
* This does NOT account for cooldown perks!
|
||||
*
|
||||
* @param deactivatedTimeStamp Time of deactivation in seconds
|
||||
* @param cooldown The length of the cooldown in seconds
|
||||
*
|
||||
* @param cooldown The length of the cooldown in seconds
|
||||
* @return true if the cooldown is expired
|
||||
*/
|
||||
public static boolean cooldownExpired(long deactivatedTimeStamp, int cooldown) {
|
||||
@@ -207,8 +204,7 @@ public class SkillUtils {
|
||||
|
||||
if (efficiencyLevel <= AdvancedConfig.getInstance().getEnchantBuff()) {
|
||||
itemMeta.removeEnchant(Enchantment.DIG_SPEED);
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
itemMeta.addEnchant(Enchantment.DIG_SPEED, efficiencyLevel - AdvancedConfig.getInstance().getEnchantBuff(), true);
|
||||
}
|
||||
|
||||
@@ -225,9 +221,9 @@ public class SkillUtils {
|
||||
/**
|
||||
* Modify the durability of an ItemStack.
|
||||
*
|
||||
* @param itemStack The ItemStack which durability should be modified
|
||||
* @param itemStack The ItemStack which durability should be modified
|
||||
* @param durabilityModifier the amount to modify the durability by
|
||||
* @param maxDamageModifier the amount to adjust the max damage by
|
||||
* @param maxDamageModifier the amount to adjust the max damage by
|
||||
*/
|
||||
public static void handleDurabilityChange(ItemStack itemStack, int durabilityModifier, double maxDamageModifier) {
|
||||
if (itemStack.hasItemMeta() && itemStack.getItemMeta().isUnbreakable()) {
|
||||
@@ -254,26 +250,19 @@ public class SkillUtils {
|
||||
protected static Material getRepairAndSalvageItem(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;
|
||||
}
|
||||
}
|
||||
@@ -302,8 +291,7 @@ public class SkillUtils {
|
||||
quantity += ingredient.getAmount();
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (recipe instanceof ShapedRecipe) {
|
||||
} else if (recipe instanceof ShapedRecipe) {
|
||||
for (ItemStack ingredient : ((ShapedRecipe) recipe).getIngredientMap().values()) {
|
||||
if (ingredient != null && (repairMaterial == null || ingredient.getType() == repairMaterial) && (repairMetadata == -1 || ingredient.getType().equals(repairMaterial))) {
|
||||
quantity += ingredient.getAmount();
|
||||
|
Reference in New Issue
Block a user