daemongaming / GateNetwork

A Minecraft plugin for multiworld portals with support for multiple servers.
GNU General Public License v3.0
1 stars 0 forks source link

Going from Server A to B and back can cause player to be vaporized #1

Closed daemongaming closed 6 months ago

daemongaming commented 6 months ago

Going from Server A to Server B, then immediately dialing Server A back up and going through can cause the player to be vaporized in the wormhole on the destination side.

daemongaming commented 6 months ago

Suspected issue: when joining Server A again, the player's last location will be in the event horizon of the wormhole until the plugin is able to teleport them to the proper destination (not in the event horizon of the wormhole).

daemongaming commented 6 months ago

Solution: on PlayerJoinEvent, add the player to the travelers list, and remove them when the checks are done (near the end of the event). This prevents the wormhole from vaporizing the player since it checks the travelers list first.

For future reference: if you're trying to prevent players from being subjected to a mechanic before they can be moved/manipulated by the plugin, add them to a cooldown list and check if they're on that list when the mechanic's method fires. Remove them when you've finished manipulating the player, either manually or with a delayed BukkitScheduler task.