You should update the API documentation
#1
My plugin became broken and it took me quite a while to figure this out, because for some reason in some recent update you changed the behaviour of some funcions in the API - some of the hooks no longer send Cursor coordinates and BlockFace data (what was that anyways?Big Grin), so the important data BlockType and BlockMeta now don't have index 9 and 10 in the argument list, but now they have 5 and 6, so the plugins using a callback function like this:
Code:
function OnPlayerPlacedBlock(Player, BlockX, BlockY, BlockZ, BlockFace, CursorX, CursorY, CursorZ, BlockType, BlockMeta)
no longer get any BlockType and BlockMeta data (as they are nil) and the BlockFace and CursorX vars are nonsense (they carry the BlockType and BlockMeta values).

The main problem as I see it is a not up-to-date documentation of the API, multiplying the confusion caused by this (see this page http://mc-server.xoft.cz/LuaAPI/OnPlayer...Block.html ).

Please do update the documentation and state the changes made clearly and somewhere visible. Thank you!

If you have stated this and I just overlooked, I apologise, but still it would be a nice thing to have the documentation OK as it is the first place I think most people will look first.
Reply
Thanks given by:
#2
Ahoj Smile

Yes, the cursor coords and blockface is no longer sent to the OnPlayerPlacingBlock and OnPlayerPlacedBlock hooks. The change has been made about a month ago, and has been the result of this forum discussion:
https://forum.cuberite.org/showthread.php?tid=1664

I didn't find your plugin online, so it's not listed in the list of plugins that I investigated. Sorry about that.

Basically, the change allows us to call the hooks for blocks being placed indirectly - as part of larger structures, such as doors and beds. The Cursor coords and BlockFace are sent by the client when placing the block, they basically tell you which part of the block the player has rclked.
Reply
Thanks given by:
#3
API docs updated. They were updated in the repo, just not on the web.
Reply
Thanks given by:
#4
Čau!

How come you didn't find my plugin online? It was posted in this forum in (I hope) the right place and you responded to the post many times Smile https://forum.cuberite.org/showthread.ph...light=GPIO
If there is any other place I am supposed to post my plugin, please let me know! Anyway there is a link to github ( https://github.com/matemat13/MCserver-RaspberryGPIO ) in the post.

Where can I find the API docs in the repo? I was looking for it so that the next time I can look there directly, but I found only what seems to be a docs generator ( https://github.com/mc-server/MCServer/tree/master/docs ).

Thanks for your prompt reply - I hope the development is going well Smile I have played with the GPIO in MC the last afternoon after a long time and noticed some new stuff (like horses, droppers, some new blocks etc.) and also that the server spawns a LOT of creepersBig Grin It is nice to see you implementing new stuff and keeping up with MC!
Reply
Thanks given by:
#5
You can find the API docs here: http://mc-server.xoft.cz/LuaAPI/
Reply
Thanks given by:
#6
I was doing a google search for the specific hook name and for some reason it failed to include your plugin. And I've been keeping way too many things in my head so I didn't remember at the time.

The API docs are generated by the APIDump plugin ( https://github.com/mc-server/MCServer/tr...ns/APIDump ) - it reads the actual available API and maps it to the documentation that is provided in a form of Lua tables. Once you load the plugin, issue the "api" console command and the documentation will be generated in HTML form in the "API" subfolder next to the MCS executable. I have a script that does exactly this and then uploads the results to the web; I reinstalled my computer so I forgot to add that script to a regular scheduler. I might do it as a Jenkins job instead, so that the documentation is updated after each official build.
Reply
Thanks given by:
#7
Cool, thanks! That is quite useful Smile

I don't think it is your responsibility to keep the plugins using certain updated hooks working - that should be the specific plugin creators responsibility to maintain it, but it would be nice to clearly state the changes in API which might break someones plugin, although that is a bonus as well... I was just surprised that you didn't find my plugin when you were looking for it, because I thought I did what I could to make it visible Smile
Reply
Thanks given by:




Users browsing this thread: 1 Guest(s)