From c8a811ca6ea9dac3293d6afa99c1b489e36c1969 Mon Sep 17 00:00:00 2001 From: Zrips Date: Thu, 26 May 2022 13:36:30 +0300 Subject: [PATCH] New placeholders to get quest real name and description --- .../jobs/Placeholders/Placeholder.java | 16 +++++++++++++++- .../gamingmesh/jobs/config/ConfigManager.java | 8 +++++--- 2 files changed, 20 insertions(+), 4 deletions(-) diff --git a/src/main/java/com/gamingmesh/jobs/Placeholders/Placeholder.java b/src/main/java/com/gamingmesh/jobs/Placeholders/Placeholder.java index 4e68bba5..4976d419 100644 --- a/src/main/java/com/gamingmesh/jobs/Placeholders/Placeholder.java +++ b/src/main/java/com/gamingmesh/jobs/Placeholders/Placeholder.java @@ -30,6 +30,8 @@ import com.gamingmesh.jobs.container.blockOwnerShip.BlockOwnerShip; import com.gamingmesh.jobs.container.blockOwnerShip.BlockTypes; import com.gamingmesh.jobs.stuff.TimeManage; +import net.Zrips.CMILib.Colors.CMIChatColor; +import net.Zrips.CMILib.Container.CMIList; import net.Zrips.CMILib.Locale.LC; import net.Zrips.CMILib.Logs.CMIDebug; @@ -107,6 +109,8 @@ public class Placeholder { maxviplvl_$1("jname/number"), totalplayers_$1("jname/number"), maxslots_$1("jname/number"), + questname_$1_$2("jname/number", "questIndicator"), + questdesc_$1_$2("jname/number", "questIndicator"), bonus_$1("jname/number"); private String[] vars; @@ -525,7 +529,7 @@ public class Placeholder { return j == null ? "0" : Integer.toString(j.getJob().getMaxLevel(user)); case user_boost_$1_$2: Boost boost = Jobs.getPlayerManager().getFinalBonus(user, job, true, true); - return (vals.size() < 2 || j == null) ? "" : simplifyDouble(boost.getFinal(CurrencyType.getByName(vals.get(1)), false, true)); + return (vals.size() < 2 || j == null) ? "" : simplifyDouble(boost.getFinal(CurrencyType.getByName(vals.get(1)), false, true)); case user_jtoplvl_$1_$2: if (vals.size() < 2 || job == null) return ""; @@ -635,6 +639,16 @@ public class Placeholder { return Integer.toString(jo.getTotalPlayers()); case maxslots_$1: return Integer.toString(jo.getMaxSlots()); + case questname_$1_$2: + Quest quest = jo.getQuest(values.get(1)); + if (quest == null) + return null; + return CMIChatColor.translate(quest.getQuestName()); + case questdesc_$1_$2: + quest = jo.getQuest(values.get(1)); + if (quest == null) + return null; + return CMIChatColor.translate(CMIList.listToString(quest.getDescription(), "\n")); default: break; } diff --git a/src/main/java/com/gamingmesh/jobs/config/ConfigManager.java b/src/main/java/com/gamingmesh/jobs/config/ConfigManager.java index 70191172..5a8be21c 100644 --- a/src/main/java/com/gamingmesh/jobs/config/ConfigManager.java +++ b/src/main/java/com/gamingmesh/jobs/config/ConfigManager.java @@ -304,10 +304,12 @@ public class ConfigManager { cfg.addComment(pt + ".Collect", "Payment for collecting things like sweet berry bush, composter or honey"); - generate(cfg, pt + ".Collect.sweet_berry_bush-3"); + generate(cfg, pt + ".Collect.sweet_berries-2"); + generate(cfg, pt + ".Collect.sweet_berries-3"); generate(cfg, pt + ".Collect.composter"); - generate(cfg, pt + ".Collect.beehive-5"); - generate(cfg, pt + ".Collect.bee_nest-5"); + generate(cfg, pt + ".Collect.honeycomb"); + generate(cfg, pt + ".Collect.honey_bottle"); + generate(cfg, pt + ".Collect.glow_berries"); cfg.addComment(pt + ".Bake", "Payment for cooking raw foods in camp fire"); generate(cfg, pt + ".Bake.beef");