1
0
mirror of https://github.com/Zrips/Jobs.git synced 2024-12-01 15:03:36 +01:00

Option to disable daily quests

This commit is contained in:
Zrips 2023-05-02 16:47:49 +03:00
parent 5ecb3456a3
commit bc4e9343fc
7 changed files with 269 additions and 231 deletions

View File

@ -912,6 +912,9 @@ public final class Jobs extends JavaPlugin {
} }
private static void checkDailyQuests(JobsPlayer jPlayer, Job job, ActionInfo info) { private static void checkDailyQuests(JobsPlayer jPlayer, Job job, ActionInfo info) {
if (!Jobs.getGCManager().DailyQuestsEnabled) {
return;
}
if (!job.getQuests().isEmpty()) { if (!job.getQuests().isEmpty()) {
for (QuestProgression one : jPlayer.getQuestProgressions(job, info.getType())) { for (QuestProgression one : jPlayer.getQuestProgressions(job, info.getType())) {
one.processQuest(jPlayer, info); one.processQuest(jPlayer, info);
@ -1416,7 +1419,7 @@ public final class Jobs extends JavaPlugin {
double expPayment = payment.get(CurrencyType.EXP); double expPayment = payment.get(CurrencyType.EXP);
JobsPrePaymentEvent jobsPrePaymentEvent = new JobsPrePaymentEvent(jPlayer.getPlayer(), noneJob, payment.get(CurrencyType.MONEY), JobsPrePaymentEvent jobsPrePaymentEvent = new JobsPrePaymentEvent(jPlayer.getPlayer(), noneJob, payment.get(CurrencyType.MONEY),
payment.get(CurrencyType.POINTS), block, ent, victim, info); payment.get(CurrencyType.POINTS), block, ent, victim, info);
Bukkit.getServer().getPluginManager().callEvent(jobsPrePaymentEvent); Bukkit.getServer().getPluginManager().callEvent(jobsPrePaymentEvent);
// If event is canceled, don't do anything // If event is canceled, don't do anything
if (jobsPrePaymentEvent.isCancelled()) if (jobsPrePaymentEvent.isCancelled())

View File

@ -55,7 +55,11 @@ public class editquests implements Cmd {
int page = 0; int page = 0;
Action action = null; Action action = null;
if (!Jobs.getGCManager().DailyQuestsEnabled) {
LC.info_FeatureNotEnabled.sendMessage(sender);
}
for (String one : args) { for (String one : args) {
if (page == 0) { if (page == 0) {
try { try {

View File

@ -24,127 +24,133 @@ public class quests implements Cmd {
@Override @Override
public boolean perform(Jobs plugin, final CommandSender sender, String[] args) { public boolean perform(Jobs plugin, final CommandSender sender, String[] args) {
JobsPlayer jPlayer = null;
boolean isPlayer = sender instanceof Player;
if (args.length >= 1 && !args[0].equalsIgnoreCase("stop") && !args[0].equalsIgnoreCase("start")) { if (!Jobs.getGCManager().DailyQuestsEnabled) {
if (!Jobs.hasPermission(sender, "jobs.command.admin.quests", true)) LC.info_FeatureNotEnabled.sendMessage(sender);
return true; return true;
}
jPlayer = Jobs.getPlayerManager().getJobsPlayer(args[0]); JobsPlayer jPlayer = null;
} else if (isPlayer) boolean isPlayer = sender instanceof Player;
jPlayer = Jobs.getPlayerManager().getJobsPlayer((Player) sender);
if (jPlayer == null) { if (args.length >= 1 && !args[0].equalsIgnoreCase("stop") && !args[0].equalsIgnoreCase("start")) {
if (args.length >= 1) if (!Jobs.hasPermission(sender, "jobs.command.admin.quests", true))
CMIMessages.sendMessage(sender, LC.info_NoInformation); return true;
else
Jobs.getCommandManager().sendUsage(sender, "quests");
return true;
}
List<QuestProgression> questProgs = jPlayer.getQuestProgressions(); jPlayer = Jobs.getPlayerManager().getJobsPlayer(args[0]);
} else if (isPlayer)
jPlayer = Jobs.getPlayerManager().getJobsPlayer((Player) sender);
if (questProgs.isEmpty()) { if (jPlayer == null) {
sender.sendMessage(Jobs.getLanguage().getMessage("command.quests.error.noquests")); if (args.length >= 1)
return true; CMIMessages.sendMessage(sender, LC.info_NoInformation);
} else
Jobs.getCommandManager().sendUsage(sender, "quests");
return true;
}
if (args.length >= 1) { List<QuestProgression> questProgs = jPlayer.getQuestProgressions();
Boolean stopped = null;
String cmd = args[args.length == 1 ? 0 : 1];
if (cmd.equalsIgnoreCase("stop") && Jobs.hasPermission(sender, "jobs.command.admin.quests.stop", false)) { if (questProgs.isEmpty()) {
stopped = true; sender.sendMessage(Jobs.getLanguage().getMessage("command.quests.error.noquests"));
} else if (cmd.equalsIgnoreCase("start") && Jobs.hasPermission(sender, "jobs.command.admin.quests.start", false)) { return true;
stopped = false; }
}
if (stopped != null) { if (args.length >= 1) {
for (QuestProgression q : questProgs) { Boolean stopped = null;
q.getQuest().setStopped(stopped); String cmd = args[args.length == 1 ? 0 : 1];
}
sender.sendMessage(Jobs.getLanguage().getMessage("command.quests.status.changed", "%status%", if (cmd.equalsIgnoreCase("stop") && Jobs.hasPermission(sender, "jobs.command.admin.quests.stop", false)) {
stopped ? Jobs.getLanguage().getMessage("command.quests.status.stopped") : Jobs.getLanguage().getMessage("command.quests.status.started"))); stopped = true;
return true; } else if (cmd.equalsIgnoreCase("start") && Jobs.hasPermission(sender, "jobs.command.admin.quests.start", false)) {
} stopped = false;
} }
sender.sendMessage(Jobs.getLanguage().getMessage("command.quests.toplineseparator", "[playerName]", jPlayer.getName(), "[questsDone]", jPlayer.getDoneQuests())); if (stopped != null) {
for (QuestProgression q : questProgs) {
q.getQuest().setStopped(stopped);
}
for (JobProgression jobProg : jPlayer.progression) { sender.sendMessage(Jobs.getLanguage().getMessage("command.quests.status.changed", "%status%",
List<QuestProgression> list = jPlayer.getQuestProgressions(jobProg.getJob()); stopped ? Jobs.getLanguage().getMessage("command.quests.status.stopped") : Jobs.getLanguage().getMessage("command.quests.status.started")));
return true;
}
}
for (QuestProgression q : list) { sender.sendMessage(Jobs.getLanguage().getMessage("command.quests.toplineseparator", "[playerName]", jPlayer.getName(), "[questsDone]", jPlayer.getDoneQuests()));
int totalAmountNeeded = q.getTotalAmountNeeded();
int totalAmountDone = q.getTotalAmountDone();
String progressLine = Jobs.getCommandManager().jobProgressMessage(totalAmountNeeded, totalAmountDone); for (JobProgression jobProg : jPlayer.progression) {
List<QuestProgression> list = jPlayer.getQuestProgressions(jobProg.getJob());
boolean completed = q.isCompleted(); for (QuestProgression q : list) {
int totalAmountNeeded = q.getTotalAmountNeeded();
int totalAmountDone = q.getTotalAmountDone();
if (completed) String progressLine = Jobs.getCommandManager().jobProgressMessage(totalAmountNeeded, totalAmountDone);
progressLine = Jobs.getLanguage().getMessage("command.quests.output.completed");
Quest quest = q.getQuest(); boolean completed = q.isCompleted();
String msg = Jobs.getLanguage().getMessage("command.quests.output.questLine", "[progress]", if (completed)
progressLine, "[questName]", quest.getQuestName(), "[done]", totalAmountDone, "[required]", totalAmountNeeded); progressLine = Jobs.getLanguage().getMessage("command.quests.output.completed");
if (!isPlayer) { Quest quest = q.getQuest();
sender.sendMessage(msg);
continue;
}
RawMessage rm = new RawMessage(); String msg = Jobs.getLanguage().getMessage("command.quests.output.questLine", "[progress]",
progressLine, "[questName]", quest.getQuestName(), "[done]", totalAmountDone, "[required]", totalAmountNeeded);
String hoverMsg = Jobs.getLanguage().getMessage("command.quests.output.hover"); if (!isPlayer) {
List<String> hoverList = new ArrayList<>(); sender.sendMessage(msg);
continue;
}
for (String current : hoverMsg.split("\n")) { RawMessage rm = new RawMessage();
current = current.replace("[jobName]", jobProg.getJob().getName())
.replace("[time]", CMITimeManager.to24hourShort(q.getValidUntil() - System.currentTimeMillis()));
if (current.contains("[desc]")) { String hoverMsg = Jobs.getLanguage().getMessage("command.quests.output.hover");
hoverList.addAll(quest.getDescription()); List<String> hoverList = new ArrayList<>();
} else {
hoverList.add(current);
}
}
for (java.util.Map<String, QuestObjective> oneAction : quest.getObjectives().values()) { for (String current : hoverMsg.split("\n")) {
for (Entry<String, QuestObjective> oneObjective : oneAction.entrySet()) { current = current.replace("[jobName]", jobProg.getJob().getName())
hoverList.add(Jobs.getLanguage().getMessage("command.info.output." + oneObjective.getValue().getAction().toString().toLowerCase() + ".info") + " " + .replace("[time]", CMITimeManager.to24hourShort(q.getValidUntil() - System.currentTimeMillis()));
Jobs.getNameTranslatorManager().translate(oneObjective.getKey(), oneObjective.getValue().getAction(), oneObjective.getValue().getTargetId(), oneObjective.getValue()
.getTargetMeta(), oneObjective.getValue().getTargetName())
+ " " + q.getAmountDone(oneObjective.getValue()) + "/"
+ oneObjective.getValue().getAmount());
}
}
String hover = ""; if (current.contains("[desc]")) {
for (String one : hoverList) { hoverList.addAll(quest.getDescription());
if (!hover.isEmpty()) } else {
hover += "\n"; hoverList.add(current);
}
}
hover += one; for (java.util.Map<String, QuestObjective> oneAction : quest.getObjectives().values()) {
} for (Entry<String, QuestObjective> oneObjective : oneAction.entrySet()) {
hoverList.add(Jobs.getLanguage().getMessage("command.info.output." + oneObjective.getValue().getAction().toString().toLowerCase() + ".info") + " " +
Jobs.getNameTranslatorManager().translate(oneObjective.getKey(), oneObjective.getValue().getAction(), oneObjective.getValue().getTargetId(), oneObjective.getValue()
.getTargetMeta(), oneObjective.getValue().getTargetName())
+ " " + q.getAmountDone(oneObjective.getValue()) + "/"
+ oneObjective.getValue().getAmount());
}
}
if (list.size() < jobProg.getJob().getQuests().size() && Jobs.getGCManager().getDailyQuestsSkips() > jPlayer.getSkippedQuests() && !completed) { String hover = "";
if (Jobs.getGCManager().getDailyQuestsSkips() > 0) { for (String one : hoverList) {
hover += "\n" + Jobs.getLanguage().getMessage("command.quests.output.skip"); if (!hover.isEmpty())
hover += "\n" + Jobs.getLanguage().getMessage("command.quests.output.skips", "[skips]", (Jobs.getGCManager().getDailyQuestsSkips() - jPlayer.getSkippedQuests())); hover += "\n";
}
rm.addText(msg).addHover(hover).addCommand("jobs skipquest " + jobProg.getJob().getName() + " " + quest.getConfigName() + " " + jPlayer.getName());
} else
rm.addText(msg).addHover(hover);
rm.show(sender); hover += one;
} }
}
sender.sendMessage(Jobs.getLanguage().getMessage("general.info.separator")); if (list.size() < jobProg.getJob().getQuests().size() && Jobs.getGCManager().getDailyQuestsSkips() > jPlayer.getSkippedQuests() && !completed) {
return true; if (Jobs.getGCManager().getDailyQuestsSkips() > 0) {
hover += "\n" + Jobs.getLanguage().getMessage("command.quests.output.skip");
hover += "\n" + Jobs.getLanguage().getMessage("command.quests.output.skips", "[skips]", (Jobs.getGCManager().getDailyQuestsSkips() - jPlayer.getSkippedQuests()));
}
rm.addText(msg).addHover(hover).addCommand("jobs skipquest " + jobProg.getJob().getName() + " " + quest.getConfigName() + " " + jPlayer.getName());
} else
rm.addText(msg).addHover(hover);
rm.show(sender);
}
}
sender.sendMessage(Jobs.getLanguage().getMessage("general.info.separator"));
return true;
} }
} }

View File

@ -11,47 +11,55 @@ import com.gamingmesh.jobs.container.Job;
import com.gamingmesh.jobs.container.JobsPlayer; import com.gamingmesh.jobs.container.JobsPlayer;
import com.gamingmesh.jobs.container.QuestProgression; import com.gamingmesh.jobs.container.QuestProgression;
import net.Zrips.CMILib.Locale.LC;
public class resetquest implements Cmd { public class resetquest implements Cmd {
@Override @Override
public boolean perform(Jobs plugin, final CommandSender sender, final String[] args) { public boolean perform(Jobs plugin, final CommandSender sender, final String[] args) {
if (args.length != 0 && args.length != 1 && args.length != 2) {
Jobs.getCommandManager().sendUsage(sender, "resetquest"); if (!Jobs.getGCManager().DailyQuestsEnabled) {
return true; LC.info_FeatureNotEnabled.sendMessage(sender);
} return true;
}
if (args.length != 0 && args.length != 1 && args.length != 2) {
Jobs.getCommandManager().sendUsage(sender, "resetquest");
return true;
}
JobsPlayer jPlayer = null; JobsPlayer jPlayer = null;
Job job = null; Job job = null;
for (String one : args) { for (String one : args) {
if (job == null) { if (job == null) {
job = Jobs.getJob(one); job = Jobs.getJob(one);
if (job != null) if (job != null)
continue; continue;
} }
jPlayer = Jobs.getPlayerManager().getJobsPlayer(one); jPlayer = Jobs.getPlayerManager().getJobsPlayer(one);
} }
if (jPlayer == null && sender instanceof Player) if (jPlayer == null && sender instanceof Player)
jPlayer = Jobs.getPlayerManager().getJobsPlayer((Player) sender); jPlayer = Jobs.getPlayerManager().getJobsPlayer((Player) sender);
if (jPlayer == null) { if (jPlayer == null) {
sender.sendMessage(Jobs.getLanguage().getMessage("general.error.noinfoByPlayer", "%playername%", args.length > 0 ? args[0] : "")); sender.sendMessage(Jobs.getLanguage().getMessage("general.error.noinfoByPlayer", "%playername%", args.length > 0 ? args[0] : ""));
return true; return true;
} }
List<QuestProgression> quests = jPlayer.getQuestProgressions(); List<QuestProgression> quests = jPlayer.getQuestProgressions();
if (job != null) if (job != null)
quests = jPlayer.getQuestProgressions(job); quests = jPlayer.getQuestProgressions(job);
if (quests.isEmpty()) { if (quests.isEmpty()) {
sender.sendMessage(Jobs.getLanguage().getMessage("command.resetquest.output.noQuests")); sender.sendMessage(Jobs.getLanguage().getMessage("command.resetquest.output.noQuests"));
return true; return true;
} }
jPlayer.resetQuests(quests); jPlayer.resetQuests(quests);
sender.sendMessage(Jobs.getLanguage().getMessage("command.resetquest.output.reseted", "%playername%", jPlayer.getName(), "%playerdisplayname%", jPlayer.getName())); sender.sendMessage(Jobs.getLanguage().getMessage("command.resetquest.output.reseted", "%playername%", jPlayer.getName(), "%playerdisplayname%", jPlayer.getName()));
return true; return true;
} }
} }

View File

@ -11,48 +11,55 @@ import com.gamingmesh.jobs.commands.Cmd;
import com.gamingmesh.jobs.container.Job; import com.gamingmesh.jobs.container.Job;
import com.gamingmesh.jobs.container.JobsPlayer; import com.gamingmesh.jobs.container.JobsPlayer;
import net.Zrips.CMILib.Locale.LC;
public class resetquesttotal implements Cmd { public class resetquesttotal implements Cmd {
@Override @Override
public boolean perform(Jobs plugin, final CommandSender sender, final String[] args) { public boolean perform(Jobs plugin, final CommandSender sender, final String[] args) {
if (args.length != 0 && args.length != 1) { if (!Jobs.getGCManager().DailyQuestsEnabled) {
Jobs.getCommandManager().sendUsage(sender, "resetquesttotal"); LC.info_FeatureNotEnabled.sendMessage(sender);
return true; return true;
} }
if (args.length != 0 && args.length != 1) {
Jobs.getCommandManager().sendUsage(sender, "resetquesttotal");
return true;
}
if (args.length > 0 && args[0].equalsIgnoreCase("all")) { if (args.length > 0 && args[0].equalsIgnoreCase("all")) {
for (Entry<UUID, JobsPlayer> pl : Jobs.getPlayerManager().getPlayersCache().entrySet()) { for (Entry<UUID, JobsPlayer> pl : Jobs.getPlayerManager().getPlayersCache().entrySet()) {
pl.getValue().setDoneQuests(0); pl.getValue().setDoneQuests(0);
} }
Jobs.getJobsDAO().resetDoneQuests(); Jobs.getJobsDAO().resetDoneQuests();
sender.sendMessage(Jobs.getLanguage().getMessage("command.resetquesttotal.output.reseted", "%playername%", Jobs.getPlayerManager().getPlayersCache().size())); sender.sendMessage(Jobs.getLanguage().getMessage("command.resetquesttotal.output.reseted", "%playername%", Jobs.getPlayerManager().getPlayersCache().size()));
return true; return true;
} }
JobsPlayer jPlayer = null; JobsPlayer jPlayer = null;
Job job = null; Job job = null;
for (String one : args) { for (String one : args) {
if (job == null) { if (job == null) {
job = Jobs.getJob(one); job = Jobs.getJob(one);
if (job != null) if (job != null)
continue; continue;
} }
jPlayer = Jobs.getPlayerManager().getJobsPlayer(one); jPlayer = Jobs.getPlayerManager().getJobsPlayer(one);
} }
if (jPlayer == null && sender instanceof Player) if (jPlayer == null && sender instanceof Player)
jPlayer = Jobs.getPlayerManager().getJobsPlayer((Player) sender); jPlayer = Jobs.getPlayerManager().getJobsPlayer((Player) sender);
if (jPlayer == null) { if (jPlayer == null) {
sender.sendMessage(Jobs.getLanguage().getMessage("general.error.noinfoByPlayer", "%playername%", args.length > 0 ? args[0] : "")); sender.sendMessage(Jobs.getLanguage().getMessage("general.error.noinfoByPlayer", "%playername%", args.length > 0 ? args[0] : ""));
return true; return true;
} }
jPlayer.setDoneQuests(0); jPlayer.setDoneQuests(0);
jPlayer.setSaved(false); jPlayer.setSaved(false);
jPlayer.save(); jPlayer.save();
sender.sendMessage(Jobs.getLanguage().getMessage("command.resetquesttotal.output.reseted", "%playername%", jPlayer.getName(), "%playerdisplayname%", jPlayer.getDisplayName())); sender.sendMessage(Jobs.getLanguage().getMessage("command.resetquesttotal.output.reseted", "%playername%", jPlayer.getName(), "%playerdisplayname%", jPlayer.getDisplayName()));
return true; return true;
} }
} }

View File

@ -13,102 +13,108 @@ import com.gamingmesh.jobs.container.Quest;
import com.gamingmesh.jobs.container.QuestProgression; import com.gamingmesh.jobs.container.QuestProgression;
import com.gamingmesh.jobs.economy.BufferedEconomy; import com.gamingmesh.jobs.economy.BufferedEconomy;
import net.Zrips.CMILib.Locale.LC;
public class skipquest implements Cmd { public class skipquest implements Cmd {
@Override @Override
public boolean perform(Jobs plugin, final CommandSender sender, final String[] args) { public boolean perform(Jobs plugin, final CommandSender sender, final String[] args) {
if (args.length != 2 && args.length != 3) { if (!Jobs.getGCManager().DailyQuestsEnabled) {
Jobs.getCommandManager().sendUsage(sender, "skipquest"); LC.info_FeatureNotEnabled.sendMessage(sender);
return true; return true;
} }
if (args.length != 2 && args.length != 3) {
Jobs.getCommandManager().sendUsage(sender, "skipquest");
return true;
}
JobsPlayer jPlayer = null; JobsPlayer jPlayer = null;
Job job = null; Job job = null;
String questName = ""; String questName = "";
for (String one : args) { for (String one : args) {
if (job == null) { if (job == null) {
job = Jobs.getJob(one); job = Jobs.getJob(one);
if (job != null) if (job != null)
continue; continue;
} }
if (jPlayer == null) { if (jPlayer == null) {
jPlayer = Jobs.getPlayerManager().getJobsPlayer(one); jPlayer = Jobs.getPlayerManager().getJobsPlayer(one);
if (jPlayer != null) if (jPlayer != null)
continue; continue;
} }
if (!questName.isEmpty()) if (!questName.isEmpty())
questName += " "; questName += " ";
questName += one; questName += one;
} }
if (jPlayer == null && sender instanceof Player) if (jPlayer == null && sender instanceof Player)
jPlayer = Jobs.getPlayerManager().getJobsPlayer((Player) sender); jPlayer = Jobs.getPlayerManager().getJobsPlayer((Player) sender);
if (jPlayer == null) { if (jPlayer == null) {
sender.sendMessage(Jobs.getLanguage().getMessage("general.error.noinfoByPlayer", "%playername%", args.length > 0 ? args[0] : "")); sender.sendMessage(Jobs.getLanguage().getMessage("general.error.noinfoByPlayer", "%playername%", args.length > 0 ? args[0] : ""));
return true; return true;
} }
List<QuestProgression> quests = jPlayer.getQuestProgressions(); List<QuestProgression> quests = jPlayer.getQuestProgressions();
if (job != null) if (job != null)
quests = jPlayer.getQuestProgressions(job); quests = jPlayer.getQuestProgressions(job);
if (quests == null || quests.isEmpty()) { if (quests == null || quests.isEmpty()) {
sender.sendMessage(Jobs.getLanguage().getMessage("command.resetquest.output.noQuests")); sender.sendMessage(Jobs.getLanguage().getMessage("command.resetquest.output.noQuests"));
return true; return true;
} }
Quest old = null; Quest old = null;
for (QuestProgression one : quests) { for (QuestProgression one : quests) {
Quest q = one.getQuest(); Quest q = one.getQuest();
if (q.getQuestName().equalsIgnoreCase(questName) || q.getConfigName().equalsIgnoreCase(questName)) { if (q.getQuestName().equalsIgnoreCase(questName) || q.getConfigName().equalsIgnoreCase(questName)) {
old = q; old = q;
break; break;
} }
} }
if (old == null) { if (old == null) {
return false; return false;
} }
// Do not skip the completed quests // Do not skip the completed quests
for (QuestProgression q : quests) { for (QuestProgression q : quests) {
if (q.getQuest().getQuestName().equals(old.getQuestName()) && q.isCompleted()) { if (q.getQuest().getQuestName().equals(old.getQuestName()) && q.isCompleted()) {
return false; return false;
} }
} }
if (Jobs.getGCManager().getDailyQuestsSkips() <= jPlayer.getSkippedQuests()) { if (Jobs.getGCManager().getDailyQuestsSkips() <= jPlayer.getSkippedQuests()) {
return false; return false;
} }
double amount = Jobs.getGCManager().skipQuestCost; double amount = Jobs.getGCManager().skipQuestCost;
BufferedEconomy econ = Jobs.getEconomy(); BufferedEconomy econ = Jobs.getEconomy();
Player player = jPlayer.getPlayer(); Player player = jPlayer.getPlayer();
if (amount > 0 && player != null) { if (amount > 0 && player != null) {
if (!econ.getEconomy().hasMoney(player, amount)) { if (!econ.getEconomy().hasMoney(player, amount)) {
sender.sendMessage(Jobs.getLanguage().getMessage("economy.error.nomoney")); sender.sendMessage(Jobs.getLanguage().getMessage("economy.error.nomoney"));
return false; return false;
} }
econ.getEconomy().withdrawPlayer(player, amount); econ.getEconomy().withdrawPlayer(player, amount);
} }
jPlayer.replaceQuest(old); jPlayer.replaceQuest(old);
if (player != null) if (player != null)
plugin.getServer().dispatchCommand(player, "jobs quests"); plugin.getServer().dispatchCommand(player, "jobs quests");
if (amount > 0) { if (amount > 0) {
sender.sendMessage(Jobs.getLanguage().getMessage("command.skipquest.output.questSkipForCost", "%amount%", amount)); sender.sendMessage(Jobs.getLanguage().getMessage("command.skipquest.output.questSkipForCost", "%amount%", amount));
} }
return true; return true;
} }
} }

View File

@ -112,6 +112,7 @@ public class GeneralConfigManager {
payForEachVTradeItem, allowEnchantingBoostedItems, bossBarAsync = false, preventShopItemEnchanting; payForEachVTradeItem, allowEnchantingBoostedItems, bossBarAsync = false, preventShopItemEnchanting;
public boolean jobsshopenabled; public boolean jobsshopenabled;
public boolean DailyQuestsEnabled;
public ItemStack guiInfoButton; public ItemStack guiInfoButton;
public int InfoButtonSlot = 9; public int InfoButtonSlot = 9;
@ -422,6 +423,9 @@ public class GeneralConfigManager {
c.addComment("broadcast.on-level-up.levels", "For what levels you want to broadcast message? Keep it at 0 if you want for all of them"); c.addComment("broadcast.on-level-up.levels", "For what levels you want to broadcast message? Keep it at 0 if you want for all of them");
BroadcastingLevelUpLevels = c.getIntList("broadcast.on-level-up.levels", Arrays.asList(0)); BroadcastingLevelUpLevels = c.getIntList("broadcast.on-level-up.levels", Arrays.asList(0));
c.addComment("DailyQuests.Enabled", "Enables or disables daily quests");
DailyQuestsEnabled = c.get("DailyQuests.Enabled", true);
c.addComment("DailyQuests.ResetTime", "Defines time in 24hour format when we want to give out new daily quests", c.addComment("DailyQuests.ResetTime", "Defines time in 24hour format when we want to give out new daily quests",
"Any daily quests given before reset will be invalid and new ones will be given out"); "Any daily quests given before reset will be invalid and new ones will be given out");
ResetTimeHour = c.get("DailyQuests.ResetTime.Hour", 4); ResetTimeHour = c.get("DailyQuests.ResetTime.Hour", 4);