mirror of
https://github.com/PikaMug/Quests.git
synced 2024-11-22 18:45:27 +01:00
Forego permission check on login, fixes #1908
This commit is contained in:
parent
609eb183bd
commit
d1875ae377
@ -856,47 +856,46 @@ public class PlayerListener implements Listener {
|
|||||||
@EventHandler
|
@EventHandler
|
||||||
public void onPlayerLogin(final PlayerLoginEvent evt) {
|
public void onPlayerLogin(final PlayerLoginEvent evt) {
|
||||||
final Player player = evt.getPlayer();
|
final Player player = evt.getPlayer();
|
||||||
if (plugin.canUseQuests(player.getUniqueId())) {
|
// Cannot check Quests#canUseQuests until PlayerJoinEvent
|
||||||
final IQuester noobCheck = new Quester(plugin, player.getUniqueId());
|
final IQuester noobCheck = new Quester(plugin, player.getUniqueId());
|
||||||
if (plugin.getSettings().canGenFilesOnJoin() && !noobCheck.hasData()) {
|
if (plugin.getSettings().canGenFilesOnJoin() && !noobCheck.hasData()) {
|
||||||
noobCheck.saveData();
|
noobCheck.saveData();
|
||||||
}
|
|
||||||
|
|
||||||
plugin.getServer().getScheduler().runTaskAsynchronously(plugin, () -> {
|
|
||||||
final CompletableFuture<IQuester> cf = plugin.getStorage().loadQuester(player.getUniqueId());
|
|
||||||
try {
|
|
||||||
final IQuester quester = cf.get();
|
|
||||||
if (quester == null) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
for (final IQuest q : quester.getCompletedQuestsTemp()) {
|
|
||||||
if (q != null) {
|
|
||||||
if (!quester.getCompletedTimes().containsKey(q) && q.getPlanner().getCooldown() > -1) {
|
|
||||||
quester.getCompletedTimes().put(q, System.currentTimeMillis());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
for (final IQuest quest : quester.getCurrentQuestsTemp().keySet()) {
|
|
||||||
quester.checkQuest(quest);
|
|
||||||
}
|
|
||||||
for (final IQuest quest : quester.getCurrentQuestsTemp().keySet()) {
|
|
||||||
if (quester.getCurrentStage(quest).getDelay() > -1) {
|
|
||||||
quester.startStageTimer(quest);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
plugin.getServer().getScheduler().scheduleSyncDelayedTask(plugin, () -> {
|
|
||||||
if (quester.hasJournal()) {
|
|
||||||
quester.updateJournal();
|
|
||||||
}
|
|
||||||
if (quester.canUseCompass()) {
|
|
||||||
quester.findCompassTarget();
|
|
||||||
}
|
|
||||||
}, 40L);
|
|
||||||
} catch (final Exception e) {
|
|
||||||
e.printStackTrace();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
plugin.getServer().getScheduler().runTaskAsynchronously(plugin, () -> {
|
||||||
|
final CompletableFuture<IQuester> cf = plugin.getStorage().loadQuester(player.getUniqueId());
|
||||||
|
try {
|
||||||
|
final IQuester quester = cf.get();
|
||||||
|
if (quester == null) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
for (final IQuest q : quester.getCompletedQuestsTemp()) {
|
||||||
|
if (q != null) {
|
||||||
|
if (!quester.getCompletedTimes().containsKey(q) && q.getPlanner().getCooldown() > -1) {
|
||||||
|
quester.getCompletedTimes().put(q, System.currentTimeMillis());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
for (final IQuest quest : quester.getCurrentQuestsTemp().keySet()) {
|
||||||
|
quester.checkQuest(quest);
|
||||||
|
}
|
||||||
|
for (final IQuest quest : quester.getCurrentQuestsTemp().keySet()) {
|
||||||
|
if (quester.getCurrentStage(quest).getDelay() > -1) {
|
||||||
|
quester.startStageTimer(quest);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
plugin.getServer().getScheduler().scheduleSyncDelayedTask(plugin, () -> {
|
||||||
|
if (quester.hasJournal()) {
|
||||||
|
quester.updateJournal();
|
||||||
|
}
|
||||||
|
if (quester.canUseCompass()) {
|
||||||
|
quester.findCompassTarget();
|
||||||
|
}
|
||||||
|
}, 40L);
|
||||||
|
} catch (final Exception e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@EventHandler
|
@EventHandler
|
||||||
|
Loading…
Reference in New Issue
Block a user