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 { public class McMMOPlayerImpactEvent extends McMMOPlayerAxeEvent {
private ItemStack armor; private ItemStack armor;
private short durabilityDamage;
public McMMOPlayerImpactEvent(Player player, ItemStack armor, short durabilityDamage) { public McMMOPlayerImpactEvent(Player player, ItemStack armor) {
super(player); super(player);
this.armor = armor; this.armor = armor;
this.durabilityDamage = durabilityDamage;
} }
public ItemStack getArmor() { public ItemStack getArmor() {
return armor; 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()) { for (ItemStack armor : target.getEquipment().getArmorContents()) {
if (ItemUtils.isArmor(armor) && Axes.impactChance > Misc.getRandom().nextInt(getActivationChance())) { if (ItemUtils.isArmor(armor) && Axes.impactChance > Misc.getRandom().nextInt(getActivationChance())) {
//<<<<<<< HEAD
SkillUtils.handleDurabilityChange(armor, durabilityDamage, Axes.impactMaxDurabilityModifier); SkillUtils.handleDurabilityChange(armor, durabilityDamage, Axes.impactMaxDurabilityModifier);
//=======
// event = new McMMOPlayerImpactEvent(player, armor, calculateImpactDurabilityDamage(durabilityDamage, armor)); event = new McMMOPlayerImpactEvent(player, armor);
// mcMMO.p.getServer().getPluginManager().callEvent(event); mcMMO.p.getServer().getPluginManager().callEvent(event);
//
// if (event.isCancelled()) { if (event.isCancelled()) {
// continue; continue;
// } }
//
// armor.setDurability((short) (event.getDurabilityDamage() + armor.getDurability()));
//>>>>>>> Axe events.
} }
} }
} }