mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2024-12-24 01:27:41 +01:00
Restored original behavior of Salvage.isSalvageable
It doesn't check for custom armors, I don't know if it's a bug or not Added isMinecraftTool and isMinecraftArmor for clarity
This commit is contained in:
parent
f486492c37
commit
9f22382506
@ -141,10 +141,10 @@ public class Salvage {
|
||||
* @return true if the item is salvageable, false otherwise
|
||||
*/
|
||||
public static boolean isSalvageable(final ItemStack is) {
|
||||
if (configInstance.getSalvageTools() && (ItemChecks.isTool(is) || ItemChecks.isStringTool(is) || is.getType() == Material.BUCKET)) {
|
||||
if (configInstance.getSalvageTools() && (ItemChecks.isMinecraftArmor(is) || ItemChecks.isStringTool(is) || is.getType() == Material.BUCKET)) {
|
||||
return true;
|
||||
}
|
||||
if (configInstance.getSalvageArmor() && ItemChecks.isArmor(is)) {
|
||||
if (configInstance.getSalvageArmor() && ItemChecks.isMinecraftArmor(is)) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
|
@ -257,6 +257,16 @@ public class ItemChecks {
|
||||
return isHelmet(is) || isChestplate(is) || isLeggings(is) || isBoots(is);
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks to see if an item is a wearable armor piece.
|
||||
*
|
||||
* @param is Item to check
|
||||
* @return true if the item is armor, false otherwise
|
||||
*/
|
||||
public static boolean isMinecraftArmor(ItemStack is) {
|
||||
return isDiamondArmor(is) || isGoldArmor(is) || isIronArmor(is) || isDiamondArmor(is);
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks to see if an item is a leather armor piece.
|
||||
*
|
||||
@ -339,7 +349,7 @@ public class ItemChecks {
|
||||
* @param is Item to check
|
||||
* @return true if the item is a tool, false otherwise
|
||||
*/
|
||||
public static boolean isTool(ItemStack is) {
|
||||
public static boolean isMinecraftTool(ItemStack is) {
|
||||
return isStoneTool(is) || isWoodTool(is) || isGoldTool(is) || isIronTool(is) || isDiamondTool(is) || isStringTool(is);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user