This commit is contained in:
nossr50 2019-06-12 12:23:58 -07:00
parent 7ab70ba597
commit 9c04054017
7 changed files with 12 additions and 7 deletions

View File

@ -1,3 +1,6 @@
Version 2.1.80
(Fix) mcMMO now respects the NBT "Unbreakable" tag and does not deal durability damage to items with that tag
Version 2.1.79
Updated Japanese locale (Thanks snake0053)
Fixed a NPE that could happen when using Tree Feller with an unenchanted Axe

View File

@ -2,7 +2,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>com.gmail.nossr50.mcMMO</groupId>
<artifactId>mcMMO</artifactId>
<version>2.1.79</version>
<version>2.1.80</version>
<name>mcMMO</name>
<url>https://github.com/mcMMO-Dev/mcMMO</url>
<scm>

View File

@ -6,7 +6,6 @@ import com.gmail.nossr50.datatypes.skills.MaterialType;
import com.gmail.nossr50.skills.repair.repairables.Repairable;
import com.gmail.nossr50.skills.repair.repairables.RepairableFactory;
import com.gmail.nossr50.util.ItemUtils;
import com.gmail.nossr50.util.skills.SkillUtils;
import org.bukkit.Material;
import org.bukkit.configuration.ConfigurationSection;
import org.bukkit.inventory.ItemStack;

View File

@ -10,7 +10,10 @@ import com.gmail.nossr50.locale.LocaleLoader;
import com.gmail.nossr50.mcMMO;
import com.gmail.nossr50.skills.SkillManager;
import com.gmail.nossr50.skills.salvage.salvageables.Salvageable;
import com.gmail.nossr50.util.*;
import com.gmail.nossr50.util.EventUtils;
import com.gmail.nossr50.util.Misc;
import com.gmail.nossr50.util.Permissions;
import com.gmail.nossr50.util.StringUtils;
import com.gmail.nossr50.util.player.NotificationManager;
import com.gmail.nossr50.util.random.RandomChanceSkillStatic;
import com.gmail.nossr50.util.random.RandomChanceUtil;

View File

@ -149,8 +149,8 @@ public final class Woodcutting {
*/
protected static boolean handleDurabilityLoss(Set<BlockState> treeFellerBlocks, ItemStack inHand) {
if(inHand.getItemMeta().getEnchants().get(Enchantment.DURABILITY) != null
&& inHand.getItemMeta().getEnchants().get(Enchantment.DURABILITY) >= 1) {
if((inHand.getItemMeta().getEnchants().get(Enchantment.DURABILITY) != null && inHand.getItemMeta().getEnchants().get(Enchantment.DURABILITY) >= 1)
|| (inHand.getItemMeta() != null && inHand.getItemMeta().isUnbreakable())) {
return true;
}

View File

@ -2,7 +2,6 @@ package com.gmail.nossr50.util;
import com.gmail.nossr50.config.Config;
import com.gmail.nossr50.config.RankConfig;
import com.gmail.nossr50.datatypes.interactions.NotificationType;
import com.gmail.nossr50.datatypes.json.McMMOUrl;
import com.gmail.nossr50.datatypes.json.McMMOWebLinks;
import com.gmail.nossr50.datatypes.skills.PrimarySkillType;

View File

@ -243,7 +243,8 @@ public class SkillUtils {
* @param maxDamageModifier the amount to adjust the max damage by
*/
public static void handleDurabilityChange(ItemStack itemStack, double durabilityModifier, double maxDamageModifier) {
if (itemStack.getEnchantments().get(Enchantment.DURABILITY) != null && itemStack.getEnchantments().get(Enchantment.DURABILITY) >= 1) {
if((itemStack.getItemMeta().getEnchants().get(Enchantment.DURABILITY) != null && itemStack.getItemMeta().getEnchants().get(Enchantment.DURABILITY) >= 1)
|| (itemStack.getItemMeta() != null && itemStack.getItemMeta().isUnbreakable())) {
return;
}