diff --git a/Spigot-Server-Patches/Limit-lightning-strike-effect-distance.patch b/Spigot-Server-Patches/Limit-lightning-strike-effect-distance.patch index aa92bd9b4a..c81b312e23 100644 --- a/Spigot-Server-Patches/Limit-lightning-strike-effect-distance.patch +++ b/Spigot-Server-Patches/Limit-lightning-strike-effect-distance.patch @@ -40,7 +40,7 @@ index 93bf8c6d3..25246eac5 100644 public boolean firePhysicsEventForRedstone = false; private void firePhysicsEventForRedstone() { diff --git a/src/main/java/net/minecraft/server/EntityLightning.java b/src/main/java/net/minecraft/server/EntityLightning.java -index afbe43dd3..b7e88d346 100644 +index afbe43dd3..f64e6e864 100644 --- a/src/main/java/net/minecraft/server/EntityLightning.java +++ b/src/main/java/net/minecraft/server/EntityLightning.java @@ -0,0 +0,0 @@ public class EntityLightning extends EntityWeather { @@ -48,11 +48,12 @@ index afbe43dd3..b7e88d346 100644 double deltaZ = this.locZ - player.locZ; double distanceSquared = deltaX * deltaX + deltaZ * deltaZ; + // Paper start - Limit lightning strike effect distance -+ if (distanceSquared < this.world.paperConfig.sqrMaxLightningImpactSoundDistance) { ++ if (distanceSquared <= this.world.paperConfig.sqrMaxLightningImpactSoundDistance) { + player.playerConnection.sendPacket(new PacketPlayOutNamedSoundEffect(SoundEffects.ENTITY_LIGHTNING_BOLT_IMPACT, + SoundCategory.WEATHER, this.locX, this.locY, this.locZ, 2.0f, 0.5F + this.random.nextFloat() * 0.2F)); ++ } else { ++ continue; + } -+ if (distanceSquared > this.world.paperConfig.sqrMaxLightningSoundDistance) continue; + // Paper end if (distanceSquared > viewDistance * viewDistance) { double deltaLength = Math.sqrt(distanceSquared);