Small Set Speed Fix

This commit is contained in:
Kam committed 2026-03-08 23:10:42 -04:00
1 parent 182f7d8c9c
commit 992066d19b
1 file changed
+11
@@ -2352,7 +2352,18 @@ public abstract class EntityEnergyProjectile extends EntityEnergyAbility {
}
public void setSpeed(float speed) {
float oldSpeed = homingData.getSpeed();
homingData.setSpeed(speed);
// Rescale current motion vector to match new speed
if (addedToChunk && !worldObj.isRemote) {
double len = Math.sqrt(motionX * motionX + motionY * motionY + motionZ * motionZ);
if (len > 0) {
double scale = speed / len;
motionX *= scale;
motionY *= scale;
motionZ *= scale;
}
}
}
public AnchorPoint getAnchorPoint() {