mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2024-11-25 22:56:45 +01:00
Fix spectators being affected by a combat ability (#3591)
* Fix spectators being affected by a combat ability
This commit is contained in:
parent
592c3a2142
commit
2a43bce849
@ -4,6 +4,7 @@ import java.util.EnumMap;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
import org.bukkit.GameMode;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.entity.AnimalTamer;
|
||||
import org.bukkit.entity.Animals;
|
||||
@ -544,6 +545,11 @@ public final class CombatUtils {
|
||||
if (!player.canSee(defender)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
// Spectators should not be affected
|
||||
if (defender.getGameMode() == GameMode.SPECTATOR) {
|
||||
return false;
|
||||
}
|
||||
|
||||
// It may seem a bit redundant but we need a check here to prevent bleed from being applied in applyAbilityAoE()
|
||||
if (callFakeDamageEvent(player, entity, 1.0) == 0) {
|
||||
|
Loading…
Reference in New Issue
Block a user