mirror of
https://github.com/EssentialsX/Essentials.git
synced 2025-01-23 00:21:26 +01:00
Clear the player reference on logout so it's refreshed upon a reconnect.
This commit is contained in:
parent
06247732da
commit
78d4987d5d
@ -256,6 +256,10 @@ public class User extends DataUnit implements Cloneable {
|
||||
}
|
||||
}
|
||||
|
||||
public void clearPlayer() {
|
||||
bukkitPlayer = null;
|
||||
}
|
||||
|
||||
public User updatePlayer(Player player) {
|
||||
|
||||
if (player != null) {
|
||||
|
@ -31,6 +31,7 @@ import java.util.Set;
|
||||
import java.util.WeakHashMap;
|
||||
|
||||
import org.anjocaido.groupmanager.GroupManager;
|
||||
import org.anjocaido.groupmanager.data.User;
|
||||
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.entity.Player;
|
||||
@ -441,6 +442,10 @@ public class BukkitPermissions {
|
||||
|
||||
Player player = event.getPlayer();
|
||||
|
||||
User user = plugin.getWorldsHolder().getWorldData(player.getWorld().getName()).getUser(player.getName());
|
||||
if (user != null)
|
||||
user.clearPlayer();
|
||||
|
||||
/*
|
||||
* force remove any attachments as bukkit may not
|
||||
*/
|
||||
@ -454,6 +459,10 @@ public class BukkitPermissions {
|
||||
return;
|
||||
|
||||
Player player = event.getPlayer();
|
||||
|
||||
User user = plugin.getWorldsHolder().getWorldData(player.getWorld().getName()).getUser(player.getName());
|
||||
if (user != null)
|
||||
user.clearPlayer();
|
||||
|
||||
/*
|
||||
* force remove any attachments as bukkit may not
|
||||
|
Loading…
Reference in New Issue
Block a user