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) {
|
public Quester(final Quests plugin) {
|
||||||
this.plugin = plugin;
|
this.plugin = plugin;
|
||||||
}
|
}
|
||||||
@ -235,6 +239,7 @@ public class Quester implements Comparable<Quester> {
|
|||||||
public Quester(final Quests plugin, final UUID uuid) {
|
public Quester(final Quests plugin, final UUID uuid) {
|
||||||
this.plugin = plugin;
|
this.plugin = plugin;
|
||||||
this.id = uuid;
|
this.id = uuid;
|
||||||
|
this.lastKnownName = Bukkit.getOfflinePlayer(uuid).getName();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -509,8 +509,7 @@ public class Quests extends JavaPlugin implements ConversationAbandonedListener
|
|||||||
Quester quester = getQuester(player.getUniqueId());
|
Quester quester = getQuester(player.getUniqueId());
|
||||||
if (quester == null) {
|
if (quester == null) {
|
||||||
// Must be new player
|
// Must be new player
|
||||||
quester = new Quester(Quests.this);
|
quester = new Quester(Quests.this, player.getUniqueId());
|
||||||
quester.setUUID(player.getUniqueId());
|
|
||||||
if (quester.saveData()) {
|
if (quester.saveData()) {
|
||||||
getLogger().info("Created new data for player " + player.getName());
|
getLogger().info("Created new data for player " + player.getName());
|
||||||
} else {
|
} else {
|
||||||
|
@ -1399,8 +1399,7 @@ public class CmdExecutor implements CommandExecutor {
|
|||||||
} catch (final Exception e) {
|
} catch (final Exception e) {
|
||||||
plugin.getLogger().info("Data file does not exist for " + id.toString());
|
plugin.getLogger().info("Data file does not exist for " + id.toString());
|
||||||
}
|
}
|
||||||
quester = new Quester(plugin);
|
quester = new Quester(plugin, id);
|
||||||
quester.setUUID(id);
|
|
||||||
quester.saveData();
|
quester.saveData();
|
||||||
final ConcurrentSkipListSet<Quester> temp2 = (ConcurrentSkipListSet<Quester>) plugin.getOfflineQuesters();
|
final ConcurrentSkipListSet<Quester> temp2 = (ConcurrentSkipListSet<Quester>) plugin.getOfflineQuesters();
|
||||||
temp2.add(quester);
|
temp2.add(quester);
|
||||||
|
Loading…
Reference in New Issue
Block a user