mirror of
https://github.com/BentoBoxWorld/BentoBox.git
synced 2024-11-01 00:10:40 +01:00
Clear user cache on login.
Fixes https://github.com/BentoBoxWorld/BentoBox/issues/1341 Server calls PlayerTeleportEvent if player is mounted on quit, which inserts player back into cache. By clearing the cache on login, the stale player object will be cleared.
This commit is contained in:
parent
4a3c9ad8ae
commit
2c004ce504
@ -44,13 +44,15 @@ public class JoinLeaveListener implements Listener {
|
|||||||
|
|
||||||
@EventHandler(priority = EventPriority.NORMAL, ignoreCancelled = true)
|
@EventHandler(priority = EventPriority.NORMAL, ignoreCancelled = true)
|
||||||
public void onPlayerJoin(final PlayerJoinEvent event) {
|
public void onPlayerJoin(final PlayerJoinEvent event) {
|
||||||
|
// Remove them from the cache, just in case they were not removed for some reason
|
||||||
|
User.removePlayer(event.getPlayer());
|
||||||
|
|
||||||
User user = User.getInstance(event.getPlayer());
|
User user = User.getInstance(event.getPlayer());
|
||||||
if (user == null || user.getUniqueId() == null) {
|
if (user == null || user.getUniqueId() == null) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
UUID playerUUID = user.getUniqueId();
|
UUID playerUUID = user.getUniqueId();
|
||||||
|
|
||||||
|
|
||||||
// Check if player hasn't joined before
|
// Check if player hasn't joined before
|
||||||
if (!players.isKnown(playerUUID)) {
|
if (!players.isKnown(playerUUID)) {
|
||||||
firstTime(user);
|
firstTime(user);
|
||||||
|
Loading…
Reference in New Issue
Block a user