A few orb and beam changes and rotation sync for body and head during animations

This commit is contained in:
Vidal committed 2026-02-20 22:48:59 -03:00
1 parent 89e87b7656
commit 42b7d7e42e
5 files changed
+210 -194

No files matched your search

@@ -48,8 +48,8 @@ public class AbilityBeam extends AbilityEnergyProjectile<EntityAbilityBeam> impl
this.cooldownTicks = 0;
this.windUpTicks = 40;
this.lockMovement = LockMovementType.WINDUP_AND_ACTIVE;
this.rotationMode = RotationMode.TRACK;
this.rotationPhase = LockMovementType.WINDUP_AND_ACTIVE;
this.rotationMode = RotationMode.LOCKED;
this.rotationPhase = LockMovementType.ACTIVE;
this.telegraphType = TelegraphType.CIRCLE;
this.showTelegraph = true;
this.windUpAnimationName = "Ability_Beam_Windup";
@@ -115,6 +115,9 @@ public class AbilityOrb extends AbilityEnergyProjectile<EntityAbilityOrb> implem
orb.setDamage(4.0f);
orb.setKnockback(0.0f);
orb.setKnockbackUp(0.0f);
orb.setProjectileCount(2);
orb.setFireDelay(2);
a.setLockMovement(LockMovementType.WINDUP_AND_ACTIVE);
a.setMaxRange(75.0f);
a.setBurstEnabled(true);
a.setBurstAmount(15);
@@ -23,6 +23,7 @@ import net.minecraft.util.DamageSource;
import noppes.npcs.AbstractDataAbilities;
import noppes.npcs.EventHooks;
import noppes.npcs.LogWriter;
import noppes.npcs.NoppesUtilPlayer;
import noppes.npcs.api.ability.IPlayerAbilityData;
import noppes.npcs.api.entity.IPlayer;
import noppes.npcs.controllers.ScriptController;
@@ -297,6 +298,7 @@ public class PlayerAbilityData extends AbstractDataAbilities implements IPlayerA
// Apply rotation and position locks after ability tick
applyRotationControl(player);
applyPositionLock(player);
applyAnimationRotationSync(player);
// Sync lock state to client (only sends when flags change)
syncAbilityStateIfNeeded(player);
@@ -844,6 +846,17 @@ public class PlayerAbilityData extends AbstractDataAbilities implements IPlayerA
}
}
private void applyAnimationRotationSync(EntityPlayer player) {
if (rotationLocked || currentAbility == null) return;
if (currentAbility.getPhase() == AbilityPhase.IDLE || currentAbility.getPhase() == AbilityPhase.DAZED)
return;
// TODO This is a temporary duct-tape solution to fix the animation not rotating with head rotation
if (!currentAbility.isRotationLockedForCurrentPhase() && player instanceof EntityPlayerMP) {
NoppesUtilPlayer.swingPlayerArm((EntityPlayerMP) player);
}
}
// ═══════════════════════════════════════════════════════════════════
// POSITION LOCKING (Player-specific application)
// ═══════════════════════════════════════════════════════════════════