Multi-world and portals
http://minecraft.gamepedia.com/Nether_portal
Is it related to http://wiki.vg/Protocol#World_Border ?
Anyway, it might be fun to try to make a portal, and make the player go to a serv.world2 when he goes in that.
It blows my mind how you work so much on Minecraft protocols yet don't play very much.
No, "World Border" has nothing to do with the nether portal.
http://wiki.vg/Protocol#Respawn is what you want. We'll need to send the new chunks for the world.
As a side note, I was thinking serv.world, serv.netherworld, and serv.endworld. Your "serv.world2" isn't very intuitive :P
@demipixel respawn is the packet to change world yes. I'm thinking about the purple thing in a portal. well my serv.world2 was because eventually I think serv.worlds would be the way to go.
It would be easy for any plugin to just make a new world (it wouldn't even have to be in serv.worlds) and move a player there, so it's not like all worlds would have to go in there.
The nether portal is actually just a block, and if a player stands in it for long enough (a few seconds, I don't exactly remember), they get sent to the nether. Easiest way to wait 5 seconds and then do something but cancel if they step out?
sure plugins could probably have their private worlds, but having a serv.worlds seem better to me.
Anyway, that doesn't matter too much, once the logic to change of world is implemented, using serv.worlds or serv.overworld / netherworld /... won't change much.
work begun there #80
multi-world is implemented.
Remaining here: implements the portals :D
http://minecraft.gamepedia.com/Nether_portal lot of edge cases, but the basic thing is:
- detect a portal has been built (add location to serv.overworldPortals)
- build the corresponding nether portal (add location to serv.netherPortals)
- detect when a player is in a portal (using serv.overworldPortals and serv.netherPortals)
- call changeWorld
- also detect destruction of portals and remove them from serv.overworldPortals and serv.netherPortals
It might be me, but unless these edge cases are easy to implement, it might be worth focussing on more important things for now like entities, fixing the position system, etc
Yeah probably, I was not saying we need to work on this right now :p
https://github.com/mhsjlw/flying-squid/pull/161 has implemented the basic frame detection and portal creation. Now remaining :
Missing with frame:
- [x] remove the portal when breaking a portal block
- [x] remove the portal when breaking an obsidian
Missing with teleportation:
- [x] store the portal location in a world.portals
- [ ] create a portal in the nether in the right location
- [ ] when going in the portal, teleport to the corresponding nether portal after 5s
It seems double portal (a portal stuck to an other one) are not always properly detected.
edit: seems fixed
This is already added, right?
No