Tidied up the repair code a little.

This commit is contained in:
nossr50 2011-02-10 12:19:49 -08:00
parent 263d5a3451
commit 05a737753b

View File

@ -147,7 +147,18 @@ public class mcPlayerListener extends PlayerListener {
mcm.getInstance().removeDiamond(player); mcm.getInstance().removeDiamond(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().isDiamondTools(is) && mcUsers.getProfile(player).getRepairInt() < 50){ } else {
needMoreVespeneGas(is, player);
}
}
} else {
player.sendMessage("That is at full durability.");
}
} //end if block is iron block bracket
} //end onPlayerItem bracket
public void needMoreVespeneGas(ItemStack is, Player player){
if (mcm.getInstance().isDiamondTools(is) && mcUsers.getProfile(player).getRepairInt() < 50){
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().isDiamondTools(is) && !mcm.getInstance().hasDiamond(player)) if(mcm.getInstance().isDiamondTools(is) && !mcm.getInstance().hasDiamond(player))
@ -159,11 +170,6 @@ public class mcPlayerListener extends PlayerListener {
} 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+"You need more "+ChatColor.GRAY+ "Iron"); player.sendMessage(ChatColor.DARK_RED+"You need more "+ChatColor.GRAY+ "Iron");
} }
} else {
player.sendMessage("That is at full durability.");
}
}
}
public void onPlayerCommand(PlayerChatEvent event) { public void onPlayerCommand(PlayerChatEvent event) {
Player player = event.getPlayer(); Player player = event.getPlayer();
String[] split = event.getMessage().split(" "); String[] split = event.getMessage().split(" ");