fix non player explosions not harming player/hostile mobs

This commit is contained in:
Flemmli97 2022-02-07 12:20:10 +01:00
parent bfa769d632
commit e6061573d8

View File

@ -181,7 +181,7 @@ public class EntityInteractEvents {
public static boolean preventDamage(Entity entity, DamageSource source) {
if (source.getEntity() instanceof ServerPlayer)
return attackSimple((ServerPlayer) source.getEntity(), entity, true) != InteractionResult.PASS;
else if (source.isExplosion() && !entity.level.isClientSide) {
else if (source.isExplosion() && !entity.level.isClientSide && !(entity instanceof ServerPlayer || entity instanceof Enemy)) {
IPermissionContainer claim = ClaimStorage.get((ServerLevel) entity.level).getForPermissionCheck(entity.blockPosition());
return claim != null && !claim.canInteract(null, PermissionRegistry.EXPLOSIONS, entity.blockPosition());
}