Lot's of Weird Ability Interaction Fixes

This commit is contained in:
Kam committed 2026-02-22 22:39:33 -05:00
1 parent 25320f8de1
commit b5534b4a39
9 files changed
+212 -132

No files matched your search

@@ -837,7 +837,11 @@ public abstract class EntityEnergyProjectile extends EntityEnergyAbility {
*/
protected boolean beginLookVectorLaunch(boolean resetInterpolationState) {
setCharging(false);
boolean positioned = setLookVectorLaunchPosition(true);
Entity owner = getOwnerEntity();
boolean positioned = false;
if (owner instanceof EntityLivingBase && shouldSnapLaunchToLookVector((EntityLivingBase) owner)) {
positioned = setLookVectorLaunchPosition((EntityLivingBase) owner, getOwnerLookVector(), true);
}
syncStartPositionToCurrent();
if (resetInterpolationState) {
syncPositionStateToCurrent(true);
@@ -850,7 +854,7 @@ public abstract class EntityEnergyProjectile extends EntityEnergyAbility {
*/
protected boolean beginLookVectorLaunch(EntityLivingBase owner, Vec3 look, boolean resetInterpolationState) {
setCharging(false);
boolean positioned = setLookVectorLaunchPosition(owner, look, true);
boolean positioned = shouldSnapLaunchToLookVector(owner) && setLookVectorLaunchPosition(owner, look, true);
syncStartPositionToCurrent();
if (resetInterpolationState) {
syncPositionStateToCurrent(true);
@@ -858,6 +862,14 @@ public abstract class EntityEnergyProjectile extends EntityEnergyAbility {
return positioned;
}
/**
* Only player-cast projectiles should be recentered to look-vector launch origin.
* NPC projectiles keep their anchor charge origin so casts originate from the configured anchor.
*/
protected boolean shouldSnapLaunchToLookVector(EntityLivingBase owner) {
return owner instanceof EntityPlayer;
}
/**
* Default preview launch: snap to look-vector origin and fire along look.
*/