Repository navigation
Conversation
Implement boat state, buoyancy, controls, collisions, and water and land status handling with focused regression coverage.
Keep world-readiness and water-entry handling collision-safe while preserving vanilla land friction behavior for controlling players.
|
@sandexzx do you think that logic would work fine on newer versions as well? I don't see anything that would make it not run on like 1.21 so I think we can safely drop that part from the title of that PR |
|
thats a maintainer ask to not introduce breakages on other (mostly newer) versions |
|
/deploy |
Use consistent exclusive world-query bounds so an unused block layer above the boat does not unnecessarily pause simulation. Reuse the forward acceleration constant and remove unused underwater state while preserving vanilla movement values.
Add HorseState and HorsePhysics with vanilla-compatible movement, jump charging, collisions, fluid handling, and world readiness checks. Fix Mineflayer yaw conversion for horse movement and add focused unit coverage for movement, jumping, attributes, and unloaded chunks.
|
@sandexzx perfect, I think new minecart physics would be the last step (I think 1.21+ new physics should be used for porting, it should be compatible with some limitations with 1.17) Also don't forget to update pr title as it now add not only boat physics |
|
If minecart physics was done let's rename the pr |
|
that failing check looks like me potentially and yes, please change the name so I can keep track of what exactly is being merged. |
|
So does it look like it's not going to work on any other version besides 1.17.1? Is it gated? And what would need to be done for newer versions support? Just so we know |
|
Let's start finishing working on that |
I do not know whether or not it only works on this version, but that is not my responsibility as it has not been merged into my repository yet. I need linked files for each version physics are written for, and their differences. if there is an impl difference between 1.17 and 1.21, I need both instances covered + exact line/link references from source code to explain the change. that is why I merged #55 |
|
@GenerelSchwerz @zardoy — status update, and to set expectations: this PR is First, some context on scope. This PR was originally opened for one thing: On the version question (@zardoy): I haven't answered it until now because I Nothing in this PR is version-gated. It's a single implementation with no Reading my code against the vanilla source (rather than testing it), two things Boats look genuinely version-independent. The friction and buoyancy constants Horses have a real version difference. I read attributes by the keys On the multi-version documentation requirement (@GenerelSchwerz):
On timing — I want to be upfront. This work now spans four repos (this one, Thanks for the patience. |
|
No worries, I appreciate the effort. I personally don't have any concerns about time, that's more of a Zardoy issue. I personally care about multi version coverage more than anything else. I would honestly split individual features into separate PRs (boat, horse, minecart, etc) as this is growing into a monster PR. There is also the concern about boat's versioning support. Board were added all the way back in Alpha version 1.0.6. I don't expect you to review and support backwards to that point, but there is a clear difference between pre and post 1.9 boats. So 1.17 is not the actual cutoff point for support. It is my opinion that you focus solely on one feature and implement it fully, one at a time, rather than attempting to deliver everything at once. This is largely our fault for having this PR grow in scope so much, so I apologize. |
|
Having the chain work end-to-end is understandable, just know that I cannot merge this (or related future PRs) until proper multiversioning support is added. I do not mind waiting until you finish with mcraft.fun though. |
Since mcraft.fun depends on your physics version, it's not possible to test it until it's merged. @GenerelSchwerz Also about multiversion support: since some modules might be too complex to implement truly multiversional (like different implementations), why can't we gate these implementations eg by enabling them only on specific (supported) versions. This would also allow to split the work |
|
@sandexzx lets just merge it into https://github.com/zardoy/mineflayer-physics-utils and merge all other blocking prs (though I can also do it this weekend) |
|
I already merged #57 , this PR just needs the same formatting as that PR (no hardcoded values), and to have the outdated boat setup from this PR removed to prevent conflicts. |
This alreaady happens in the engines. Typically, changes are minor so multi-version is not an issue. If there are significant changes across versions then I understand--I simply haven't come across an update where that is the case. |
|
@sandexzx yeah let's remove at least already implemented boat support from here |
Add boat and horse physics
Context
This is the foundational physics PR for the controlled-vehicle implementation
(boats and ridden horses).
The existing entity physics did not model vanilla boat or horse behavior. Boats
need water-state detection, buoyancy, steering, land friction, and paddle state;
ridden horses need attribute-driven speed/jump, a jump-charge mechanic, ground
friction, and fluid handling. Both require dedicated, entity-specific simulation.
The horse movement matches the current (1.21.x) vanilla physics and behaves well
in testing. It is also intended to work on 1.17.
Implementation
Boats
BoatStatewith:BoatPhysicsbehavior for:Horses
HorseStatewith:(
generic.movement_speed,horse.jump_strength), with vanilla defaultsused until attributes arrive;
output) matching the vanilla charge-and-release curve;
reduced backward speed);
rebaseFromEntity/applyToEntitysync and world-readiness state.HorsePhysicsbehavior (extending the shared entity physics) for:and forward horizontal impulse when jumping while moving forward;
Shared / housekeeping
BoatPhysics,BoatState,BoatStatus,HorsePhysics, andHorseStatefrom the public package entry point.getPoseintoposes.tsand switch several cross-module imports totype-only to avoid circular-import issues introduced by the new states.
Testing
Focused unit coverage was added for:
buoyancy and water entry; acceleration, steering, and input release; paddle
states; shore collisions; stone versus ice friction; unloaded world data;
state cloning and mutable-state isolation.
charge-dependent vertical jump; forward jump impulse; repeated jumps after
landing; honey-block jump factor; attribute-driven speed and jump strength
(including modifier application without mutating the source); no sprint
multiplier; forward/backward/strafe movement; 1-block step-up; wall
collision; ice-vs-stone friction; world-readiness pausing;
rebaseFromEntitywithout corrupting jump charge; finite-state stability.
Related PRs
Scope
This PR provides the reusable boat and horse simulation only. Mineflayer
lifecycle, protocol packets, client integration, and rendering are handled in
the related PRs.
Minecart physics is intentionally not part of this PR. In our testing minecarts
already behave well through the existing generic entity-physics path, so no
changes were needed here. If review surfaces any issues, we'll look into them
and follow up with fixes.