-
Notifications
You must be signed in to change notification settings - Fork 10
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
rewrite bed compat code #81
base: master
Are you sure you want to change the base?
Conversation
Sure, go ahead 😉 My code was just quickly hacked together, I was planning on rewriting/simplifying it anyway. |
The sleeping position has changed in minetest/minetest_game@9bf64b6, but just setting I solved this on my server by just rounding down if sleep_pos.x == player_pos.x and
math.floor(sleep_pos.y) == math.floor(player_pos.y) and
sleep_pos.z == player_pos.z then
[...] This conveniently also keeps backwards compatibility with the old sleeping positions. |
At this sate it seems to work. |
This PR rewrites the
beds
compatiibilty code to the new movenode-definition and callback system (see here: https://github.com/mt-mods/jumpdrive#movenode-compatibility and here: https://github.com/mt-mods/jumpdrive#hooks)The new API removes lots of duplicate and expensive calls to
minetest.find_nodes_in_area
and should make jumping faster in general while also providing a generic way to listen to movement events.I ended up rewriting larger portions of the code you made @tuedel (sorry 😋)
Let me know if you have issues/suggestions with the way it is now
The new file is best viewed standalone and not as diff:
https://github.com/mt-mods/jumpdrive/blob/bed-compat-ng/compat/beds.lua
NOTE: this isn't tested yet, only a first draft