Skip to content

Commit

Permalink
chore: added notes
Browse files Browse the repository at this point in the history
  • Loading branch information
SiverDX authored and TheBv committed Dec 26, 2023
1 parent 4cdebd6 commit 97ca823
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2964,7 +2964,7 @@ public void containerChanged(@NotNull Container invBasic) {
}
}

@Override
@Override // TODO :: Block collision performance impact (due to the multi-part entity)?
public @NotNull Vec3 handleRelativeFrictionAndCalculateMovement(@NotNull Vec3 pDeltaMovement, float pFriction) {
if (this.moveControl instanceof IafDragonFlightManager.PlayerFlightMoveHelper)
return pDeltaMovement;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -281,11 +281,11 @@ public void tick() {
float yawTurnHead = dragon.getYRot() + 90.0F;
speedModifier *= dragon.getFlightSpeedModifier();
speedModifier *= Math.min(1, dist / 50 + 0.3);//Make the dragon fly slower when close to target
double lvt_16_1_ = speedModifier * Mth.cos(yawTurnHead * 0.017453292F) * Math.abs((double) distX / dist);
double lvt_18_1_ = speedModifier * Mth.sin(yawTurnHead * 0.017453292F) * Math.abs((double) distZ / dist);
double lvt_20_1_ = speedModifier * Mth.sin(finPitch * 0.017453292F) * Math.abs((double) distY / dist);
double x = speedModifier * Mth.cos(yawTurnHead * 0.017453292F) * Math.abs((double) distX / dist);
double y = speedModifier * Mth.sin(finPitch * 0.017453292F) * Math.abs((double) distY / dist);
double z = speedModifier * Mth.sin(yawTurnHead * 0.017453292F) * Math.abs((double) distZ / dist);
double motionCap = 0.2D;
dragon.setDeltaMovement(dragon.getDeltaMovement().add(Math.min(lvt_16_1_ * 0.2D, motionCap), Math.min(lvt_20_1_ * 0.2D, motionCap), Math.min(lvt_18_1_ * 0.2D, motionCap)));
dragon.setDeltaMovement(dragon.getDeltaMovement().add(Math.min(x * 0.2D, motionCap), Math.min(y * 0.2D, motionCap), Math.min(z * 0.2D, motionCap)));
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ public boolean canUse() {
}
if (this.mob.getNavigation().isDone()) {
BlockPos vec3 = this.findWaterTarget();
if (vec3 != null) {
if (vec3 != null) { // TODO :: Performance impact
this.mob.getNavigation().moveTo(vec3.getX(), vec3.getY(), vec3.getZ(), 1.0);
return true;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1318,6 +1318,7 @@ protected boolean isPassable(final BlockState block, final BlockPos pos, final M
return true;
}

// TODO :: Expensive performance-wise
protected boolean isPassable(final BlockPos pos, final boolean head, final MNode parent) {
final BlockState state = world.getBlockState(pos);
final VoxelShape shape = state.getBlockSupportShape(world, pos);
Expand Down

0 comments on commit 97ca823

Please sign in to comment.