mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2024-11-22 13:16:45 +01:00
Fixed ClassCastException relating to counter-attack with Swords. Fixes
#784
This commit is contained in:
parent
3440833af8
commit
4210920c5f
@ -13,6 +13,7 @@ Version 1.4.02-dev
|
|||||||
= Fixed bug where some skills weren't registering as unlocked until one level later
|
= Fixed bug where some skills weren't registering as unlocked until one level later
|
||||||
= Fixed bug where the PTP cooldown was being read improperly
|
= Fixed bug where the PTP cooldown was being read improperly
|
||||||
= Fixed bug where /ptp <accept|toggle|acceptall> where broken
|
= Fixed bug where /ptp <accept|toggle|acceptall> where broken
|
||||||
|
= Fixed ClassCastException relating to counter-attack with Swords
|
||||||
|
|
||||||
Version 1.4.01
|
Version 1.4.01
|
||||||
= Fixed bug where trying to use /mctop or /xplock with the Smelting child skill caused NPEs
|
= Fixed bug where trying to use /mctop or /xplock with the Smelting child skill caused NPEs
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
package com.gmail.nossr50.skills.swords;
|
package com.gmail.nossr50.skills.swords;
|
||||||
|
|
||||||
|
import org.bukkit.entity.Entity;
|
||||||
import org.bukkit.entity.LivingEntity;
|
import org.bukkit.entity.LivingEntity;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
|
|
||||||
@ -28,8 +29,8 @@ public class SwordsManager extends SkillManager {
|
|||||||
return Permissions.bleed(getPlayer());
|
return Permissions.bleed(getPlayer());
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean canUseCounterAttack() {
|
public boolean canUseCounterAttack(Entity target) {
|
||||||
return Permissions.counterAttack(getPlayer());
|
return target instanceof LivingEntity && Permissions.counterAttack(getPlayer());
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean canUseSerratedStrike() {
|
public boolean canUseSerratedStrike() {
|
||||||
|
@ -279,7 +279,7 @@ public final class CombatUtils {
|
|||||||
|
|
||||||
SwordsManager swordsManager = mcMMOPlayer.getSwordsManager();
|
SwordsManager swordsManager = mcMMOPlayer.getSwordsManager();
|
||||||
|
|
||||||
if (swordsManager.canUseCounterAttack()) {
|
if (swordsManager.canUseCounterAttack(damager)) {
|
||||||
swordsManager.counterAttackChecks((LivingEntity) damager, event.getDamage());
|
swordsManager.counterAttackChecks((LivingEntity) damager, event.getDamage());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user