Skip to content

Commit

Permalink
Fixed passable leaves not slowing down fall
Browse files Browse the repository at this point in the history
  • Loading branch information
supermassimo committed Dec 10, 2024
1 parent 5cfa443 commit a15d0b0
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -364,7 +364,7 @@ public void entityInside(BlockState state, Level level, BlockPos pos, Entity ent
if (isMovementVanilla() || isEntityPassable(entity)) {
super.entityInside(state, level, pos, entity);
} else {
if (entity.getDeltaMovement().y < 0.0D && entity.fallDistance < 2.0f) {
if (entity.getDeltaMovement().y < 0.0D && (isLeavesPassable() || entity.fallDistance < 2.0f)) {
entity.fallDistance = 0.0f;
entity.setDeltaMovement(entity.getDeltaMovement().x, entity.getDeltaMovement().y * 0.5D, entity.getDeltaMovement().z); // Slowly sink into the block
} else if (!isLeavesPassable() && entity.getDeltaMovement().y > 0 && entity.getDeltaMovement().y < 0.25D) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ public class DTConfigs {
SERVER_BUILDER.pop();

SERVER_BUILDER.comment("Interaction Settings").push("interaction");
IS_LEAVES_PASSABLE = SERVER_BUILDER.comment("If enabled all leaves will be passable").
IS_LEAVES_PASSABLE = SERVER_BUILDER.comment("If enabled all leaves will be passable. If the Passable Foliage mod is installed this config is overridden").
define("isLeavesPassable", false);
VANILLA_LEAVES_COLLISION = SERVER_BUILDER.comment("If enabled player movement on leaves will not be enhanced").
define("vanillaLeavesCollision", false);
Expand Down

0 comments on commit a15d0b0

Please sign in to comment.