Possible fix for not registering right click air events.

This commit is contained in:
GJ 2012-02-27 23:38:33 -05:00
parent 8ad4e20cab
commit 2b9baaf0ea
4 changed files with 6 additions and 4 deletions

View File

@ -181,7 +181,7 @@ public class Combat
public static void combatAbilityChecks(Player attacker, PlayerProfile PPa) public static void combatAbilityChecks(Player attacker, PlayerProfile PPa)
{ {
//Check to see if any abilities need to be activated //Check to see if any abilities need to be activated
if(PPa.getAxePreparationMode() && mcPermissions.getInstance().axesAbility(attacker)) if(PPa.getAxePreparationMode())
Skills.abilityCheck(attacker, SkillType.AXES); Skills.abilityCheck(attacker, SkillType.AXES);
if(PPa.getSwordsPreparationMode()) if(PPa.getSwordsPreparationMode())
Skills.abilityCheck(attacker, SkillType.SWORDS); Skills.abilityCheck(attacker, SkillType.SWORDS);

View File

@ -1,5 +1,6 @@
package com.gmail.nossr50.datatypes; package com.gmail.nossr50.datatypes;
import org.bukkit.Material;
import org.bukkit.inventory.ItemStack; import org.bukkit.inventory.ItemStack;
import com.gmail.nossr50.m; import com.gmail.nossr50.m;
@ -118,7 +119,7 @@ public enum ToolType
case AXE: case AXE:
return m.isAxes(is); return m.isAxes(is);
case FISTS: case FISTS:
return is == null; return is.equals(Material.AIR);
case HOE: case HOE:
return m.isHoe(is); return m.isHoe(is);
case PICKAXE: case PICKAXE:

View File

@ -224,7 +224,7 @@ public class mcPlayerListener implements Listener
player.updateInventory(); player.updateInventory();
} }
if(LoadProperties.enableAbilities && m.abilityBlockCheck(block)) if(LoadProperties.enableAbilities && (m.abilityBlockCheck(block) || block.getType() == Material.AIR))
{ {
if(block != null && m.isHoe(is) && !mat.equals(Material.DIRT) && !mat.equals(Material.GRASS) && !mat.equals(Material.SOIL)) if(block != null && m.isHoe(is) && !mat.equals(Material.DIRT) && !mat.equals(Material.GRASS) && !mat.equals(Material.SOIL))
Skills.activationCheck(player, SkillType.HERBALISM); Skills.activationCheck(player, SkillType.HERBALISM);

View File

@ -94,7 +94,8 @@ public class Skills
} }
} }
public static void monitorSkill(Player player, PlayerProfile PP, long curTime, SkillType skill){ public static void monitorSkill(Player player, PlayerProfile PP, long curTime, SkillType skill)
{
ToolType tool = skill.getTool(); ToolType tool = skill.getTool();
AbilityType ability = skill.getAbility(); AbilityType ability = skill.getAbility();
if(tool.getToolMode(PP) && curTime - (tool.getToolATS(PP) * 1000) >= 4000) if(tool.getToolMode(PP) && curTime - (tool.getToolATS(PP) * 1000) >= 4000)