mirror of
https://github.com/KAMKEEL/CustomNPC-Plus.git
synced 2026-11-12 17:47:32 +00:00
Anchor Point Helper Eye - Item Staff Fixes
This commit is contained in:
1 parent
8b1ef36dc5
commit
2f1e67660d
2 files changed
+9
-2
No files matched your search
@@ -75,7 +75,9 @@ public class AnchorPointHelper {
|
||||
float anchorZ = anchorData.anchorOffsetZ;
|
||||
|
||||
double x = entity.posX;
|
||||
double y = entity.posY + getClientPlayerYCorrection(entity);
|
||||
// EYE uses getEyeHeight() which already gives the correct offset from posY,
|
||||
// so the client player correction would double-subtract and place it at feet level
|
||||
double y = entity.posY + (anchor == AnchorPoint.EYE ? 0 : getClientPlayerYCorrection(entity));
|
||||
double z = entity.posZ;
|
||||
|
||||
float headYaw = (float) Math.toRadians(entity.rotationYawHead);
|
||||
|
||||
@@ -65,6 +65,11 @@ public class ItemStaff extends ItemNpcInterface implements IProjectileCallback {
|
||||
|
||||
EntityAbilityOrb orb = (EntityAbilityOrb) entity;
|
||||
|
||||
if (orb.getChargeProgress() < 1.0f) {
|
||||
orb.setDead();
|
||||
return;
|
||||
}
|
||||
|
||||
orb.startMoving(null);
|
||||
|
||||
world.playSoundAtEntity(
|
||||
@@ -127,7 +132,7 @@ public class ItemStaff extends ItemNpcInterface implements IProjectileCallback {
|
||||
);
|
||||
|
||||
orb.setupCharging(
|
||||
new EnergyAnchorData(AnchorPoint.FRONT, 0, -1, 0),
|
||||
new EnergyAnchorData(AnchorPoint.EYE, 0, 0, 1),
|
||||
chargeTime
|
||||
);
|
||||
|
||||
|
||||
Reference in new issue
Block a user