Skip to content

Commit

Permalink
Update src/main/java/com/gmail/nossr50/skills/Repair.java
Browse files Browse the repository at this point in the history
  • Loading branch information
gmcferrin committed Jan 26, 2012
1 parent 984dbd9 commit 328c7d4
Showing 1 changed file with 26 additions and 2 deletions.
28 changes: 26 additions & 2 deletions src/main/java/com/gmail/nossr50/skills/Repair.java
Expand Up @@ -47,7 +47,10 @@ public class Repair {
private static String nDiamond = LoadProperties.nDiamond;
private static int rIron = LoadProperties.rIron;
private static String nIron = LoadProperties.nIron;

private static int rString = LoadProperties.rString;
private static String nString = LoadProperties.nString;
private static int rLeather = LoadProperties.rLeather;
private static String nLeather = LoadProperties.nLeather;

public static void repairCheck(Player player, ItemStack is, Block block){
PlayerProfile PP = Users.getProfile(player);
Expand Down Expand Up @@ -120,6 +123,21 @@ else if (isGoldArmor(is) && hasItem(player, rGold)){
SpoutStuff.playRepairNoise(player);
}

//LEATHER ARMOR
else if (isLeatherArmor(is) && hasItem(player, rLeather)){
removeItem(player, rLeather);
repairItem(player, enchants, enchantsLevel);

durabilityAfter = player.getItemInHand().getDurability();
dif = (short) (durabilityBefore - durabilityAfter);
dif = (short) (dif * 1); //Boost XP
PP.addXP(SkillType.REPAIR, dif*10, player);

//CLANG CLANG
if(LoadProperties.spoutEnabled)
SpoutStuff.playRepairNoise(player);
}

//UNABLE TO REPAIR
else {
needMoreVespeneGas(is, player);
Expand Down Expand Up @@ -362,7 +380,11 @@ public static int getDowngradeChance(int rank)
public static boolean isArmor(ItemStack is){
return is.getTypeId() == 306 || is.getTypeId() == 307 ||is.getTypeId() == 308 ||is.getTypeId() == 309 || //IRON
is.getTypeId() == 310 ||is.getTypeId() == 311 ||is.getTypeId() == 312 ||is.getTypeId() == 313 || //DIAMOND
is.getTypeId() == 314 || is.getTypeId() == 315 || is.getTypeId() == 316 || is.getTypeId() == 317; //GOLD
is.getTypeId() == 314 || is.getTypeId() == 315 || is.getTypeId() == 316 || is.getTypeId() == 317 || //GOLD
is.getTypeId() == 298 || is.getTypeId() == 299 || is.getTypeId() == 300 || is.getTypeId() == 301; //LEATHER
}
public static boolean isLeatherArmor(ItemStack is){
return is.getTypeId() == 298 || is.getTypeId() == 299 || is.getTypeId() == 300 || is.getTypeId() == 301;
}
public static boolean isGoldArmor(ItemStack is){
return is.getTypeId() == 314 || is.getTypeId() == 315 || is.getTypeId() == 316 || is.getTypeId() == 317;
Expand Down Expand Up @@ -652,6 +674,8 @@ public static void needMoreVespeneGas(ItemStack is, Player player)
player.sendMessage(mcLocale.getString("Skills.NeedMore")+" "+ChatColor.GRAY+ nIron);
} else if (isGoldArmor(is) && !hasItem(player, rGold)){
player.sendMessage(mcLocale.getString("Skills.NeedMore")+" "+ChatColor.GOLD+ nGold);
} else if (isLeatherArmor(is) && !hasItem(player, rLeather)){
player.sendMessage(mcLocale.getString("Skills.NeedMore")+" "+ChatColor.YELLOW+ nLeather);
} else if (is.getAmount() > 1)
player.sendMessage(mcLocale.getString("Skills.StackedItems"));
}
Expand Down

0 comments on commit 328c7d4

Please sign in to comment.