Added Shears, Buckets, Fishing rods and Bows to the list of items that can be Salvaged

This commit is contained in:
TfT_02 2013-02-06 14:49:36 +01:00
parent cd190eebc9
commit 40773ee6f6
2 changed files with 7 additions and 5 deletions

View File

@ -27,6 +27,7 @@ Version 1.4.00-dev
+ Added methods to check if a player is in party or admin chat to the ChatAPI + Added methods to check if a player is in party or admin chat to the ChatAPI
+ Added /mcpurge functionality for Flatfile users + Added /mcpurge functionality for Flatfile users
+ Added basic support for Mo' Creatures (and other entity mods) - specify mob info in entities.yml + Added basic support for Mo' Creatures (and other entity mods) - specify mob info in entities.yml
+ Added Shears, Buckets, Fishing rods and Bows to the list of items that can be Salvaged
= Fixed multiple commands not working properly on offline players = Fixed multiple commands not working properly on offline players
= Fixed /mmoedit not giving feedback when modifying another players stats = Fixed /mmoedit not giving feedback when modifying another players stats
= Fixed the guide usage string showing up every time /skillname was called = Fixed the guide usage string showing up every time /skillname was called

View File

@ -85,18 +85,19 @@ public class Salvage {
int salvagedItem = 0; int salvagedItem = 0;
if (ItemChecks.isDiamondTool(inHand) || ItemChecks.isDiamondArmor(inHand)) salvagedItem = 264; if (ItemChecks.isDiamondTool(inHand) || ItemChecks.isDiamondArmor(inHand)) salvagedItem = 264;
else if (ItemChecks.isGoldTool(inHand) || ItemChecks.isGoldArmor(inHand)) salvagedItem = 266; else if (ItemChecks.isGoldTool(inHand) || ItemChecks.isGoldArmor(inHand)) salvagedItem = 266;
else if (ItemChecks.isIronTool(inHand) || ItemChecks.isIronArmor(inHand)) salvagedItem = 265; else if (ItemChecks.isIronTool(inHand) || ItemChecks.isIronArmor(inHand) || inHand.getType() == Material.BUCKET || inHand.getType() == Material.SHEARS) salvagedItem = 265;
else if (ItemChecks.isStoneTool(inHand)) salvagedItem = 4; else if (ItemChecks.isStoneTool(inHand)) salvagedItem = 4;
else if (ItemChecks.isWoodTool(inHand)) salvagedItem = 5; else if (ItemChecks.isWoodTool(inHand)) salvagedItem = 5;
else if ( ItemChecks.isLeatherArmor(inHand)) salvagedItem = 334; else if (ItemChecks.isLeatherArmor(inHand)) salvagedItem = 334;
else if (ItemChecks.isStringTool(inHand)) salvagedItem = 287;
return salvagedItem; return salvagedItem;
} }
public static int getSalvagedAmount(final ItemStack inHand) { public static int getSalvagedAmount(final ItemStack inHand) {
int salvagedAmount = 0; int salvagedAmount = 0;
if (ItemChecks.isPickaxe(inHand) || ItemChecks.isAxe(inHand)) salvagedAmount = 3; if (ItemChecks.isPickaxe(inHand) || ItemChecks.isAxe(inHand) || inHand.getType() == Material.BOW || inHand.getType() == Material.BUCKET) salvagedAmount = 3;
else if (ItemChecks.isShovel(inHand)) salvagedAmount = 1; else if (ItemChecks.isShovel(inHand)) salvagedAmount = 1;
else if (ItemChecks.isSword(inHand) || ItemChecks.isHoe(inHand)) salvagedAmount = 2; else if (ItemChecks.isSword(inHand) || ItemChecks.isHoe(inHand) || inHand.getType() == Material.FISHING_ROD || inHand.getType() == Material.SHEARS) salvagedAmount = 2;
else if (ItemChecks.isHelmet(inHand)) salvagedAmount = 5; else if (ItemChecks.isHelmet(inHand)) salvagedAmount = 5;
else if (ItemChecks.isChestplate(inHand)) salvagedAmount = 8; else if (ItemChecks.isChestplate(inHand)) salvagedAmount = 8;
else if (ItemChecks.isPants(inHand)) salvagedAmount = 7; else if (ItemChecks.isPants(inHand)) salvagedAmount = 7;
@ -110,7 +111,7 @@ public class Salvage {
* @return true if the item is salvageable, false otherwise * @return true if the item is salvageable, false otherwise
*/ */
public static boolean isSalvageable(final ItemStack is) { public static boolean isSalvageable(final ItemStack is) {
if (configInstance.getSalvageTools() && ItemChecks.isTool(is)) { if (configInstance.getSalvageTools() && (ItemChecks.isTool(is) || ItemChecks.isStringTool(is) || is.getType() == Material.BUCKET || is.getType() == Material.SHEARS)) {
return true; return true;
} }
if (configInstance.getSalvageArmor() && ItemChecks.isArmor(is)) { if (configInstance.getSalvageArmor() && ItemChecks.isArmor(is)) {