mirror of
https://github.com/essentials/Essentials.git
synced 2025-08-27 00:15:23 +02:00
Fix attachments not being reset between worlds.
This commit is contained in:
@@ -2208,18 +2208,18 @@ public class GroupManager extends JavaPlugin {
|
||||
if (players.isEmpty()) {
|
||||
// Check for an offline player (exact match).
|
||||
if (Arrays.asList(this.getServer().getOfflinePlayers()).contains(Bukkit.getOfflinePlayer(playerName))) {
|
||||
match.add(Bukkit.getOfflinePlayer(playerName).getUniqueId().toString());
|
||||
match.add(Bukkit.getOfflinePlayer(playerName).getName()); //.getUniqueId().toString());
|
||||
} else {
|
||||
// look for partial matches
|
||||
for (OfflinePlayer offline : this.getServer().getOfflinePlayers()) {
|
||||
if (offline.getName().toLowerCase().startsWith(playerName.toLowerCase()))
|
||||
match.add(offline.getUniqueId().toString());
|
||||
match.add(offline.getName()); //.getUniqueId().toString());
|
||||
}
|
||||
}
|
||||
|
||||
} else {
|
||||
for (Player player : players) {
|
||||
match.add(player.getUniqueId().toString());
|
||||
match.add(player.getName()); //.getUniqueId().toString());
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -139,7 +139,6 @@ public class WorldDataHolder {
|
||||
|
||||
// No user account found so create a new one.
|
||||
User newUser = createUser(userId);
|
||||
|
||||
return newUser;
|
||||
}
|
||||
|
||||
|
@@ -150,7 +150,8 @@ public class BukkitPermissions {
|
||||
String uuid = player.getUniqueId().toString();
|
||||
|
||||
// Reset the User objects player reference.
|
||||
User user = plugin.getWorldsHolder().getWorldData(player.getWorld().getName()).getUser(uuid);
|
||||
User user = plugin.getWorldsHolder().getWorldData(player.getWorld().getName()).getUser(player.getUniqueId().toString(), player.getName());
|
||||
|
||||
if (user != null)
|
||||
user.updatePlayer(player);
|
||||
|
||||
@@ -399,11 +400,11 @@ public class BukkitPermissions {
|
||||
*
|
||||
* @param player
|
||||
*/
|
||||
private void removeAttachment(String playerName) {
|
||||
private void removeAttachment(String uuid) {
|
||||
|
||||
if (attachments.containsKey(playerName)) {
|
||||
attachments.get(playerName).remove();
|
||||
attachments.remove(playerName);
|
||||
if (attachments.containsKey(uuid)) {
|
||||
attachments.get(uuid).remove();
|
||||
attachments.remove(uuid);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -442,7 +443,7 @@ public class BukkitPermissions {
|
||||
/*
|
||||
* Tidy up any lose ends
|
||||
*/
|
||||
removeAttachment(player.getName());
|
||||
removeAttachment(player.getUniqueId().toString());
|
||||
|
||||
// force GM to create the player if they are not already listed.
|
||||
plugin.getWorldsHolder().getWorldData(player.getWorld().getName()).getUser(player.getUniqueId().toString(), player.getName());
|
||||
@@ -473,7 +474,7 @@ public class BukkitPermissions {
|
||||
/*
|
||||
* force remove any attachments as bukkit may not
|
||||
*/
|
||||
removeAttachment(player.getName());
|
||||
removeAttachment(player.getUniqueId().toString());
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user