Fabricio20 / HubBasics

Bukkit Plugin For Hub Owners
GNU Lesser General Public License v3.0
22 stars 11 forks source link

JoinTP bugs #131

Open nicegamer7 opened 4 years ago

nicegamer7 commented 4 years ago

The JoinTP module has some issues.

  1. Whenever a player joins, since the event isn't aynchronus, everyone experiences a bit of lag.
  2. If the player left the server on a different world than the one they are set to spawn on, they won't be able to see other players when they join.

For Issue 1, I beleive this can be remedied by making the org.spigotmc.event.player.PlayerSpawnLocationEvent event.

Thanks.

Fabricio20 commented 4 years ago

Hey there, thanks for the suggestion, I'll look into these. I do have one question:

What do you mean on 2?

they won't be able to see other players when they join.

If you get teleported to say, world Lobby on join, you will see the players in the Lobby world, not sure exactly what you mean there.

nicegamer7 commented 4 years ago

Sorry 2 isn't very clear. I'll make an example.

Let's say I have two worlds, world1 and world2. And the JoinTP module is set globally to teleport to 0,0,0 on world1. So a player leaves the server on world2, and rejoins, so they are teleported to 0,0,0 on world1. However, if there are other players there, they can't see them.

I have a feeling using the Spigot event might fix this too.

nicegamer7 commented 4 years ago

Just going to add, if the player left the server on world1, this doesn't happen.

I had a glance at the code and it seems relatively straightforward, which is why I believe it might be an issue with the event and not with the plugin.

nicegamer7 commented 4 years ago

I do have a relevent timings reading for #1: https://timings.aikar.co/?id=f8e590474bee4937922ba3bd9ed9628c

However, even after disabling the module, we still occasionally get lag when a player joins. So it's not too clear if there is a conflict or another plugin is misbehaving.

Fabricio20 commented 4 years ago

I've pushed the suggested changes to master, doing a release now. Let me know if it helps!