Fixed Aiming

This commit is contained in:
Auxilor 2021-04-11 20:58:14 +01:00
parent 0476288944
commit 3be5866075

View File

@ -74,9 +74,10 @@ public class Aiming extends EcoEnchant {
Runnable runnable = this.getPlugin().getRunnableFactory().create(bukkitRunnable -> {
List<LivingEntity> nearbyEntities = (List<LivingEntity>) (List<?>) Arrays.asList(arrow.getNearbyEntities(finalDistance, finalDistance, finalDistance).stream()
.filter(entity -> entity instanceof LivingEntity)
.map(entity -> (LivingEntity) entity)
.filter(entity -> !entity.equals(player))
.filter(entity -> !(entity instanceof Enderman))
.filter(entity -> !AntigriefManager.canInjure(player, (LivingEntity) entity))
.filter(entity -> AntigriefManager.canInjure(player, entity))
.filter(entity -> {
if (entity instanceof Player) {
return ((Player) entity).getGameMode().equals(GameMode.SURVIVAL) || ((Player) entity).getGameMode().equals(GameMode.ADVENTURE);