mirror of
https://github.com/KAMKEEL/CustomNPC-Plus.git
synced 2026-11-18 10:19:08 +00:00
Various Fixes to CNPC Abilities
- super slow speed orb has weird properites, after awhile it flies weirdly - Binding HUD scroll key to middle mouse button crashes client - Zero Knockback still does knockback to CNPCs - Charge: the telegraph is where you are looking but you actuually charge where your current body rotation is instead - using slam mid air makes it not work correctly - Beam disappears after going out of the render distance but still fires - Player vortex can only pull one target Slam now takes current height when being used to calculate damage
This commit is contained in:
1 parent
ec60a9bb21
commit
d2d5bcc59b
15 files changed
+317
-95
No files matched your search
@@ -465,6 +465,11 @@ public abstract class Ability implements IAbility, IAbilityAction {
|
||||
}
|
||||
}
|
||||
|
||||
// Save velocity before damage to cancel vanilla knockback when ability knockback is zero
|
||||
double prevMotionX = hitEntity.motionX;
|
||||
double prevMotionY = hitEntity.motionY;
|
||||
double prevMotionZ = hitEntity.motionZ;
|
||||
|
||||
// Apply damage
|
||||
if (damage > 0) {
|
||||
// Check for ability extenders (e.g., DBC Addon damage routing)
|
||||
@@ -483,9 +488,14 @@ public abstract class Ability implements IAbility, IAbilityAction {
|
||||
}
|
||||
}
|
||||
|
||||
// Apply knockback if any
|
||||
// Apply knockback if any, otherwise restore velocity to cancel vanilla knockback
|
||||
if (knockback > 0 || knockbackUp > 0) {
|
||||
applyKnockback(hitEntity, knockbackDirX, knockbackDirZ, knockback, knockbackUp);
|
||||
} else {
|
||||
hitEntity.motionX = prevMotionX;
|
||||
hitEntity.motionY = prevMotionY;
|
||||
hitEntity.motionZ = prevMotionZ;
|
||||
hitEntity.velocityChanged = true;
|
||||
}
|
||||
|
||||
return true;
|
||||
|
||||
Reference in new issue
Block a user