use of org.bukkit.entity.Projectile in project Glowstone by GlowstoneMC.
the class GlowPlayer method damage.
@Override
public void damage(double amount, Entity source, @NotNull DamageCause cause) {
boolean pvpAllowed = server.isPvpEnabled() && world.getPVP();
if (!pvpAllowed) {
if (source instanceof Player) {
return;
}
if (cause == DamageCause.PROJECTILE && source instanceof Projectile) {
Projectile projectile = (Projectile) source;
if (projectile.getShooter() instanceof Player) {
return;
}
}
}
super.damage(amount, source, cause);
}
Aggregations