flying-squid icon indicating copy to clipboard operation
flying-squid copied to clipboard

Multi-world and portals

Open rom1504 opened this issue 10 years ago • 13 comments

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.

rom1504 avatar Oct 13 '15 23:10 rom1504

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 avatar Oct 14 '15 00:10 demipixel

@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.

rom1504 avatar Oct 14 '15 00:10 rom1504

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?

demipixel avatar Oct 14 '15 01:10 demipixel

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.

rom1504 avatar Oct 14 '15 01:10 rom1504

work begun there #80

rom1504 avatar Oct 14 '15 17:10 rom1504

multi-world is implemented.

Remaining here: implements the portals :D

rom1504 avatar Oct 25 '15 23:10 rom1504

http://minecraft.gamepedia.com/Nether_portal lot of edge cases, but the basic thing is:

  1. detect a portal has been built (add location to serv.overworldPortals)
  2. build the corresponding nether portal (add location to serv.netherPortals)
  3. detect when a player is in a portal (using serv.overworldPortals and serv.netherPortals)
  4. call changeWorld
  5. also detect destruction of portals and remove them from serv.overworldPortals and serv.netherPortals

rom1504 avatar Oct 25 '15 23:10 rom1504

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

demipixel avatar Oct 26 '15 00:10 demipixel

Yeah probably, I was not saying we need to work on this right now :p

rom1504 avatar Oct 26 '15 01:10 rom1504

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

rom1504 avatar Dec 14 '15 18:12 rom1504

It seems double portal (a portal stuck to an other one) are not always properly detected.

edit: seems fixed

rom1504 avatar Dec 14 '15 21:12 rom1504

This is already added, right?

BasToTheMax avatar Jun 01 '22 18:06 BasToTheMax

No

rom1504 avatar Jun 01 '22 19:06 rom1504