ValkyrienSkies / Valkyrien-Skies

Moving structures powered by a custom multi-threaded physics engine; in Minecraft.
https://valkyrienskies.org/
Apache License 2.0
161 stars 40 forks source link

Collision bugs and possible way to fix it #500

Open Ranpoes opened 3 years ago

Ranpoes commented 3 years ago

As the picture shows , the collision may detect the block under the ground without any blocks' connection and made them as one BIG ship (combining the water, lava, blocks form other mods, etc) . Its quite common to happen in the server when there are lots of entities (especially with many players around the ship), which cause the low TPS. 2021-05-16_20 08 01 2021-05-16_20 08 32

I just add the limitation of the Y-axis in the implement of .class tryExpanding and it seems to work fine, which let the blocks under 58 can't be constructed.

protected void tryExpanding(int x, int y, int z, int hash) { if (isValidExpansion(x, y, z) && y > 58) { // totalCalls++; if (!foundSet.contains(hash) && (foundSet.size() + nextQueue.size() < maxSize)) { nextQueue.add(hash); } } }