mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2024-12-02 01:46:45 +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 {
|
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;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
@ -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.
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user