mirror of
https://github.com/KAMKEEL/CustomNPC-Plus.git
synced 2026-11-21 03:22:23 +00:00
Better Barrier Tracking
This commit is contained in:
1 parent
077fc3cb1d
commit
747918c4dc
3 files changed
+23
No files matched your search
@@ -130,6 +130,12 @@ public class EntityEnergyPanel extends EntityEnergyBarrier {
|
||||
double newZ = owner.posZ + (Math.cos(yawRad) * frontDist);
|
||||
|
||||
this.setPosition(newX, newY, newZ);
|
||||
|
||||
// Sync prevPos with owner's prevPos for smooth interpolation
|
||||
float prevYawRad = (float) Math.toRadians(owner.prevRotationYaw);
|
||||
this.prevPosX = owner.prevPosX + (-Math.sin(prevYawRad) * frontDist);
|
||||
this.prevPosY = owner.prevPosY + panelData.heightOffset + (owner.height * 0.5f);
|
||||
this.prevPosZ = owner.prevPosZ + (Math.cos(prevYawRad) * frontDist);
|
||||
}
|
||||
|
||||
private void updateLaunched() {
|
||||
@@ -296,6 +302,7 @@ public class EntityEnergyPanel extends EntityEnergyBarrier {
|
||||
for (EntityLivingBase ent : entities) {
|
||||
if (ent.getEntityId() == ownerEntityId) continue;
|
||||
if (!isKnockbackTarget(ent)) continue;
|
||||
if (isAllyOfOwner(ent)) continue;
|
||||
|
||||
// Transform entity position to panel-local space
|
||||
double dx = ent.posX - posX;
|
||||
|
||||
Reference in new issue
Block a user