mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2024-11-29 16:46:46 +01:00
Reimplement Impact event
This commit is contained in:
parent
b1095ce1a6
commit
fcdb5abaea
@ -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;
|
||||
}
|
||||
}
|
||||
|
@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user