mirror of
https://github.com/KAMKEEL/CustomNPC-Plus.git
synced 2026-11-18 10:19:08 +00:00
Refactor mount helpers and expose NPC flight state
This commit is contained in:
1 parent
6c84263769
commit
9744209938
31 files changed
+821
-305
No files matched your search
@@ -45,6 +45,7 @@ public abstract class EntityNPCFlying extends EntityNPCInterface {
|
||||
if (handleMountedMovement(p_70612_1_, p_70612_2_))
|
||||
return;
|
||||
if (!this.canFly() || this.hurtTime != 0 || !this.canBreathe()) {
|
||||
setNpcFlyingState(false);
|
||||
super.moveEntityWithHeading(p_70612_1_, p_70612_2_);
|
||||
return;
|
||||
}
|
||||
@@ -66,11 +67,13 @@ public abstract class EntityNPCFlying extends EntityNPCInterface {
|
||||
if (!this.getNavigator().noPath() && this.motionY > 0) {
|
||||
this.motionY = 0;
|
||||
} else {
|
||||
setNpcFlyingState(false);
|
||||
super.moveEntityWithHeading(p_70612_1_, p_70612_2_);
|
||||
return;
|
||||
}
|
||||
}
|
||||
this.flyLimitAllow = true;
|
||||
setNpcFlyingState(true);
|
||||
|
||||
double d3 = this.motionY;
|
||||
super.moveEntityWithHeading(p_70612_1_, p_70612_2_);
|
||||
@@ -97,9 +100,10 @@ public abstract class EntityNPCFlying extends EntityNPCInterface {
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void doMountedMovement(float strafe, float forward, float moveSpeed) {
|
||||
public void performMountedMovement(float strafe, float forward, float moveSpeed) {
|
||||
if (!this.canFly() || this.hurtTime != 0 || !this.canBreathe()) {
|
||||
super.doMountedMovement(strafe, forward, moveSpeed);
|
||||
setNpcFlyingState(false);
|
||||
super.performMountedMovement(strafe, forward, moveSpeed);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -120,14 +124,16 @@ public abstract class EntityNPCFlying extends EntityNPCInterface {
|
||||
if (!this.getNavigator().noPath() && this.motionY > 0) {
|
||||
this.motionY = 0;
|
||||
} else {
|
||||
super.doMountedMovement(strafe, forward, moveSpeed);
|
||||
setNpcFlyingState(false);
|
||||
super.performMountedMovement(strafe, forward, moveSpeed);
|
||||
return;
|
||||
}
|
||||
}
|
||||
this.flyLimitAllow = true;
|
||||
setNpcFlyingState(true);
|
||||
|
||||
double d3 = this.motionY;
|
||||
super.doMountedMovement(strafe, forward, moveSpeed);
|
||||
super.performMountedMovement(strafe, forward, moveSpeed);
|
||||
this.motionY = d3;
|
||||
|
||||
if (this.getNavigator().noPath()) {
|
||||
|
||||
Reference in new issue
Block a user