mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2025-07-01 13:14:44 +02:00
Merge branch 'master' of github.com:mcMMO-Dev/mcMMO into configurable
This commit is contained in:
@ -3,6 +3,7 @@ package com.gmail.nossr50.skills.repair.repairables;
|
||||
import com.gmail.nossr50.datatypes.skills.ItemMaterialCategory;
|
||||
import com.gmail.nossr50.datatypes.skills.ItemType;
|
||||
import com.gmail.nossr50.util.ItemUtils;
|
||||
import com.gmail.nossr50.util.skills.SkillUtils;
|
||||
import org.bukkit.Material;
|
||||
|
||||
import java.util.Collections;
|
||||
@ -61,7 +62,10 @@ public class Repairable {
|
||||
}
|
||||
|
||||
public int getMinimumQuantity() {
|
||||
return minimumQuantity;
|
||||
if(minimumQuantity == -1)
|
||||
return Math.max(SkillUtils.getRepairAndSalvageQuantities(itemMaterial, repairMaterials), 1);
|
||||
else
|
||||
return minimumQuantity;
|
||||
}
|
||||
|
||||
public short getMaximumDurability() {
|
||||
|
@ -8,6 +8,7 @@ import com.gmail.nossr50.util.skills.SkillUtils;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.block.BlockFace;
|
||||
import org.bukkit.block.BlockState;
|
||||
import org.bukkit.enchantments.Enchantment;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
|
||||
import java.util.ArrayList;
|
||||
@ -136,6 +137,11 @@ public final class Woodcutting {
|
||||
* @return True if the tool can sustain the durability loss
|
||||
*/
|
||||
protected static boolean handleDurabilityLoss(Set<BlockState> treeFellerBlocks, ItemStack inHand) {
|
||||
|
||||
if(inHand.getItemMeta().getEnchants().get(Enchantment.DURABILITY) >= 1) {
|
||||
return true;
|
||||
}
|
||||
|
||||
short durabilityLoss = 0;
|
||||
Material type = inHand.getType();
|
||||
|
||||
|
Reference in New Issue
Block a user