add player compatibility api (#41)

This commit is contained in:
wsor4035
2024-09-08 18:01:52 -04:00
committed by GitHub
parent 931a16803e
commit b18dc7ba14
10 changed files with 210 additions and 12 deletions

13
doc/player.md Normal file
View File

@ -0,0 +1,13 @@
# Player API
mimic mtg player_api
## NOTE
`xcompat.player.player_attached`
read/write from it is fine, looping over it is not as it is a proxy table. this
would need lua5.2 __pairs/__ipairs metamethods support which i could polyfill
for using https://stackoverflow.com/a/77354254 but didnt feel like doing at
this time. (luajit supports this via 5.2 extensions). additionally see issue:
https://github.com/minetest/minetest/issues/15133