mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2025-07-24 08:05:26 +02:00
if( -> if (
This commit is contained in:
@@ -61,7 +61,7 @@ public final class SkillUtils {
|
||||
|
||||
int length;
|
||||
|
||||
if(abilityLengthCap > 0)
|
||||
if (abilityLengthCap > 0)
|
||||
{
|
||||
length = (int) Math.min(abilityLengthCap, 2 + (skillValue / abilityLengthVar));
|
||||
} else {
|
||||
@@ -142,7 +142,7 @@ public final class SkillUtils {
|
||||
if (HiddenConfig.getInstance().useEnchantmentBuffs()) {
|
||||
ItemStack heldItem = player.getInventory().getItemInMainHand();
|
||||
|
||||
if(heldItem == null)
|
||||
if (heldItem == null)
|
||||
return;
|
||||
|
||||
if (!ItemUtils.canBeSuperAbilityDigBoosted(heldItem)) {
|
||||
@@ -171,7 +171,7 @@ public final class SkillUtils {
|
||||
McMMOPlayer mcMMOPlayer = UserManager.getPlayer(player);
|
||||
|
||||
//Not Loaded
|
||||
if(mcMMOPlayer == null)
|
||||
if (mcMMOPlayer == null)
|
||||
return;
|
||||
|
||||
PrimarySkillType skill = mcMMOPlayer.getAbilityMode(SuperAbilityType.SUPER_BREAKER) ? PrimarySkillType.MINING : PrimarySkillType.EXCAVATION;
|
||||
@@ -181,7 +181,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;
|
||||
@@ -202,18 +202,18 @@ public final class SkillUtils {
|
||||
}
|
||||
|
||||
public static void removeAbilityBuff(@Nullable ItemStack itemStack) {
|
||||
if(itemStack == null)
|
||||
if (itemStack == null)
|
||||
return;
|
||||
|
||||
if(!ItemUtils.canBeSuperAbilityDigBoosted(itemStack))
|
||||
if (!ItemUtils.canBeSuperAbilityDigBoosted(itemStack))
|
||||
return;
|
||||
|
||||
|
||||
//1.13.2+ will have persistent metadata for this itemStack
|
||||
if(isLegacyAbilityTool(itemStack)) {
|
||||
if (isLegacyAbilityTool(itemStack)) {
|
||||
ItemMeta itemMeta = itemStack.getItemMeta();
|
||||
|
||||
if(itemMeta != null) {
|
||||
if (itemMeta != null) {
|
||||
// This is safe to call without prior checks.
|
||||
itemMeta.removeEnchant(mcMMO.p.getEnchantmentMapper().getEfficiency());
|
||||
|
||||
@@ -222,7 +222,7 @@ public final class SkillUtils {
|
||||
}
|
||||
}
|
||||
|
||||
if(isSuperAbilityBoosted(itemStack)) {
|
||||
if (isSuperAbilityBoosted(itemStack)) {
|
||||
removeBonusDigSpeedOnSuperAbilityTool(itemStack);
|
||||
}
|
||||
}
|
||||
@@ -239,7 +239,7 @@ public final class SkillUtils {
|
||||
* @param maxDamageModifier the amount to adjust the max damage by
|
||||
*/
|
||||
public static void handleDurabilityChange(ItemStack itemStack, double durabilityModifier, double maxDamageModifier) {
|
||||
if(itemStack.hasItemMeta() && itemStack.getItemMeta().isUnbreakable()) {
|
||||
if (itemStack.hasItemMeta() && itemStack.getItemMeta().isUnbreakable()) {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -269,7 +269,7 @@ public final class SkillUtils {
|
||||
* @param maxDamageModifier the amount to adjust the max damage by
|
||||
*/
|
||||
public static void handleArmorDurabilityChange(ItemStack itemStack, double durabilityModifier, double maxDamageModifier) {
|
||||
if(itemStack.hasItemMeta() && itemStack.getItemMeta().isUnbreakable()) {
|
||||
if (itemStack.hasItemMeta() && itemStack.getItemMeta().isUnbreakable()) {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -315,7 +315,7 @@ public final class SkillUtils {
|
||||
public static int getRepairAndSalvageQuantities(Material itemMaterial, Material recipeMaterial) {
|
||||
int quantity = 0;
|
||||
|
||||
if(mcMMO.getMaterialMapStore().isNetheriteTool(itemMaterial) || mcMMO.getMaterialMapStore().isNetheriteArmor(itemMaterial)) {
|
||||
if (mcMMO.getMaterialMapStore().isNetheriteTool(itemMaterial) || mcMMO.getMaterialMapStore().isNetheriteArmor(itemMaterial)) {
|
||||
//One netherite bar requires 4 netherite scraps
|
||||
return 4;
|
||||
}
|
||||
@@ -323,10 +323,10 @@ public final class SkillUtils {
|
||||
for(Iterator<? extends Recipe> recipeIterator = Bukkit.getServer().recipeIterator(); recipeIterator.hasNext();) {
|
||||
Recipe bukkitRecipe = recipeIterator.next();
|
||||
|
||||
if(bukkitRecipe.getResult().getType() != itemMaterial)
|
||||
if (bukkitRecipe.getResult().getType() != itemMaterial)
|
||||
continue;
|
||||
|
||||
if(bukkitRecipe instanceof ShapelessRecipe) {
|
||||
if (bukkitRecipe instanceof ShapelessRecipe) {
|
||||
for (ItemStack ingredient : ((ShapelessRecipe) bukkitRecipe).getIngredientList()) {
|
||||
if (ingredient != null
|
||||
&& (recipeMaterial == null || ingredient.getType() == recipeMaterial)
|
||||
@@ -334,7 +334,7 @@ public final class SkillUtils {
|
||||
quantity += ingredient.getAmount();
|
||||
}
|
||||
}
|
||||
} else if(bukkitRecipe instanceof ShapedRecipe) {
|
||||
} else if (bukkitRecipe instanceof ShapedRecipe) {
|
||||
for (ItemStack ingredient : ((ShapedRecipe) bukkitRecipe).getIngredientMap().values()) {
|
||||
if (ingredient != null
|
||||
&& (recipeMaterial == null || ingredient.getType() == recipeMaterial)
|
||||
|
Reference in New Issue
Block a user