From a65f16cfac87cbac62c6a07c7e3cdb4a935bd32f Mon Sep 17 00:00:00 2001 From: Auxilor Date: Tue, 14 Sep 2021 08:34:51 +0100 Subject: [PATCH] Improved PR --- .../java/com/willfp/eco/util/LightningUtils.java | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/eco-api/src/main/java/com/willfp/eco/util/LightningUtils.java b/eco-api/src/main/java/com/willfp/eco/util/LightningUtils.java index e60a77624..3f63392fe 100644 --- a/eco-api/src/main/java/com/willfp/eco/util/LightningUtils.java +++ b/eco-api/src/main/java/com/willfp/eco/util/LightningUtils.java @@ -3,7 +3,6 @@ import lombok.experimental.UtilityClass; import org.bukkit.Location; import org.bukkit.Sound; -import org.bukkit.SoundCategory; import org.bukkit.entity.LivingEntity; import org.jetbrains.annotations.NotNull; @@ -21,21 +20,26 @@ public class LightningUtils { * @param silent If the lightning sound should be played locally */ public void strike(@NotNull final LivingEntity victim, - final double damage, boolean silent) { + final double damage, + final boolean silent) { Location loc = victim.getLocation(); if (silent) { victim.getWorld().spigot().strikeLightningEffect(loc, true); victim.getWorld().playSound(loc, Sound.ENTITY_LIGHTNING_BOLT_IMPACT, 1, 1); - } - else { + } else { victim.getWorld().strikeLightningEffect(loc); } victim.damage(damage); } - + /** + * Strike lightning on a victim without fire. + * + * @param victim The entity to smite. + * @param damage The damage to deal. + */ public void strike(@NotNull final LivingEntity victim, final double damage) { strike(victim, damage, false);