Fixed issues with combat abilities not checking cooldowns in last few

dev builds.
This commit is contained in:
GJ 2013-01-25 17:21:18 -05:00
parent a4aebdc643
commit c4ec9a6df9
8 changed files with 133 additions and 153 deletions

View File

@ -42,6 +42,7 @@ import com.gmail.nossr50.skills.unarmed.Unarmed;
import com.gmail.nossr50.skills.unarmed.UnarmedManager; import com.gmail.nossr50.skills.unarmed.UnarmedManager;
import com.gmail.nossr50.util.ItemChecks; import com.gmail.nossr50.util.ItemChecks;
import com.gmail.nossr50.util.Misc; import com.gmail.nossr50.util.Misc;
import com.gmail.nossr50.util.Permissions;
import com.gmail.nossr50.util.Users; import com.gmail.nossr50.util.Users;
public class Combat { public class Combat {
@ -76,13 +77,25 @@ public class Combat {
return; return;
} }
Skills.abilityCheck(player, SkillType.SWORDS); if (Permissions.swords(player)) {
SwordsManager swordsManager = new SwordsManager(player); SwordsManager swordsManager = new SwordsManager(player);
swordsManager.bleedCheck(target); PlayerProfile profile = swordsManager.getProfile();
swordsManager.serratedStrikes(target, event.getDamage()); boolean canSerratedStrike = Permissions.serratedStrikes(player); //So we don't have to check the same permission twice
startGainXp(player, swordsManager.getProfile(), target, SkillType.SWORDS); if (profile.getToolPreparationMode(ToolType.SWORD) && canSerratedStrike) {
Skills.abilityCheck(player, SkillType.SWORDS);
}
if (Permissions.swordsBleed(player) && shouldBeAffected(player, target)) {
swordsManager.bleedCheck(target);
}
if (profile.getAbilityMode(AbilityType.SERRATED_STRIKES) && canSerratedStrike) {
swordsManager.serratedStrikes(target, event.getDamage());
}
startGainXp(player, profile, target, SkillType.SWORDS);
}
} }
else if (ItemChecks.isAxe(heldItem)) { else if (ItemChecks.isAxe(heldItem)) {
if (targetIsPlayer || targetIsTamedPet) { if (targetIsPlayer || targetIsTamedPet) {
@ -94,15 +107,32 @@ public class Combat {
return; return;
} }
Skills.abilityCheck(player, SkillType.AXES); if (Permissions.axes(player)) {
AxeManager axeManager = new AxeManager(player); AxeManager axeManager = new AxeManager(player);
axeManager.bonusDamage(event); PlayerProfile profile = axeManager.getProfile();
axeManager.criticalHitCheck(event, target); boolean canSkullSplit = Permissions.skullSplitter(player); //So we don't have to check the same permission twice
axeManager.impact(event, target); if (profile.getToolPreparationMode(ToolType.AXE) && canSkullSplit) {
axeManager.skullSplitter(target, event.getDamage()); Skills.abilityCheck(player, SkillType.AXES);
}
startGainXp(player, axeManager.getProfile(), target, SkillType.AXES); if (Permissions.axeBonus(player)) {
axeManager.bonusDamage(event);
}
if (!target.isDead() && Permissions.criticalHit(player) && shouldBeAffected(player, target)) {
axeManager.criticalHitCheck(event, target);
}
if (!target.isDead() && Permissions.impact(player)) {
axeManager.impact(event, target);
}
if (!target.isDead() && profile.getAbilityMode(AbilityType.SKULL_SPLIITER) && canSkullSplit) {
axeManager.skullSplitter(target, event.getDamage());
}
startGainXp(player, profile, target, SkillType.AXES);
}
} }
else if (heldItemType == Material.AIR) { else if (heldItemType == Material.AIR) {
if (targetIsPlayer || targetIsTamedPet) { if (targetIsPlayer || targetIsTamedPet) {
@ -114,16 +144,31 @@ public class Combat {
return; return;
} }
Skills.abilityCheck(player, SkillType.UNARMED); if (Permissions.unarmed(player)) {
UnarmedManager unarmedManager = new UnarmedManager(player); UnarmedManager unarmedManager = new UnarmedManager(player);
PlayerProfile profile = unarmedManager.getProfile();
boolean canBerserk = Permissions.berserk(player); //So we don't have to check the same permission twice
if (profile.getToolPreparationMode(ToolType.FISTS) && canBerserk) {
Skills.abilityCheck(player, SkillType.UNARMED);
}
if (Permissions.unarmedBonus(player)) {
unarmedManager.bonusDamage(event); unarmedManager.bonusDamage(event);
}
if (profile.getAbilityMode(AbilityType.BERSERK) && canBerserk) {
unarmedManager.berserkDamage(event); unarmedManager.berserkDamage(event);
}
if (target instanceof Player && Permissions.disarm(player)) {
unarmedManager.disarmCheck(target); unarmedManager.disarmCheck(target);
}
startGainXp(player, unarmedManager.getProfile(), target, SkillType.UNARMED); startGainXp(player, unarmedManager.getProfile(), target, SkillType.UNARMED);
} }
else if (heldItemType == Material.BONE && target instanceof Tameable) { }
else if (heldItemType == Material.BONE && target instanceof Tameable && Permissions.beastLore(player)) {
TamingManager tamingManager = new TamingManager(player); TamingManager tamingManager = new TamingManager(player);
tamingManager.beastLore(target); tamingManager.beastLore(target);
event.setCancelled(true); event.setCancelled(true);
@ -139,6 +184,10 @@ public class Combat {
if (wolf.isTamed() && wolf.getOwner() instanceof Player) { if (wolf.isTamed() && wolf.getOwner() instanceof Player) {
Player master = (Player) wolf.getOwner(); Player master = (Player) wolf.getOwner();
if (Misc.isNPCPlayer(master)) {
return;
}
if (targetIsPlayer || targetIsTamedPet) { if (targetIsPlayer || targetIsTamedPet) {
if (!Taming.pvpEnabled) { if (!Taming.pvpEnabled) {
return; return;
@ -148,21 +197,35 @@ public class Combat {
return; return;
} }
if (Permissions.taming(master)) {
TamingManager tamingManager = new TamingManager(master); TamingManager tamingManager = new TamingManager(master);
tamingManager.fastFoodService(wolf, event.getDamage()); int skillLevel = tamingManager.getSkillLevel();
tamingManager.sharpenedClaws(event);
tamingManager.gore(event);
if (skillLevel >= Taming.fastFoodServiceUnlockLevel && Permissions.fastFoodService(master)) {
tamingManager.fastFoodService(wolf, event.getDamage());
}
if (skillLevel >= Taming.sharpenedClawsUnlockLevel && Permissions.sharpenedClaws(master)) {
tamingManager.sharpenedClaws(event);
}
if (Permissions.gore(master)) {
tamingManager.gore(event);
}
if (target != master) {
startGainXp(master, tamingManager.getProfile(), target, SkillType.TAMING); startGainXp(master, tamingManager.getProfile(), target, SkillType.TAMING);
} }
}
}
break; break;
case ARROW: case ARROW:
LivingEntity shooter = ((Arrow) damager).getShooter(); LivingEntity shooter = ((Arrow) damager).getShooter();
//TODO: Is there a reason we're breaking here instead of returning? /* Break instead of return due to Dodge/Counter/Deflect abilities */
if (shooter == null || shooter.getType() != EntityType.PLAYER) { if (shooter == null || !(shooter instanceof Player)) {
break; break;
} }
@ -185,37 +248,41 @@ public class Combat {
if (targetIsPlayer) { if (targetIsPlayer) {
Player player = (Player) target; Player player = (Player) target;
if (Misc.isNPCPlayer(player)) {
return;
}
ItemStack heldItem = player.getItemInHand();
if (damager instanceof Player) { if (damager instanceof Player) {
if (Swords.pvpEnabled) { if (Swords.pvpEnabled && ItemChecks.isSword(heldItem) && Permissions.counterAttack(player)) {
SwordsManager swordsManager = new SwordsManager(player); SwordsManager swordsManager = new SwordsManager(player);
swordsManager.counterAttackChecks((LivingEntity) damager, event.getDamage()); swordsManager.counterAttackChecks((LivingEntity) damager, event.getDamage());
} }
if (Acrobatics.pvpEnabled) { if (Acrobatics.pvpEnabled && Permissions.dodge(player)) {
AcrobaticsManager acrobaticsManager = new AcrobaticsManager(player); AcrobaticsManager acrobaticsManager = new AcrobaticsManager(player);
acrobaticsManager.dodgeCheck(event); acrobaticsManager.dodgeCheck(event);
} }
if (Unarmed.pvpEnabled && player.getItemInHand().getType() == Material.AIR) { if (Unarmed.pvpEnabled && heldItem.getType() == Material.AIR && Permissions.deflect(player)) {
UnarmedManager unarmedManager = new UnarmedManager(player); UnarmedManager unarmedManager = new UnarmedManager(player);
unarmedManager.deflectCheck(event); unarmedManager.deflectCheck(event);
} }
} }
else { else {
if (Swords.pveEnabled && damager instanceof LivingEntity) { if (Swords.pveEnabled && damager instanceof LivingEntity && ItemChecks.isSword(heldItem) && Permissions.counterAttack(player)) {
SwordsManager swordsManager = new SwordsManager(player); SwordsManager swordsManager = new SwordsManager(player);
swordsManager.counterAttackChecks((LivingEntity) damager, event.getDamage()); swordsManager.counterAttackChecks((LivingEntity) damager, event.getDamage());
} }
if (Acrobatics.pveEnabled) { if (Acrobatics.pveEnabled && !(damager instanceof LightningStrike && Acrobatics.dodgeLightningDisabled) && Permissions.dodge(player)) {
if (!(damager instanceof LightningStrike && Acrobatics.dodgeLightningDisabled)) {
AcrobaticsManager acrobaticsManager = new AcrobaticsManager(player); AcrobaticsManager acrobaticsManager = new AcrobaticsManager(player);
acrobaticsManager.dodgeCheck(event); acrobaticsManager.dodgeCheck(event);
} }
} }
} }
} }
}
/** /**
* Process archery abilities. * Process archery abilities.
@ -224,19 +291,20 @@ public class Combat {
* @param target The defending entity * @param target The defending entity
* @param event The event to run the archery checks on. * @param event The event to run the archery checks on.
*/ */
public static void archeryCheck(Player shooter, LivingEntity target, EntityDamageByEntityEvent event) { private static void archeryCheck(Player shooter, LivingEntity target, EntityDamageByEntityEvent event) {
if (Misc.isNPCPlayer(shooter)) { if (Misc.isNPCPlayer(shooter)) {
return; return;
} }
if (Permissions.archery(shooter)) {
ArcheryManager archeryManager = new ArcheryManager(shooter); ArcheryManager archeryManager = new ArcheryManager(shooter);
archeryManager.skillShot(event); archeryManager.skillShot(event);
if (target instanceof Player) { if (target instanceof Player && Permissions.daze(shooter)) {
archeryManager.dazeCheck((Player) target, event); archeryManager.dazeCheck((Player) target, event);
} }
if (!(shooter.getItemInHand().containsEnchantment(Enchantment.ARROW_INFINITE))) { if (!(shooter.getItemInHand().containsEnchantment(Enchantment.ARROW_INFINITE)) && Permissions.trackArrows(shooter)) {
archeryManager.trackArrows(target); archeryManager.trackArrows(target);
} }
@ -244,6 +312,7 @@ public class Combat {
startGainXp(shooter, archeryManager.getProfile(), target, SkillType.ARCHERY); startGainXp(shooter, archeryManager.getProfile(), target, SkillType.ARCHERY);
} }
} }
}
/** /**
* Attempt to damage target for value dmg with reason CUSTOM * Attempt to damage target for value dmg with reason CUSTOM

View File

@ -6,7 +6,6 @@ import org.bukkit.event.entity.EntityDamageEvent;
import com.gmail.nossr50.skills.SkillManager; import com.gmail.nossr50.skills.SkillManager;
import com.gmail.nossr50.skills.SkillType; import com.gmail.nossr50.skills.SkillType;
import com.gmail.nossr50.util.Misc; import com.gmail.nossr50.util.Misc;
import com.gmail.nossr50.util.Permissions;
public class AcrobaticsManager extends SkillManager { public class AcrobaticsManager extends SkillManager {
public AcrobaticsManager (Player player) { public AcrobaticsManager (Player player) {
@ -46,10 +45,6 @@ public class AcrobaticsManager extends SkillManager {
* @param event The event to check * @param event The event to check
*/ */
public void dodgeCheck(EntityDamageEvent event) { public void dodgeCheck(EntityDamageEvent event) {
if (Misc.isNPCPlayer(player) || !Permissions.dodge(player)) {
return;
}
DodgeEventHandler eventHandler = new DodgeEventHandler(this, event); DodgeEventHandler eventHandler = new DodgeEventHandler(this, event);
double chance = (Acrobatics.dodgeMaxChance / Acrobatics.dodgeMaxBonusLevel) * eventHandler.skillModifier; double chance = (Acrobatics.dodgeMaxChance / Acrobatics.dodgeMaxBonusLevel) * eventHandler.skillModifier;

View File

@ -20,10 +20,6 @@ public class ArcheryManager extends SkillManager {
* @param livingEntity Entity damaged by the arrow * @param livingEntity Entity damaged by the arrow
*/ */
public void trackArrows(LivingEntity livingEntity) { public void trackArrows(LivingEntity livingEntity) {
if (Misc.isNPCPlayer(player) || !Permissions.trackArrows(player)) {
return;
}
ArrowTrackingEventHandler eventHandler = new ArrowTrackingEventHandler(this, livingEntity); ArrowTrackingEventHandler eventHandler = new ArrowTrackingEventHandler(this, livingEntity);
double chance = (Archery.retrieveMaxChance / Archery.retrieveMaxBonusLevel) * eventHandler.skillModifier; double chance = (Archery.retrieveMaxChance / Archery.retrieveMaxBonusLevel) * eventHandler.skillModifier;
@ -40,10 +36,6 @@ public class ArcheryManager extends SkillManager {
* @param event The event to modify * @param event The event to modify
*/ */
public void dazeCheck(Player defender, EntityDamageEvent event) { public void dazeCheck(Player defender, EntityDamageEvent event) {
if (Misc.isNPCPlayer(player) || !Permissions.daze(player)) {
return;
}
DazeEventHandler eventHandler = new DazeEventHandler(this, event, defender); DazeEventHandler eventHandler = new DazeEventHandler(this, event, defender);
double chance = (Archery.dazeMaxBonus / Archery.dazeMaxBonusLevel) * eventHandler.skillModifier; double chance = (Archery.dazeMaxBonus / Archery.dazeMaxBonusLevel) * eventHandler.skillModifier;

View File

@ -2,14 +2,11 @@ package com.gmail.nossr50.skills.axes;
import org.bukkit.entity.LivingEntity; import org.bukkit.entity.LivingEntity;
import org.bukkit.entity.Player; import org.bukkit.entity.Player;
import org.bukkit.entity.Tameable;
import org.bukkit.event.entity.EntityDamageByEntityEvent; import org.bukkit.event.entity.EntityDamageByEntityEvent;
import com.gmail.nossr50.skills.AbilityType;
import com.gmail.nossr50.skills.SkillManager; import com.gmail.nossr50.skills.SkillManager;
import com.gmail.nossr50.skills.SkillType; import com.gmail.nossr50.skills.SkillType;
import com.gmail.nossr50.util.Misc; import com.gmail.nossr50.util.Misc;
import com.gmail.nossr50.util.Permissions;
public class AxeManager extends SkillManager { public class AxeManager extends SkillManager {
public AxeManager(Player player) { public AxeManager(Player player) {
@ -22,10 +19,6 @@ public class AxeManager extends SkillManager {
* @param event The event to modify * @param event The event to modify
*/ */
public void bonusDamage(EntityDamageByEntityEvent event) { public void bonusDamage(EntityDamageByEntityEvent event) {
if (!Permissions.axeBonus(player)) {
return;
}
AxeBonusDamageEventHandler eventHandler = new AxeBonusDamageEventHandler(this, event); AxeBonusDamageEventHandler eventHandler = new AxeBonusDamageEventHandler(this, event);
eventHandler.calculateDamageBonus(); eventHandler.calculateDamageBonus();
@ -38,10 +31,6 @@ public class AxeManager extends SkillManager {
* @param event The event to modify * @param event The event to modify
*/ */
public void criticalHitCheck(EntityDamageByEntityEvent event, LivingEntity target) { public void criticalHitCheck(EntityDamageByEntityEvent event, LivingEntity target) {
if (target.isDead() || (target instanceof Tameable && Misc.isFriendlyPet(player, (Tameable) target)) || !Permissions.criticalHit(player)) {
return;
}
CriticalHitEventHandler eventHandler = new CriticalHitEventHandler(this, event, target); CriticalHitEventHandler eventHandler = new CriticalHitEventHandler(this, event, target);
double chance = (Axes.criticalHitMaxChance / Axes.criticalHitMaxBonusLevel) * eventHandler.skillModifier; double chance = (Axes.criticalHitMaxChance / Axes.criticalHitMaxBonusLevel) * eventHandler.skillModifier;
@ -58,10 +47,6 @@ public class AxeManager extends SkillManager {
* @param event The event to modify * @param event The event to modify
*/ */
public void impact(EntityDamageByEntityEvent event, LivingEntity target) { public void impact(EntityDamageByEntityEvent event, LivingEntity target) {
if (target.isDead() || !Permissions.impact(player)) {
return;
}
ImpactEventHandler eventHandler = new ImpactEventHandler(this, event, target); ImpactEventHandler eventHandler = new ImpactEventHandler(this, event, target);
if (Misc.hasArmor(target)) { if (Misc.hasArmor(target)) {
@ -78,10 +63,6 @@ public class AxeManager extends SkillManager {
* @param event The event to process * @param event The event to process
*/ */
public void skullSplitter(LivingEntity target, int damage) { public void skullSplitter(LivingEntity target, int damage) {
if (target.isDead() || !profile.getAbilityMode(AbilityType.SKULL_SPLIITER) || !Permissions.skullSplitter(player)) {
return;
}
SkullSplitterEventHandler eventHandler = new SkullSplitterEventHandler(player, damage, target); SkullSplitterEventHandler eventHandler = new SkullSplitterEventHandler(player, damage, target);
eventHandler.applyAbilityEffects(); eventHandler.applyAbilityEffects();
} }

View File

@ -5,7 +5,6 @@ import org.bukkit.entity.Player;
import com.gmail.nossr50.locale.LocaleLoader; import com.gmail.nossr50.locale.LocaleLoader;
import com.gmail.nossr50.skills.Combat; import com.gmail.nossr50.skills.Combat;
import com.gmail.nossr50.util.ItemChecks;
import com.gmail.nossr50.util.Misc; import com.gmail.nossr50.util.Misc;
public class CounterAttackEventHandler { public class CounterAttackEventHandler {
@ -23,13 +22,6 @@ public class CounterAttackEventHandler {
this.damage = damage; this.damage = damage;
} }
protected boolean isHoldingSword() {
if (player == null)
return false;
return ItemChecks.isSword(player.getItemInHand());
}
protected void calculateSkillModifier() { protected void calculateSkillModifier() {
this.skillModifier = Misc.skillCheck(manager.getSkillLevel(), Swords.counterAttackMaxBonusLevel); this.skillModifier = Misc.skillCheck(manager.getSkillLevel(), Swords.counterAttackMaxBonusLevel);
} }

View File

@ -3,12 +3,9 @@ package com.gmail.nossr50.skills.swords;
import org.bukkit.entity.LivingEntity; import org.bukkit.entity.LivingEntity;
import org.bukkit.entity.Player; import org.bukkit.entity.Player;
import com.gmail.nossr50.skills.AbilityType;
import com.gmail.nossr50.skills.Combat;
import com.gmail.nossr50.skills.SkillManager; import com.gmail.nossr50.skills.SkillManager;
import com.gmail.nossr50.skills.SkillType; import com.gmail.nossr50.skills.SkillType;
import com.gmail.nossr50.util.Misc; import com.gmail.nossr50.util.Misc;
import com.gmail.nossr50.util.Permissions;
public class SwordsManager extends SkillManager { public class SwordsManager extends SkillManager {
public SwordsManager (Player player) { public SwordsManager (Player player) {
@ -21,11 +18,6 @@ public class SwordsManager extends SkillManager {
* @param defender The defending entity * @param defender The defending entity
*/ */
public void bleedCheck(LivingEntity defender) { public void bleedCheck(LivingEntity defender) {
if (!Permissions.swordsBleed(player)) {
return;
}
if (Combat.shouldBeAffected(player, defender)) {
BleedEventHandler eventHandler = new BleedEventHandler(this, defender); BleedEventHandler eventHandler = new BleedEventHandler(this, defender);
float chance = (float) ((Swords.bleedMaxChance / Swords.bleedMaxBonusLevel) * skillLevel); float chance = (float) ((Swords.bleedMaxChance / Swords.bleedMaxBonusLevel) * skillLevel);
@ -36,16 +28,9 @@ public class SwordsManager extends SkillManager {
eventHandler.sendAbilityMessages(); eventHandler.sendAbilityMessages();
} }
} }
}
public void counterAttackChecks(LivingEntity attacker, int damage) { public void counterAttackChecks(LivingEntity attacker, int damage) {
if (!Permissions.counterAttack(player)) {
return;
}
CounterAttackEventHandler eventHandler = new CounterAttackEventHandler(this, attacker, damage); CounterAttackEventHandler eventHandler = new CounterAttackEventHandler(this, attacker, damage);
if (eventHandler.isHoldingSword()) {
eventHandler.calculateSkillModifier(); eventHandler.calculateSkillModifier();
float chance = (float) ((Swords.counterAttackMaxChance / Swords.counterAttackMaxBonusLevel) * skillLevel); float chance = (float) ((Swords.counterAttackMaxChance / Swords.counterAttackMaxBonusLevel) * skillLevel);
@ -56,15 +41,9 @@ public class SwordsManager extends SkillManager {
eventHandler.sendAbilityMessages(); eventHandler.sendAbilityMessages();
} }
} }
}
public void serratedStrikes(LivingEntity target, int damage) { public void serratedStrikes(LivingEntity target, int damage) {
if (!profile.getAbilityMode(AbilityType.SERRATED_STRIKES) || !Permissions.serratedStrikes(player)) {
return;
}
SerratedStrikesEventHandler eventHandler = new SerratedStrikesEventHandler(this, target, damage); SerratedStrikesEventHandler eventHandler = new SerratedStrikesEventHandler(this, target, damage);
eventHandler.applyAbilityEffects(); eventHandler.applyAbilityEffects();
} }
} }

View File

@ -56,14 +56,12 @@ public class TamingManager extends SkillManager {
* @param damage The damage being absorbed by the wolf * @param damage The damage being absorbed by the wolf
*/ */
public void fastFoodService(Wolf wolf, int damage) { public void fastFoodService(Wolf wolf, int damage) {
if (skillLevel >= Taming.fastFoodServiceUnlockLevel && Permissions.fastFoodService(player)) {
if (Misc.getRandom().nextInt(activationChance) < Taming.fastFoodServiceActivationChance) { if (Misc.getRandom().nextInt(activationChance) < Taming.fastFoodServiceActivationChance) {
FastFoodServiceEventHandler eventHandler = new FastFoodServiceEventHandler(wolf); FastFoodServiceEventHandler eventHandler = new FastFoodServiceEventHandler(wolf);
eventHandler.modifyHealth(damage); eventHandler.modifyHealth(damage);
} }
} }
}
/** /**
* Apply the Sharpened Claws ability. * Apply the Sharpened Claws ability.
@ -71,12 +69,9 @@ public class TamingManager extends SkillManager {
* @param event The event to modify * @param event The event to modify
*/ */
public void sharpenedClaws(EntityDamageEvent event) { public void sharpenedClaws(EntityDamageEvent event) {
if (skillLevel >= Taming.sharpenedClawsUnlockLevel && Permissions.sharpenedClaws(player)) {
SharpenedClawsEventHandler eventHandler = new SharpenedClawsEventHandler(event); SharpenedClawsEventHandler eventHandler = new SharpenedClawsEventHandler(event);
eventHandler.modifyEventDamage(); eventHandler.modifyEventDamage();
} }
}
/** /**
* Apply the Gore ability. * Apply the Gore ability.
@ -84,10 +79,6 @@ public class TamingManager extends SkillManager {
* @param event The event to modify * @param event The event to modify
*/ */
public void gore(EntityDamageEvent event) { public void gore(EntityDamageEvent event) {
if (!Permissions.gore(player)) {
return;
}
GoreEventHandler eventHandler = new GoreEventHandler(this, event); GoreEventHandler eventHandler = new GoreEventHandler(this, event);
float chance = (float) ((Taming.goreMaxChance / Taming.goreMaxBonusLevel) * skillLevel); float chance = (float) ((Taming.goreMaxChance / Taming.goreMaxBonusLevel) * skillLevel);
@ -153,10 +144,6 @@ public class TamingManager extends SkillManager {
* @param livingEntity The entity to examine * @param livingEntity The entity to examine
*/ */
public void beastLore(LivingEntity livingEntity) { public void beastLore(LivingEntity livingEntity) {
if (!Permissions.beastLore(player)) {
return;
}
BeastLoreEventHandler eventHandler = new BeastLoreEventHandler(player, livingEntity); BeastLoreEventHandler eventHandler = new BeastLoreEventHandler(player, livingEntity);
eventHandler.sendInspectMessage(); eventHandler.sendInspectMessage();
} }

View File

@ -4,7 +4,6 @@ import org.bukkit.entity.LivingEntity;
import org.bukkit.entity.Player; import org.bukkit.entity.Player;
import org.bukkit.event.entity.EntityDamageEvent; import org.bukkit.event.entity.EntityDamageEvent;
import com.gmail.nossr50.skills.AbilityType;
import com.gmail.nossr50.skills.SkillManager; import com.gmail.nossr50.skills.SkillManager;
import com.gmail.nossr50.skills.SkillType; import com.gmail.nossr50.skills.SkillType;
import com.gmail.nossr50.util.Misc; import com.gmail.nossr50.util.Misc;
@ -21,10 +20,6 @@ public class UnarmedManager extends SkillManager {
* @param defender The defending player * @param defender The defending player
*/ */
public void disarmCheck(LivingEntity defender) { public void disarmCheck(LivingEntity defender) {
if (!(defender instanceof Player) || !Permissions.disarm(player)) {
return;
}
Player defendingPlayer = (Player) defender; Player defendingPlayer = (Player) defender;
DisarmEventHandler eventHandler = new DisarmEventHandler(this, defendingPlayer); DisarmEventHandler eventHandler = new DisarmEventHandler(this, defendingPlayer);
@ -49,10 +44,6 @@ public class UnarmedManager extends SkillManager {
* @param event The event to modify * @param event The event to modify
*/ */
public void deflectCheck(EntityDamageEvent event) { public void deflectCheck(EntityDamageEvent event) {
if (!Permissions.deflect(player)) {
return;
}
DeflectEventHandler eventHandler = new DeflectEventHandler(this, event); DeflectEventHandler eventHandler = new DeflectEventHandler(this, event);
float chance = (float) ((Unarmed.deflectMaxChance / Unarmed.deflectMaxBonusLevel) * skillLevel); float chance = (float) ((Unarmed.deflectMaxChance / Unarmed.deflectMaxBonusLevel) * skillLevel);
@ -65,10 +56,8 @@ public class UnarmedManager extends SkillManager {
} }
public void berserkDamage(EntityDamageEvent event) { public void berserkDamage(EntityDamageEvent event) {
if (!profile.getAbilityMode(AbilityType.BERSERK) || !Permissions.berserk(player)) {
event.setDamage((int) (event.getDamage() * Unarmed.berserkDamageModifier)); event.setDamage((int) (event.getDamage() * Unarmed.berserkDamageModifier));
} }
}
/** /**
* Handle Unarmed bonus damage. * Handle Unarmed bonus damage.
@ -76,10 +65,6 @@ public class UnarmedManager extends SkillManager {
* @param event The event to modify. * @param event The event to modify.
*/ */
public void bonusDamage(EntityDamageEvent event) { public void bonusDamage(EntityDamageEvent event) {
if (!Permissions.unarmedBonus(player)) {
return;
}
UnarmedBonusDamageEventHandler eventHandler = new UnarmedBonusDamageEventHandler(this, event); UnarmedBonusDamageEventHandler eventHandler = new UnarmedBonusDamageEventHandler(this, event);
eventHandler.calculateDamageBonus(); eventHandler.calculateDamageBonus();