stackotter / delta-client

An open source Minecraft Java Edition client built for speed.
https://deltaclient.app
GNU General Public License v3.0
322 stars 33 forks source link

Implement autojump, ladders and stair/half slab climbing #124

Open stackotter opened 1 year ago

stackotter commented 1 year ago

If you fix this issue it'll give you a good introduction to the client's ECS-based physics system.

All three of these tasks are pretty inter-related (especially the first and last). That's why I have grouped them together.

At the moment, if the player comes up against the side of a block they stop. However, if the block's top is only half a block higher than the player's current position they should be bumped up half a block so that they end up on the block (or something like that at least) and if the block is a ladder they should be given some upwards velocity to start climbing it, and if they have auto jump and the vertical distance to the top of the block is a block or less they should auto jump. That's the gist of it anyway, I don't exactly remember the specifics so it'd be best to check for yourself.

To investigate how each of these is implemented by vanilla, you can decompile vanilla using MCPReborn or the Yarn project, but please try your best to not just copy their implementation, because it's probably bad and it might not fit into the ECS very well. You'll want to probably put auto jump logic into the PlayerJumpSystem and ladder climbing logic into the PlayerVelocitySystem.

Feel free to ask for help on the Discord server because I do have some notes about the vanilla physics system which might be useful.

stackotter commented 1 year ago

I've implementing autostepping now (stair/half slab/carpet/etc climbing). Now just ladders and autojump to go.

stackotter commented 1 year ago

I've also implemented ladder climbing now.

TODO: Open trapdoors at the top of ladders should act like an extension of the ladder just like in 1.16.1 vanilla

jxhug commented 1 year ago

wait. if you go up a ladder with a trapdoor it'll autoopen??? how did i not know this LOL

stackotter commented 1 year ago

nah, a trapdoor above a ladder just gets treated as if it’s a ladder if it’s open, so that you can climb it.

jxhug commented 1 year ago

lol I didn’t even know that, ty

stackotter commented 1 year ago

Finished implementing climbing (vines, nether biome vines, and open trapdoors at the top of ladders)