Reimplement Impact event

This commit is contained in:
GJ 2013-11-12 12:25:09 -05:00
parent b1095ce1a6
commit fcdb5abaea
2 changed files with 8 additions and 22 deletions

View File

@ -5,23 +5,13 @@ import org.bukkit.inventory.ItemStack;
public class McMMOPlayerImpactEvent extends McMMOPlayerAxeEvent {
private ItemStack armor;
private short durabilityDamage;
public McMMOPlayerImpactEvent(Player player, ItemStack armor, short durabilityDamage) {
public McMMOPlayerImpactEvent(Player player, ItemStack armor) {
super(player);
this.armor = armor;
this.durabilityDamage = durabilityDamage;
}
public ItemStack getArmor() {
return armor;
}
public short getDurabilityDamage() {
return durabilityDamage;
}
public void setDurabilityDamage(short durabilityDamage) {
this.durabilityDamage = durabilityDamage;
}
}

View File

@ -92,18 +92,14 @@ public class AxesManager extends SkillManager {
for (ItemStack armor : target.getEquipment().getArmorContents()) {
if (ItemUtils.isArmor(armor) && Axes.impactChance > Misc.getRandom().nextInt(getActivationChance())) {
//<<<<<<< HEAD
SkillUtils.handleDurabilityChange(armor, durabilityDamage, Axes.impactMaxDurabilityModifier);
//=======
// event = new McMMOPlayerImpactEvent(player, armor, calculateImpactDurabilityDamage(durabilityDamage, armor));
// mcMMO.p.getServer().getPluginManager().callEvent(event);
//
// if (event.isCancelled()) {
// continue;
// }
//
// armor.setDurability((short) (event.getDurabilityDamage() + armor.getDurability()));
//>>>>>>> Axe events.
event = new McMMOPlayerImpactEvent(player, armor);
mcMMO.p.getServer().getPluginManager().callEvent(event);
if (event.isCancelled()) {
continue;
}
}
}
}