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
closes #1263
  • Loading branch information
maxanier committed Oct 14, 2023
1 parent 70f13cb commit 14231d0
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
package de.teamlapen.vampirism.items;

import de.teamlapen.vampirism.VampirismMod;
import de.teamlapen.vampirism.entity.ThrowableItemEntity;
import de.teamlapen.vampirism.util.DamageHandler;
import net.minecraft.sounds.SoundEvents;
Expand Down Expand Up @@ -43,6 +42,9 @@ public void onImpact(@NotNull ThrowableItemEntity entity, ItemStack stack, @NotN

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

0 comments on commit 14231d0

Please sign in to comment.