Skip to content

Commit

Permalink
disable holy water damage when pvp is turned off
Browse files Browse the repository at this point in the history
close #1263
  • Loading branch information
Cheaterpaul committed Oct 11, 2023
1 parent c7569d2 commit 8c38bb2
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package de.teamlapen.vampirism.items;

import de.teamlapen.lib.lib.util.UtilLib;
import de.teamlapen.vampirism.VampirismMod;
import de.teamlapen.vampirism.api.blocks.HolyWaterEffectConsumer;
import de.teamlapen.vampirism.entity.ThrowableItemEntity;
import de.teamlapen.vampirism.util.DamageHandler;
Expand Down Expand Up @@ -53,7 +52,9 @@ protected void impactEntities(@NotNull ThrowableItemEntity bottleEntity, ItemSta

if (!list1.isEmpty()) {
for (LivingEntity entity : list1) {
DamageHandler.affectEntityHolyWaterSplash(entity, getStrength(getVampirismTier()), bottleEntity.distanceToSqr(entity), result.getType() == HitResult.Type.ENTITY, thrower instanceof LivingEntity ? (LivingEntity) thrower : null);
if (thrower instanceof Player source && entity instanceof Player target && source.canHarmPlayer(target)) {
DamageHandler.affectEntityHolyWaterSplash(entity, getStrength(getVampirismTier()), bottleEntity.distanceToSqr(entity), result.getType() == HitResult.Type.ENTITY, thrower instanceof LivingEntity ? (LivingEntity) thrower : null);
}
}
}
}
Expand Down

0 comments on commit 8c38bb2

Please sign in to comment.