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().isArmor(is) && block.getTypeId() == 42){
if(mcm.getInstance().isDiamondArmor(is) && mcm.getInstance().hasDiamond(player)){ if(mcm.getInstance().isDiamondArmor(is) && mcm.getInstance().hasDiamond(player)){
mcm.getInstance().removeDiamond(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); mcUsers.getProfile(player).skillUpRepair(1);
player.sendMessage(ChatColor.YELLOW+"Repair skill increased by 1. Total ("+mcUsers.getProfile(player).getRepair()+")"); player.sendMessage(ChatColor.YELLOW+"Repair skill increased by 1. Total ("+mcUsers.getProfile(player).getRepair()+")");
} else if (mcm.getInstance().isIronArmor(is) && mcm.getInstance().hasIron(player)){ } 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); mcm.getInstance().removeIron(player);
is.setDurability(mcm.getInstance().getArmorRepairAmount(is, player)); is.setDurability(mcm.getInstance().getArmorRepairAmount(is, player));
mcUsers.getProfile(player).skillUpRepair(1); mcUsers.getProfile(player).skillUpRepair(1);
player.sendMessage(ChatColor.YELLOW+"Repair skill increased by 1. Total ("+mcUsers.getProfile(player).getRepair()+")"); player.sendMessage(ChatColor.YELLOW+"Repair skill increased by 1. Total ("+mcUsers.getProfile(player).getRepair()+")");
*/
} }
} }
if(mcm.getInstance().isTools(is) && block.getTypeId() == 42){ if(mcm.getInstance().isTools(is) && block.getTypeId() == 42){
@ -69,10 +73,13 @@ public class mcPlayerListener extends PlayerListener {
player.sendMessage(ChatColor.DARK_RED +"You're not adept enough to repair Diamond"); player.sendMessage(ChatColor.DARK_RED +"You're not adept enough to repair Diamond");
} else if (mcm.getInstance().isDiamondTools(is) && !mcm.getInstance().hasDiamond(player) || mcm.getInstance().isIronTools(is) && !mcm.getInstance().hasIron(player)){ } else if (mcm.getInstance().isDiamondTools(is) && !mcm.getInstance().hasDiamond(player) || mcm.getInstance().isIronTools(is) && !mcm.getInstance().hasIron(player)){
if(!mcm.getInstance().hasDiamond(player)) if(!mcm.getInstance().hasDiamond(player))
player.sendMessage(ChatColor.DARK_RED+"You need more"+ChatColor.BLUE+ "Diamonds"); player.sendMessage(ChatColor.DARK_RED+"You need more "+ChatColor.BLUE+ "Diamonds");
if(!mcm.getInstance().hasIron(player)) if(!mcm.getInstance().hasIron(player))
player.sendMessage(ChatColor.DARK_RED+"You need more"+ChatColor.GRAY+ "Iron"); 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 //This determines how much we repair
public short getArmorRepairAmount(ItemStack is, Player player){ public short getArmorRepairAmount(ItemStack is, Player player){
short durability = is.getDurability(); short durability = is.getDurability();
player.sendMessage("BEFORE DURABILITY: "+durability);
switch(is.getTypeId()) switch(is.getTypeId())
{ {
case 306: case 306:
@ -127,7 +126,6 @@ public class mcm {
durability = 0; durability = 0;
if(checkPlayerProcRepair(player)) if(checkPlayerProcRepair(player))
durability = 0; durability = 0;
player.sendMessage("AFTER DURABILITY: "+durability);
return durability; return durability;
} }
public short getToolRepairAmount(ItemStack is, short durability, Player player){ public short getToolRepairAmount(ItemStack is, short durability, Player player){