mirror of
https://github.com/PikaMug/Quests.git
synced 2025-01-13 03:40:37 +01:00
Format actions timers, fixes #1832
This commit is contained in:
parent
423357c6e1
commit
a82df20994
@ -11,14 +11,15 @@
|
||||
*/
|
||||
package me.blackvein.quests.actions;
|
||||
|
||||
import me.blackvein.quests.quests.IQuest;
|
||||
import me.blackvein.quests.player.IQuester;
|
||||
import me.blackvein.quests.Quests;
|
||||
import me.blackvein.quests.entity.QuestMob;
|
||||
import me.blackvein.quests.player.IQuester;
|
||||
import me.blackvein.quests.quests.IQuest;
|
||||
import me.blackvein.quests.tasks.ActionTimer;
|
||||
import me.blackvein.quests.util.ConfigUtil;
|
||||
import me.blackvein.quests.util.InventoryUtil;
|
||||
import me.blackvein.quests.util.Lang;
|
||||
import me.blackvein.quests.util.MiscUtil;
|
||||
import org.bukkit.ChatColor;
|
||||
import org.bukkit.Effect;
|
||||
import org.bukkit.Location;
|
||||
@ -394,7 +395,7 @@ public class Action implements IAction {
|
||||
}
|
||||
if (teleport != null) {
|
||||
if (player.isDead()) {
|
||||
plugin.getLogger().warning("Tried to fire IAction " + name + " but player " + player.getUniqueId()
|
||||
plugin.getLogger().warning("Tried to fire Action " + name + " but player " + player.getUniqueId()
|
||||
+ " was dead (known Bukkit limitation).");
|
||||
} else {
|
||||
player.teleport(teleport);
|
||||
@ -415,7 +416,7 @@ public class Action implements IAction {
|
||||
}
|
||||
if (timer > 0) {
|
||||
player.sendMessage(ChatColor.GREEN + Lang.get(player, "timerStart")
|
||||
.replace("<time>", ChatColor.RED + String.valueOf(timer) + ChatColor.GREEN));
|
||||
.replace("<time>", ChatColor.RED + MiscUtil.getTime(timer * 1000L) + ChatColor.GREEN));
|
||||
if (timer > 60) {
|
||||
quester.getTimers().put(new ActionTimer(quester, quest, 60, false)
|
||||
.runTaskLater(plugin, (timer - 60) * 20L).getTaskId(), quest);
|
||||
|
@ -15,6 +15,7 @@ package me.blackvein.quests.tasks;
|
||||
import me.blackvein.quests.quests.IQuest;
|
||||
import me.blackvein.quests.player.IQuester;
|
||||
import me.blackvein.quests.util.Lang;
|
||||
import me.blackvein.quests.util.MiscUtil;
|
||||
import org.bukkit.ChatColor;
|
||||
import org.bukkit.scheduler.BukkitRunnable;
|
||||
|
||||
@ -40,7 +41,7 @@ public class ActionTimer extends BukkitRunnable {
|
||||
quester.updateJournal();
|
||||
} else {
|
||||
quester.getPlayer().sendMessage(ChatColor.GREEN + Lang.get(quester.getPlayer(), "timerMessage")
|
||||
.replace("<time>", ChatColor.RED + String.valueOf(time) + ChatColor.GREEN));
|
||||
.replace("<time>", ChatColor.RED + MiscUtil.getTime(time * 1000L) + ChatColor.GREEN));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -804,8 +804,8 @@ blocksWithin: "within <amount> blocks of"
|
||||
experience: "Experience"
|
||||
partiesExperience: "Parties experience"
|
||||
timePrompt: "Enter amount of time (in seconds), <clear>, <cancel>"
|
||||
timerMessage: "Time left to finish the quest/stage: <time> seconds"
|
||||
timerStart: "You have <time> seconds to finish this quest/stage"
|
||||
timerMessage: "Time left to finish the quest/stage: <time>"
|
||||
timerStart: "You have <time> to finish this quest/stage"
|
||||
noPermission: "You do not have permission to do that."
|
||||
trialMode: "Trial Mode"
|
||||
modeDeny: "You are unable to do that in <mode>."
|
||||
|
Loading…
Reference in New Issue
Block a user