Skip to content

Commit

Permalink
Implement serverAiStep
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexProgrammerDE committed Nov 22, 2024
1 parent ee85551 commit 37cef06
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ public void aiStep() {
this.xxa = 0.0F;
this.zza = 0.0F;
} else if (this.isEffectiveAi()) {
// this.serverAiStep(); // TODO
this.serverAiStep();
}

if (this.jumping && this.isAffectedByFluids()) {
Expand Down Expand Up @@ -174,6 +174,9 @@ public void aiStep() {
// this.pushEntities(); // TODO
}

protected void serverAiStep() {
}

protected void removeFrost() {
var speedAttribute = this.attributeState().getOrCreateAttribute(AttributeType.MOVEMENT_SPEED);
if (speedAttribute != null) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -216,6 +216,16 @@ public void aiStep() {
}
}

@Override
public void serverAiStep() {
super.serverAiStep();
if (this.isControlledCamera()) {
this.xxa = this.input.leftImpulse;
this.zza = this.input.forwardImpulse;
this.jumping = this.input.keyPresses.jump();
}
}

private boolean canStartSprinting() {
return !this.isSprinting()
&& this.hasEnoughImpulseToStartSprinting()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,13 @@ public void aiStep() {
}
}

@Override
protected void serverAiStep() {
super.serverAiStep();

// TODO: yHeadRot important here?
}

protected void updatePlayerPose() {
if (this.canPlayerFitWithinBlocksAndEntitiesWhen(Pose.SWIMMING)) {
Pose mainPose;
Expand Down

0 comments on commit 37cef06

Please sign in to comment.