Skip to content

Commit

Permalink
refactor: remove fat-aabb-margin and stepping-offset fields from …
Browse files Browse the repository at this point in the history
…server settings as these properties shouldn't be touched by users
  • Loading branch information
smartcmd committed Dec 30, 2024
1 parent 009c787 commit cdcb3c4
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 13 deletions.
7 changes: 5 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,13 @@ Unless otherwise specified, any version comparison below is the comparison of se

### Changed

- (API) Removed `BlockFace#getBlockFaceByStairDirectionValue` method, some fields in `VoxelShapes` are also private for
better
maintainability now.
- (API) Remove `fat-aabb-margin` and `stepping-offset` fields from server settings as these properties shouldn't be
touched by users.
- Introduced tag name constants for where a large number of NBT saving and reading are involved. This improved the
maintainability of the project.
- Removed `BlockFace#getBlockFaceByStairDirectionValue` method, some fields in `VoxelShapes` are also private for better
maintainability now.

### Fixed

Expand Down
7 changes: 0 additions & 7 deletions api/src/main/java/org/allaymc/api/server/ServerSettings.java
Original file line number Diff line number Diff line change
Expand Up @@ -223,17 +223,10 @@ public static class PhysicsEngineSettings extends OkaeriConfig {
@CustomKey("motion-threshold")
private float motionThreshold = 0.003f;

@Comment("Walk assist offset")
@CustomKey("stepping-offset")
private float steppingOffset = 0.05f;

@Comment("This usually determines how quickly an entity item is moved when getting stuck in a block")
@CustomKey("block-collision-motion")
private float blockCollisionMotion = 0.2f;

@CustomKey("fat-aabb-margin")
private float fatAABBMargin = 0.0005f;

@Comment("Delta move packet will reduce the network pressure if there are a lot of entities")
@CustomKey("use-delta-move-packet")
private boolean useDeltaMovePacket = false;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,10 +55,10 @@ public class AllayEntityPhysicsService implements EntityPhysicsService {
public static final FloatBooleanImmutablePair EMPTY_FLOAT_BOOLEAN_PAIR = new FloatBooleanImmutablePair(0, false);

public static final float MOTION_THRESHOLD;
public static final float STEPPING_OFFSET;
public static final float FAT_AABB_MARGIN;
public static final float BLOCK_COLLISION_MOTION;

private static final float STEPPING_OFFSET = 0.05f;
private static final float FAT_AABB_MARGIN = 0.0005f;
private static final float MOMENTUM_FACTOR = 0.91f;
private static final float GROUND_VELOCITY_FACTOR = 0.1f;
private static final float AIR_VELOCITY_FACTOR = 0.02f;
Expand All @@ -75,8 +75,6 @@ public class AllayEntityPhysicsService implements EntityPhysicsService {
static {
var settings = Server.SETTINGS.entitySettings().physicsEngineSettings();
MOTION_THRESHOLD = settings.motionThreshold();
STEPPING_OFFSET = settings.steppingOffset();
FAT_AABB_MARGIN = settings.fatAABBMargin();
BLOCK_COLLISION_MOTION = settings.blockCollisionMotion();
}

Expand Down

0 comments on commit cdcb3c4

Please sign in to comment.