sablewaves-2.25.1.jar
Curse Maven Snippet
What's new
2.25.1 — sorry about the flying boats
kokokoz found this within hours of 2.25.0 going up: empty boats get launched into the air and then hover there. fixed.
and it's a good report, because they included the bit that actually cracked it. not just "launched" "even floats". a boat that gets shoved once and comes back down is a stray force. a boat that goes up and then stays up means something is holding it there, which is a completely different bug and points straight at the target being in the wrong place.
what it was doing
the bob is a spring. it pulls the boat towards where the sea surface is. fine.
it worked out where the sea surface is like this:
floor(boat's own Y) + 0.885
it asked the boat where the sea was.
so: boat drifts up a little. crosses a block boundary. floor() ticks over. the target the boat is being pulled towards jumps a whole block upward. that pulls harder. boat crosses the next boundary. target jumps again.
i ran it:
| time | boat Y |
|---|---|
| start | 62.9 |
| 1 second | 64.0 |
| 2 seconds | 66.7 |
| 3 seconds | 70.2 |
seven blocks in three seconds, and it doesn't stop, and it never comes down, because the target is permanently above it. exactly what kokokoz described.
it's older than 2.25.0
i want to be straight about this. i ran the same test against 2.23.2 and 2.24.0 and both launch the boat to the identical decimal place. this bug is as old as the boat code.
what changed yesterday isn't the bug, it's that anyone could see it. until 2.25.0 the boat physics never reached the boat you were sitting in, so nobody had any reason to look at boats at all, let alone an empty one bobbing about in the distance.
so if you've ever wondered why a boat you left somewhere ended up on a hill: that was me.
the fix
look for the water instead of asking the boat.
walk down from just above the boat and take the first water block whose neighbour above isn't also water. that's the surface, by definition. it's a fact about the world rather than a fact about the boat, so the target can't follow the boat, so there's nothing left to run away with.
plus one guard: a boat already more than 1.5 blocks clear of the water gets left alone for gravity to deal with, rather than being hauled anywhere by me.
one class changed. nothing else in the jar touched.
and the bug is now a test
BoatBobCheck asserts two things: that the old boat-derived target does run away, and that the anchored one doesn't — across wave heights from flat calm up to three blocks, over thirty simulated seconds.
keeping the broken version around as a test feels odd but it's the point. the fix is one line and it would be very easy for a future me to "simplify" it straight back into a ratchet. now that fails loudly instead of quietly relocating everyone's boats.
thanks kokokoz. within hours, and with the one detail that mattered.
This mod has no additional files

