mirror of
https://github.com/PikaMug/Quests.git
synced 2024-11-05 02:11:09 +01:00
Populate last known name on Quester instantiation, fixes #1479
This commit is contained in:
parent
d5d1dbde48
commit
f435d871dd
@ -228,6 +228,10 @@ public class Quester implements Comparable<Quester> {
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* @deprecated Use {@link #Quester(Quests, UUID)}
|
||||
*/
|
||||
@Deprecated
|
||||
public Quester(final Quests plugin) {
|
||||
this.plugin = plugin;
|
||||
}
|
||||
@ -235,6 +239,7 @@ public class Quester implements Comparable<Quester> {
|
||||
public Quester(final Quests plugin, final UUID uuid) {
|
||||
this.plugin = plugin;
|
||||
this.id = uuid;
|
||||
this.lastKnownName = Bukkit.getOfflinePlayer(uuid).getName();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -509,8 +509,7 @@ public class Quests extends JavaPlugin implements ConversationAbandonedListener
|
||||
Quester quester = getQuester(player.getUniqueId());
|
||||
if (quester == null) {
|
||||
// Must be new player
|
||||
quester = new Quester(Quests.this);
|
||||
quester.setUUID(player.getUniqueId());
|
||||
quester = new Quester(Quests.this, player.getUniqueId());
|
||||
if (quester.saveData()) {
|
||||
getLogger().info("Created new data for player " + player.getName());
|
||||
} else {
|
||||
|
@ -1399,8 +1399,7 @@ public class CmdExecutor implements CommandExecutor {
|
||||
} catch (final Exception e) {
|
||||
plugin.getLogger().info("Data file does not exist for " + id.toString());
|
||||
}
|
||||
quester = new Quester(plugin);
|
||||
quester.setUUID(id);
|
||||
quester = new Quester(plugin, id);
|
||||
quester.saveData();
|
||||
final ConcurrentSkipListSet<Quester> temp2 = (ConcurrentSkipListSet<Quester>) plugin.getOfflineQuesters();
|
||||
temp2.add(quester);
|
||||
|
Loading…
Reference in New Issue
Block a user