mirror of
https://github.com/KAMKEEL/CustomNPC-Plus.git
synced 2026-11-12 20:07:32 +00:00
Barrier Logic Corrections
This commit is contained in:
1 parent
04e6cbe6cf
commit
1c02657282
3 files changed
+16
-10
No files matched your search
@@ -72,7 +72,7 @@ public abstract class EntityAbilityBarrier extends EntityEnergyAbility {
|
||||
}
|
||||
|
||||
public boolean shouldReflect() {
|
||||
return reflectEnabled && useHealth && result == ProjectileHitResult.BLOCKED;
|
||||
return reflectEnabled && result == ProjectileHitResult.BLOCKED;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -267,7 +267,7 @@ public abstract class EntityAbilityBarrier extends EntityEnergyAbility {
|
||||
healthBefore,
|
||||
0.0f,
|
||||
0.0f,
|
||||
false,
|
||||
barrierData.reflect,
|
||||
barrierData.reflectStrengthPct,
|
||||
false
|
||||
);
|
||||
|
||||
@@ -186,13 +186,17 @@ public class EntityAbilityDome extends EntityAbilityBarrier {
|
||||
}
|
||||
}
|
||||
|
||||
double prevX = projectile.posX - projectile.motionX;
|
||||
double prevY = projectile.posY - projectile.motionY;
|
||||
double prevZ = projectile.posZ - projectile.motionZ;
|
||||
// Test the UPCOMING movement (this tick) so the barrier intercepts before
|
||||
// entity collision runs in updateProjectile(). Using the previous tick's
|
||||
// segment caused small domes to miss fast projectiles that could cross the
|
||||
// dome and hit the player in a single tick.
|
||||
double nextX = projectile.posX + projectile.motionX;
|
||||
double nextY = projectile.posY + projectile.motionY;
|
||||
double nextZ = projectile.posZ + projectile.motionZ;
|
||||
|
||||
return isIncomingRay(
|
||||
nextX, nextY, nextZ,
|
||||
projectile.posX, projectile.posY, projectile.posZ,
|
||||
prevX, prevY, prevZ,
|
||||
projectile.getOwnerEntityId());
|
||||
}
|
||||
|
||||
|
||||
@@ -340,13 +340,15 @@ public class EntityAbilityPanel extends EntityAbilityBarrier {
|
||||
}
|
||||
}
|
||||
|
||||
double prevX = projectile.posX - projectile.motionX;
|
||||
double prevY = projectile.posY - projectile.motionY;
|
||||
double prevZ = projectile.posZ - projectile.motionZ;
|
||||
// Test the UPCOMING movement so the barrier intercepts before entity
|
||||
// collision runs in updateProjectile().
|
||||
double nextX = projectile.posX + projectile.motionX;
|
||||
double nextY = projectile.posY + projectile.motionY;
|
||||
double nextZ = projectile.posZ + projectile.motionZ;
|
||||
|
||||
return isIncomingRay(
|
||||
nextX, nextY, nextZ,
|
||||
projectile.posX, projectile.posY, projectile.posZ,
|
||||
prevX, prevY, prevZ,
|
||||
projectile.getOwnerEntityId());
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user