
Rule `optimizedFastEntityMovement` and Lithium cause a regression case
VelizarBG opened this issue ยท 10 comments
Bug description
When optimizedFastEntityMovement
(oFEM) is enabled and Lithium is present, TNT (and potentially other entities) in specific circumstances will not perform a proper collision scan and will end up colliding with blocks that are not in the path of its trajectory.
Demonstration video: https://youtu.be/_a4Lg6qfDbk
Steps to reproduce
- Ensure your game has TIS and Lithium.
- Import and join the provided world.
- Use the provided command blocks to observe the behavior of the spawned TNT when oFEM is on/off.
Expected behavior
The TNT should behave as if it collided with the block above it.
Actual behavior
The TNT behaves as if it collided with the block a chunk away that's not actually in its way.
Relevant logs
No response
Minecraft version
1.21.1
Carpet TIS Addition version
1.65.2
Fabric Carpet version
1.4.147
Other information
Lithium version: 0.14.8
Check list
- I have verified that the issue persists in the latest version of the mod.
- I have searched the existing issues and confirmed that this is not a duplicate.
A more simple reproduce method:
/setblock 15 10 15 minecraft:obsidian
/setblock 31 3 16 minecraft:obsidian
/summon tnt 15.5 1.0 15.9 {Motion:[0.0, 10.0, 0.0], fuse:1}
Observe the explosion y position of the TNT with /log explosions
/carpet optimizedFastEntityMovement true
: y=2.0812 (bad)/carpet optimizedFastEntityMovement false
: y=9.0812 (good)
lithium's net.caffeinemc.mods.lithium.common.entity.movement.ChunkAwareBlockCollisionSweeper
with hideLastCollision=false
will return the wrong obsidian in the result, which is suspicious
You can test with
mixin.entity.collisions.movement=false
in the lithium.properties file in the config folder
By setting mixin.entity.collisions.movement=false
, lithium's entity collision mixin won't apply, so Carpet TIS Addition will fall back to the vanilla mixin implementations, not using lithium's codes at all
So yeah this is a temp workaround to bypass this issue, but it still does not truly fix the issue. To truly fix this issue, we need to either:
a) Modify the usage of the ChunkAwareBlockCollisionSweeper
in Carpet TIS Addition, don't use the hideLastCollision=false
mode
b) Wait until lithium "fixes" the strange behavior of the ChunkAwareBlockCollisionSweeper
You can test with mixin.entity.collisions.movement=false
in the lithium.properties file in the config folder
@VelizarBG The issue seems to be fixed with the latest lithium dev build. There's no more issue with the wdl you provided in this issue. You can have a try with https://github.com/CaffeineMC/lithium/actions/runs/13618361439 (mc1.21.4 btw)
I tested in 1.21 using this build of Lithium and everything is working as expected. Thanks a ton for looking into and taking care of this, guys!
I'm leaving this issue open until the new version of Lithium is officially released.
I'm leaving this issue open until the new version of Lithium is officially released.
https://github.com/CaffeineMC/lithium/releases/tag/mc1.21.4-0.15.0