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)
// ═══════════════════════════════════════════════════════════════════
@@ -1,196 +1,196 @@
{
"Loop": 1,
"Loop": 2,
"Speed": 1.0f,
"Frames": [
{
"ColorMarker": 16777215,
"Comment": "",
"Speed": 3.0f,
"FrameParts": [
{
"Pivot2": -7.0f,
"Part": "HEAD",
"Rotation1": 0.0f,
"Rotation0": 0.0f,
"Pivot0": 0.0f,
"Pivot1": 2.0f,
"Rotation2": 0.0f
},
{
"Pivot2": 0.0f,
"Part": "RIGHT_LEG",
"Rotation1": -31.0f,
"Rotation0": 6.0f,
"Pivot0": 0.0f,
"Pivot1": 0.0f,
"Rotation2": 18.0f
},
{
"Pivot2": -7.0f,
"Part": "RIGHT_ARM",
"Rotation1": 0.0f,
"Rotation0": -90.0f,
"Pivot0": 0.0f,
"Pivot1": 1.0f,
"Rotation2": 0.0f
},
{
"Pivot2": 0.0f,
"Part": "LEFT_LEG",
"Rotation1": 31.0f,
"Rotation0": 6.0f,
"Pivot0": 0.0f,
"Pivot1": 0.0f,
"Rotation2": -18.0f
},
{
"Pivot2": -6.0f,
"Part": "BODY",
"Rotation1": 0.0f,
"Rotation0": 25.0f,
"Pivot0": 0.0f,
"Pivot1": 1.0f,
"Rotation2": 0.0f
},
{
"Pivot2": -1.0f,
"Part": "LEFT_ARM",
"Rotation1": -25.0f,
"Rotation0": -90.0f,
"Pivot0": -1.0f,
"Pivot1": 1.0f,
"Rotation2": -25.0f
}
],
"Smooth": 0b,
"Duration": 2
},
{
"ColorMarker": 16777215,
"Comment": "",
"Speed": 3.0f,
"FrameParts": [
{
"Pivot2": -7.0f,
"Part": "HEAD",
"Rotation1": 0.0f,
"Rotation0": 0.0f,
"Pivot0": 0.0f,
"Pivot1": 2.0f,
"Rotation2": 0.0f
},
{
"Pivot2": 0.0f,
"Part": "RIGHT_LEG",
"Rotation1": -31.0f,
"Rotation0": 6.0f,
"Pivot0": 0.0f,
"Pivot1": 0.0f,
"Rotation2": 18.0f
},
{
"Pivot2": -1.0f,
"Part": "RIGHT_ARM",
"Rotation1": 25.0f,
"Rotation0": -90.0f,
"Pivot0": 1.0f,
"Pivot1": 1.0f,
"Rotation2": 25.0f
},
{
"Pivot2": 0.0f,
"Part": "LEFT_LEG",
"Rotation1": 31.0f,
"Rotation0": 6.0f,
"Pivot0": 0.0f,
"Pivot1": 0.0f,
"Rotation2": -18.0f
},
{
"Pivot2": -6.0f,
"Part": "BODY",
"Rotation1": 0.0f,
"Rotation0": 25.0f,
"Pivot0": 0.0f,
"Pivot1": 1.0f,
"Rotation2": 0.0f
},
{
"Pivot2": -7.0f,
"Part": "LEFT_ARM",
"Rotation1": 0.0f,
"Rotation0": -90.0f,
"Pivot0": 0.0f,
"Pivot1": 1.0f,
"Rotation2": 0.0f
}
],
"Smooth": 0b,
"Duration": 5
},
{
"ColorMarker": 16777215,
"Comment": "",
"Speed": 3.0f,
"FrameParts": [
{
"Pivot2": -7.0f,
"Part": "HEAD",
"Rotation1": 0.0f,
"Rotation0": 0.0f,
"Pivot0": 0.0f,
"Pivot1": 2.0f,
"Rotation2": 0.0f
},
{
"Pivot2": 0.0f,
"Part": "RIGHT_LEG",
"Rotation1": -31.0f,
"Rotation0": 6.0f,
"Pivot0": 0.0f,
"Pivot1": 0.0f,
"Rotation2": 18.0f
},
{
"Pivot2": -7.0f,
"Part": "RIGHT_ARM",
"Rotation1": 0.0f,
"Rotation0": -90.0f,
"Pivot0": 0.0f,
"Pivot1": 1.0f,
"Rotation2": 0.0f
},
{
"Pivot2": 0.0f,
"Part": "LEFT_LEG",
"Rotation1": 31.0f,
"Rotation0": 6.0f,
"Pivot0": 0.0f,
"Pivot1": 0.0f,
"Rotation2": -18.0f
},
{
"Pivot2": -6.0f,
"Part": "BODY",
"Rotation1": 0.0f,
"Rotation0": 25.0f,
"Pivot0": 0.0f,
"Pivot1": 1.0f,
"Rotation2": 0.0f
},
{
"Pivot2": -1.0f,
"Part": "LEFT_ARM",
"Rotation1": -25.0f,
"Rotation0": -90.0f,
"Pivot0": -1.0f,
"Pivot1": 1.0f,
"Rotation2": -25.0f
}
],
"Smooth": 0b,
"Duration": 5
}
{
"ColorMarker": 16777215,
"Comment": "",
"Speed": 3.0f,
"FrameParts": [
{
"Pivot2": 0.0f,
"Part": "LEFT_LEG",
"Rotation1": 31.0f,
"Rotation0": 6.0f,
"Pivot0": 0.0f,
"Pivot1": 0.0f,
"Rotation2": -18.0f
},
{
"Pivot2": -6.0f,
"Part": "BODY",
"Rotation1": 0.0f,
"Rotation0": 25.0f,
"Pivot0": 0.0f,
"Pivot1": 1.0f,
"Rotation2": 0.0f
},
{
"Pivot2": -7.0f,
"Part": "HEAD",
"Rotation1": 0.0f,
"Rotation0": 0.0f,
"Pivot0": 0.0f,
"Pivot1": 2.0f,
"Rotation2": 0.0f
},
{
"Pivot2": -7.0f,
"Part": "RIGHT_ARM",
"Rotation1": 0.0f,
"Rotation0": -90.0f,
"Pivot0": 0.0f,
"Pivot1": 1.0f,
"Rotation2": 0.0f
},
{
"Pivot2": -1.0f,
"Part": "LEFT_ARM",
"Rotation1": -25.0f,
"Rotation0": -90.0f,
"Pivot0": -1.0f,
"Pivot1": 1.0f,
"Rotation2": -25.0f
},
{
"Pivot2": 0.0f,
"Part": "RIGHT_LEG",
"Rotation1": -31.0f,
"Rotation0": 6.0f,
"Pivot0": 0.0f,
"Pivot1": 0.0f,
"Rotation2": 18.0f
}
],
"Smooth": 0b,
"Duration": 5
},
{
"ColorMarker": 16777215,
"Comment": "",
"Speed": 3.0f,
"FrameParts": [
{
"Pivot2": 0.0f,
"Part": "LEFT_LEG",
"Rotation1": 31.0f,
"Rotation0": 6.0f,
"Pivot0": 0.0f,
"Pivot1": 0.0f,
"Rotation2": -18.0f
},
{
"Pivot2": -6.0f,
"Part": "BODY",
"Rotation1": 0.0f,
"Rotation0": 25.0f,
"Pivot0": 0.0f,
"Pivot1": 1.0f,
"Rotation2": 0.0f
},
{
"Pivot2": -7.0f,
"Part": "HEAD",
"Rotation1": 0.0f,
"Rotation0": 0.0f,
"Pivot0": 0.0f,
"Pivot1": 2.0f,
"Rotation2": 0.0f
},
{
"Pivot2": -1.0f,
"Part": "RIGHT_ARM",
"Rotation1": 25.0f,
"Rotation0": -90.0f,
"Pivot0": 1.0f,
"Pivot1": 1.0f,
"Rotation2": 25.0f
},
{
"Pivot2": -7.0f,
"Part": "LEFT_ARM",
"Rotation1": 0.0f,
"Rotation0": -90.0f,
"Pivot0": 0.0f,
"Pivot1": 1.0f,
"Rotation2": 0.0f
},
{
"Pivot2": 0.0f,
"Part": "RIGHT_LEG",
"Rotation1": -31.0f,
"Rotation0": 6.0f,
"Pivot0": 0.0f,
"Pivot1": 0.0f,
"Rotation2": 18.0f
}
],
"Smooth": 0b,
"Duration": 5
},
{
"ColorMarker": 16777215,
"Comment": "",
"Speed": 3.0f,
"FrameParts": [
{
"Pivot2": 0.0f,
"Part": "LEFT_LEG",
"Rotation1": 31.0f,
"Rotation0": 6.0f,
"Pivot0": 0.0f,
"Pivot1": 0.0f,
"Rotation2": -18.0f
},
{
"Pivot2": -6.0f,
"Part": "BODY",
"Rotation1": 0.0f,
"Rotation0": 25.0f,
"Pivot0": 0.0f,
"Pivot1": 1.0f,
"Rotation2": 0.0f
},
{
"Pivot2": -7.0f,
"Part": "HEAD",
"Rotation1": 0.0f,
"Rotation0": 0.0f,
"Pivot0": 0.0f,
"Pivot1": 2.0f,
"Rotation2": 0.0f
},
{
"Pivot2": -6.0f,
"Part": "RIGHT_ARM",
"Rotation1": 0.0f,
"Rotation0": 0.0f,
"Pivot0": 0.0f,
"Pivot1": 1.0f,
"Rotation2": 0.0f
},
{
"Pivot2": -6.0f,
"Part": "LEFT_ARM",
"Rotation1": 0.0f,
"Rotation0": 0.0f,
"Pivot0": 0.0f,
"Pivot1": 1.0f,
"Rotation2": 0.0f
},
{
"Pivot2": 0.0f,
"Part": "RIGHT_LEG",
"Rotation1": -31.0f,
"Rotation0": 6.0f,
"Pivot0": 0.0f,
"Pivot1": 0.0f,
"Rotation2": 18.0f
}
],
"Smooth": 0b,
"Duration": 5
}
],
"CurrentFrameTime": 0,
"CurrentFrame": 0,
@@ -1,5 +1,5 @@
{
"Loop": 3,
"Loop": -1,
"Speed": 1.0f,
"Frames": [
{
@@ -252,7 +252,7 @@
}
],
"Smooth": 0b,
"Duration": 3
"Duration": 20
}
],
"CurrentFrameTime": 0,