Working on Portals, related questions - Printable Version +- Cuberite Forum (https://forum.cuberite.org) +-- Forum: Plugins (https://forum.cuberite.org/forum-1.html) +--- Forum: Plugin Discussion (https://forum.cuberite.org/forum-8.html) +--- Thread: Working on Portals, related questions (/thread-551.html) |
Working on Portals, related questions - Taugeshtu - 09-03-2012 Hi. Because ChestShop can't be done right now, I switched my attention at portals plugin. Idea is: you create a warp (exit) point, then you select an entrance volume using wooden sword, add some chat command magic and TADA - you got one-way portal, which could be used for both in-world and interworld travels. If you need two-way portal, you simply create warp points inside two entrances and link them cross-like. Right now I faced a problem: I can't get player's name inside OnBlockPlace() hook Simple code like this: Code: function OnBlockPlace(PacketData, Player) -- RIGHTCLICK! Code: -- Plugins/Portal/portal_main.lua:73: attempt to index local 'Player' (a number value) Whose fault it that and how to fix it? RE: Working on Portals, related questions - NiLSPACE - 09-03-2012 this is a bit off topic what i am gonna say (maybe) but you mean nether portals? RE: Working on Portals, related questions - xoft - 09-03-2012 The OnBlockPlace() callback has a completely different signature since the repacketing; I thought I've written that somewhere, but obviously I've forgotten. These are the signatures in C++, they should be directly equivalent to the callbacks (taken from cPlugin_NewLua.h, left out the C++ specifiers): Code: bool OnBlockDig (cPlayer * a_Player, int a_BlockX, int a_BlockY, int a_BlockZ, char a_BlockFace, char a_Status, BLOCKTYPE a_OldBlock, NIBBLETYPE a_OldMeta); RE: Working on Portals, related questions - Taugeshtu - 09-03-2012 Quote:you mean nether portals?No. Right now I don't feel like making them, but they'll be easy enough to implement once I'm done with this plugin. RE: Working on Portals, related questions - Taugeshtu - 09-03-2012 Woooooow. I found literally crazy bug! (r816) After I apply /ptoggle command (this enables point selection with a wooden sword) and select a region I can't enter any single command! I mean, I send them to chat window and they are gone, but I get no confirmation about the fact that they are accepted or executed. More than that, even usual chat messages can't be sent! That's totally weird. I upload an unfinished plugin in case someone needs to reproduce the bug. Just follow my steps: 1. Install plugin. You should know, how; 2. Launch MCS with it, connect to it (don't forget to give yourself a "portal.create" permission!); 3. Type in chat: "/ptoggle". You should get a message, saying that your wooden sword will now act as region selection tool; 4. Left-click on any block, right-click on any block; 5. You're here. Try to do ANYTHING chat-related - you won't get response. P.S. Looks like whenever I'm going with plugins - I got striked by lighting RE: Working on Portals, related questions - NiLSPACE - 09-03-2012 eh i don't have that bug :O i use R824 and i can chat and use commands when i did all the steps you did :O RE: Working on Portals, related questions - Taugeshtu - 09-03-2012 I'll wait for the fresh nightbuild, I guess... RE: Working on Portals, related questions - xoft - 09-03-2012 Sorry for the missing nightbuilds, the internet connection at my home died so my computer couldn't upload the nightbuilds. And I wasn't here to fix things until now. A fresh nightbuild is on its way. RE: Working on Portals, related questions - Taugeshtu - 09-03-2012 Yep, bug is still there, somehow... But now I was kicked for "[00:56:58] Unknown packet type 0x40 from client "Taugeshtu" @ 127.0.0.1" RE: Working on Portals, related questions - NiLSPACE - 09-03-2012 i had the unknown packet when i installed a smp mod in my client :O |