You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Inverted fireball knockback vector calculations when explosion yield is small.
Knockback distance check being clipped by a static 64.0D cap instead of scaling with actual blast size.
Problem & Root Cause
When calculating explosion knockback for smaller yield explosions (such as small fireballs or custom explosion sizes < 2.0), d13 = d12 / d0 computed an inverted vector direction that caused entities to be pulled inward toward the blast center rather than repelled outward.
Large explosions (with radius > 8 blocks) had their knockback clipped prematurely due to a hardcoded d0 < 64.0D distance check, ignoring the actual dynamic blast radius (f3 * 2.0F).
Solution
Corrected the vector normalization math in Explosion.java so knockback direction is always calculated outward from the epicenter regardless of yield size.
Replaced the hardcoded 64.0D distance check with (f3 * f3) dynamic radius squared check.
Added ExplosionKnockbackTest and ExplosionKnockbackRegressionTest unit tests to verify knockback vectors across various explosion sizes.
why do all these PRs have // WindSpigot - GamingOP69? just do // WindSpigot or if you really want credit // GamingOP69 not both at once
it is not a big deal bro ..
it's just a rule that you don't do both. either // WindSpigot or // GamingOP69. // WindSpigot - GamingOP69 would just be a comment by WindSpigot saying GamingOP69
why do all these PRs have // WindSpigot - GamingOP69? just do // WindSpigot or if you really want credit // GamingOP69 not both at once
it is not a big deal bro ..
it's just a rule that you don't do both. either // WindSpigot or // GamingOP69. // WindSpigot - GamingOP69 would just be a comment by WindSpigot saying GamingOP69
If you can, please adjust your comments accordingly.
Also, please explain the PR in your own words, without AI so it's more clear/accurate
why do all these PRs have // WindSpigot - GamingOP69? just do // WindSpigot or if you really want credit // GamingOP69 not both at once
it is not a big deal bro ..
it's just a rule that you don't do both. either // WindSpigot or // GamingOP69. // WindSpigot - GamingOP69 would just be a comment by WindSpigot saying GamingOP69
If you can, please adjust your comments accordingly.
Also, please explain the PR in your own words, without AI so it's more clear/accurate
please don't do // WindSpigot when it's a internal class from WindSpigot. also don't wrap entire methods with // WindSpigot start when you haven't changed the entire method :)
please don't do // WindSpigot when it's a internal class from WindSpigot. also don't wrap entire methods with // WindSpigot start when you haven't changed the entire method :)
@GamingOP69 i made suggestions on your PRs where you can apply these fixes directly
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR fixes two bugs in
Explosion.java:Problem & Root Cause
d13 = d12 / d0computed an inverted vector direction that caused entities to be pulled inward toward the blast center rather than repelled outward.d0 < 64.0Ddistance check, ignoring the actual dynamic blast radius(f3 * 2.0F).Solution
Explosion.javaso knockback direction is always calculated outward from the epicenter regardless of yield size.64.0Ddistance check with(f3 * f3)dynamic radius squared check.ExplosionKnockbackTestandExplosionKnockbackRegressionTestunit tests to verify knockback vectors across various explosion sizes.