More misc changes. Disabled iron armor repair for now.

This commit is contained in:
nossr50 2011-02-07 12:19:37 -08:00
parent efc7b44851
commit b5dc77874a
2 changed files with 11 additions and 6 deletions

View File

@ -44,14 +44,18 @@ public class mcPlayerListener extends PlayerListener {
if(mcm.getInstance().isArmor(is) && block.getTypeId() == 42){
if(mcm.getInstance().isDiamondArmor(is) && mcm.getInstance().hasDiamond(player)){
mcm.getInstance().removeDiamond(player);
is.setDurability(mcm.getInstance().getArmorRepairAmount(is, player));
player.getItemInHand().setDurability(mcm.getInstance().getArmorRepairAmount(is, player));
mcUsers.getProfile(player).skillUpRepair(1);
player.sendMessage(ChatColor.YELLOW+"Repair skill increased by 1. Total ("+mcUsers.getProfile(player).getRepair()+")");
} else if (mcm.getInstance().isIronArmor(is) && mcm.getInstance().hasIron(player)){
player.sendMessage(ChatColor.DARK_RED+"Changing the durability of iron armor is currently bugged.");
player.sendMessage(ChatColor.YELLOW+"I'm looking into this issue. -mcMMO Author");
/*
mcm.getInstance().removeIron(player);
is.setDurability(mcm.getInstance().getArmorRepairAmount(is, player));
mcUsers.getProfile(player).skillUpRepair(1);
player.sendMessage(ChatColor.YELLOW+"Repair skill increased by 1. Total ("+mcUsers.getProfile(player).getRepair()+")");
*/
}
}
if(mcm.getInstance().isTools(is) && block.getTypeId() == 42){
@ -72,7 +76,10 @@ public class mcPlayerListener extends PlayerListener {
player.sendMessage(ChatColor.DARK_RED+"You need more "+ChatColor.BLUE+ "Diamonds");
if(!mcm.getInstance().hasIron(player))
player.sendMessage(ChatColor.DARK_RED+"You need more "+ChatColor.GRAY+ "Iron");
}
} else if (mcm.getInstance().isDiamondArmor(is) && !mcm.getInstance().hasDiamond(player)){
player.sendMessage(ChatColor.DARK_RED+"You need more "+ChatColor.BLUE+ "Diamonds");
} else if (mcm.getInstance().isIronArmor(is) && !mcm.getInstance().hasIron(player))
player.sendMessage(ChatColor.DARK_RED+"You need more "+ChatColor.GRAY+ "Iron");
}
}
}

View File

@ -95,7 +95,6 @@ public class mcm {
//This determines how much we repair
public short getArmorRepairAmount(ItemStack is, Player player){
short durability = is.getDurability();
player.sendMessage("BEFORE DURABILITY: "+durability);
switch(is.getTypeId())
{
case 306:
@ -127,7 +126,6 @@ public class mcm {
durability = 0;
if(checkPlayerProcRepair(player))
durability = 0;
player.sendMessage("AFTER DURABILITY: "+durability);
return durability;
}
public short getToolRepairAmount(ItemStack is, short durability, Player player){