Updated Giga Breaker to properly handle Mycellium & Unbreaking enchants

This commit is contained in:
gmcferrin 2012-02-03 01:20:04 -05:00
parent 151c9ba1d4
commit 47ed176191

View File

@ -295,7 +295,7 @@ public class mcBlockListener implements Listener
Player player = event.getPlayer(); Player player = event.getPlayer();
PlayerProfile PP = Users.getProfile(player); PlayerProfile PP = Users.getProfile(player);
ItemStack inhand = player.getItemInHand(); ItemStack inhand = player.getItemInHand();
Block block = event.getBlock(); sun.org.mozilla.javascript.internal.ast.Block block = event.getBlock();
Skills.monitorSkills(player, PP); Skills.monitorSkills(player, PP);
@ -348,6 +348,8 @@ public class mcBlockListener implements Listener
mat = Material.DIRT; mat = Material.DIRT;
if(block.getType() == Material.CLAY) if(block.getType() == Material.CLAY)
mat = Material.CLAY_BALL; mat = Material.CLAY_BALL;
if(block.getType() == Material.MYCEL)
mat = Material.DIRT;
byte type = block.getData(); byte type = block.getData();
ItemStack item = new ItemStack(mat, 1, (byte)0, type); ItemStack item = new ItemStack(mat, 1, (byte)0, type);
@ -357,7 +359,10 @@ public class mcBlockListener implements Listener
player.incrementStatistic(Statistic.MINE_BLOCK, event.getBlock().getType()); player.incrementStatistic(Statistic.MINE_BLOCK, event.getBlock().getType());
if(LoadProperties.toolsLoseDurabilityFromAbilities) if(LoadProperties.toolsLoseDurabilityFromAbilities)
{
if(!player.getItemInHand().getEnchantments().containsKey(Enchantment.DURABILITY))
m.damageTool(player, (short) LoadProperties.abilityDurabilityLoss); m.damageTool(player, (short) LoadProperties.abilityDurabilityLoss);
}
if(item.getType() == Material.CLAY_BALL) if(item.getType() == Material.CLAY_BALL)
{ {