mirror of
https://github.com/Zrips/Jobs.git
synced 2024-11-29 14:05:25 +01:00
Single command for boosts
This commit is contained in:
parent
3bfb0f60cc
commit
2346e7d623
@ -270,14 +270,17 @@ public class JobsCommands implements CommandExecutor {
|
||||
|
||||
List<String> message = new ArrayList<>();
|
||||
|
||||
if (job.getBoost().get(CurrencyType.EXP) != 0D)
|
||||
message.add(Jobs.getLanguage().getMessage("command.expboost.output.infostats", "%boost%", (job.getBoost().get(CurrencyType.EXP)) + 1));
|
||||
for (CurrencyType one : CurrencyType.values()) {
|
||||
double boost = job.getBoost().get(one);
|
||||
if (boost != 0D) {
|
||||
|
||||
if (job.getBoost().get(CurrencyType.MONEY) != 0D)
|
||||
message.add(Jobs.getLanguage().getMessage("command.moneyboost.output.infostats", "%boost%", (job.getBoost().get(CurrencyType.MONEY)) + 1));
|
||||
String boostAmount = String.valueOf(boost + 1);
|
||||
if (boost % 1 == 0)
|
||||
boostAmount = String.valueOf((int) boost + 1);
|
||||
|
||||
if (job.getBoost().get(CurrencyType.POINTS) != 0D)
|
||||
message.add(Jobs.getLanguage().getMessage("command.pointboost.output.infostats", "%boost%", (job.getBoost().get(CurrencyType.POINTS)) + 1));
|
||||
message.add(Jobs.getLanguage().getMessage("command.boost.output.infostats", "%boost%", boostAmount, "%type%", one.getDisplayName()));
|
||||
}
|
||||
}
|
||||
|
||||
if (Jobs.getGCManager().useDynamicPayment) {
|
||||
int bonus = (int) ((job.getBonus() * 100) / 100.0);
|
||||
|
177
src/main/java/com/gamingmesh/jobs/commands/list/boost.java
Normal file
177
src/main/java/com/gamingmesh/jobs/commands/list/boost.java
Normal file
@ -0,0 +1,177 @@
|
||||
package com.gamingmesh.jobs.commands.list;
|
||||
|
||||
import org.bukkit.command.CommandSender;
|
||||
|
||||
import com.gamingmesh.jobs.Jobs;
|
||||
import com.gamingmesh.jobs.commands.Cmd;
|
||||
import com.gamingmesh.jobs.container.CurrencyType;
|
||||
import com.gamingmesh.jobs.container.Job;
|
||||
|
||||
import net.Zrips.CMILib.Locale.LC;
|
||||
import net.Zrips.CMILib.Logs.CMIDebug;
|
||||
import net.Zrips.CMILib.RawMessages.RawMessage;
|
||||
import net.Zrips.CMILib.Time.CMITimeManager;
|
||||
import net.Zrips.CMILib.Time.timeModifier;
|
||||
|
||||
public class boost implements Cmd {
|
||||
|
||||
@Override
|
||||
public boolean perform(Jobs plugin, CommandSender sender, String[] args) {
|
||||
|
||||
Double rate = null;
|
||||
Long timeDuration = null;
|
||||
Job job = null;
|
||||
boolean allJobs = false;
|
||||
boolean reset = false;
|
||||
CurrencyType type = null;
|
||||
|
||||
for (String one : args) {
|
||||
|
||||
if (type == null) {
|
||||
type = CurrencyType.getByName(one);
|
||||
if (type != null)
|
||||
continue;
|
||||
}
|
||||
|
||||
if (one.equalsIgnoreCase("all")) {
|
||||
allJobs = true;
|
||||
continue;
|
||||
}
|
||||
|
||||
if (one.equalsIgnoreCase("reset")) {
|
||||
reset = true;
|
||||
continue;
|
||||
}
|
||||
|
||||
if (job == null) {
|
||||
job = Jobs.getJob(one);
|
||||
if (job != null)
|
||||
continue;
|
||||
}
|
||||
|
||||
if (rate == null) {
|
||||
try {
|
||||
rate = Double.parseDouble(one);
|
||||
continue;
|
||||
} catch (NumberFormatException e) {
|
||||
}
|
||||
}
|
||||
|
||||
try {
|
||||
Long t = timeModifier.getTimeRangeFromString(one);
|
||||
if (timeDuration == null && t != null) {
|
||||
timeDuration = t;
|
||||
continue;
|
||||
}
|
||||
} catch (Exception e) {
|
||||
}
|
||||
}
|
||||
|
||||
if (job == null && rate == null) {
|
||||
LC.info_Spliter.sendMessage(sender);
|
||||
for (Job one : Jobs.getJobs()) {
|
||||
showBoosts(sender, one);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
if (job != null && rate == null) {
|
||||
LC.info_Spliter.sendMessage(sender);
|
||||
showBoosts(sender, job);
|
||||
return true;
|
||||
}
|
||||
|
||||
if (rate == null)
|
||||
rate = 1D;
|
||||
|
||||
if (timeDuration == null)
|
||||
timeDuration = 0L;
|
||||
|
||||
if (reset) {
|
||||
if (allJobs) {
|
||||
if (type == null) {
|
||||
for (Job one : Jobs.getJobs()) {
|
||||
for (CurrencyType curr : CurrencyType.values()) {
|
||||
one.addBoost(curr, 1.0);
|
||||
}
|
||||
}
|
||||
sender.sendMessage(Jobs.getLanguage().getMessage("command.boost.output.allreset"));
|
||||
} else {
|
||||
for (Job one : Jobs.getJobs()) {
|
||||
one.addBoost(type, 1.0);
|
||||
}
|
||||
sender.sendMessage(Jobs.getLanguage().getMessage("command.boost.output.alltypereset", "%type%", type.getDisplayName()));
|
||||
}
|
||||
} else if (job != null) {
|
||||
if (type == null) {
|
||||
for (CurrencyType curr : CurrencyType.values()) {
|
||||
job.addBoost(curr, 1.0);
|
||||
}
|
||||
sender.sendMessage(Jobs.getLanguage().getMessage("command.moneyboost.output.jobsboostreset", "%jobname%", job.getName()));
|
||||
} else {
|
||||
job.addBoost(type, 1.0);
|
||||
sender.sendMessage(Jobs.getLanguage().getMessage("command.moneyboost.output.jobstypeboostreset", "%jobname%", job.getName(), "%type%", type.getDisplayName()));
|
||||
}
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
if (job == null || allJobs) {
|
||||
for (Job one : Jobs.getJobs()) {
|
||||
if (type == null) {
|
||||
for (CurrencyType curr : CurrencyType.values()) {
|
||||
one.addBoost(curr, rate, timeDuration);
|
||||
}
|
||||
} else {
|
||||
one.addBoost(type, rate, timeDuration);
|
||||
}
|
||||
|
||||
sender.sendMessage(Jobs.getLanguage().getMessage("command.boost.output.boostadded", "%boost%", rate, "%jobname%", one.getName()));
|
||||
}
|
||||
} else {
|
||||
if (type == null) {
|
||||
for (CurrencyType curr : CurrencyType.values()) {
|
||||
job.addBoost(curr, rate, timeDuration);
|
||||
}
|
||||
} else {
|
||||
job.addBoost(type, rate, timeDuration);
|
||||
}
|
||||
CMIDebug.d(timeDuration);
|
||||
sender.sendMessage(Jobs.getLanguage().getMessage("command.boost.output.boostadded", "%boost%", rate, "%jobname%", job.getName()));
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
private void showBoosts(CommandSender sender, Job job) {
|
||||
RawMessage rm = new RawMessage();
|
||||
String msg = Jobs.getLanguage().getMessage("command.boost.output.boostStats", "%jobname%", job.getDisplayName());
|
||||
String[] split = msg.split("%payments%");
|
||||
|
||||
rm.addText(split[0]);
|
||||
|
||||
// String msg = Jobs.getLanguage().getMessage("command.boost.output.boostStats", "%jobname%", job.getDisplayName());
|
||||
for (CurrencyType curr : CurrencyType.values()) {
|
||||
|
||||
double boost = job.getBoost().get(curr);
|
||||
|
||||
String boostAmount = String.valueOf(boost);
|
||||
if (boost % 1 == 0)
|
||||
boostAmount = String.valueOf((int) boost);
|
||||
|
||||
if (curr.isEnabled()) {
|
||||
rm.addText(Jobs.getLanguage().getMessage("general.info.paymentTypeValued." + curr.toString(), "%amount%", boostAmount) + " ");
|
||||
}
|
||||
|
||||
if (job.getBoost().getTime(curr) != null && job.getBoost().isValid(curr)) {
|
||||
rm.addHover(CMITimeManager.to24hourShort(job.getBoost().getTime(curr) - System.currentTimeMillis()));
|
||||
CMIDebug.c(job.getBoost().getTime(curr) - System.currentTimeMillis());
|
||||
}
|
||||
}
|
||||
if (split.length > 1)
|
||||
rm.addText(split[1]);
|
||||
rm.show(sender);
|
||||
}
|
||||
}
|
@ -1,106 +0,0 @@
|
||||
package com.gamingmesh.jobs.commands.list;
|
||||
|
||||
import org.bukkit.command.CommandSender;
|
||||
|
||||
import com.gamingmesh.jobs.Jobs;
|
||||
import com.gamingmesh.jobs.commands.Cmd;
|
||||
import com.gamingmesh.jobs.container.CurrencyType;
|
||||
import com.gamingmesh.jobs.container.Job;
|
||||
|
||||
import net.Zrips.CMILib.Time.timeModifier;
|
||||
|
||||
public class expboost implements Cmd {
|
||||
|
||||
@Override
|
||||
public boolean perform(Jobs plugin, CommandSender sender, String[] args) {
|
||||
if (args.length > 3 || args.length <= 1) {
|
||||
Jobs.getCommandManager().sendUsage(sender, "expboost");
|
||||
return true;
|
||||
}
|
||||
|
||||
Double rate = null;
|
||||
Long timeDuration = null;
|
||||
String jobName = null;
|
||||
boolean reset = false;
|
||||
|
||||
for (String one : args) {
|
||||
if (one.equalsIgnoreCase("reset")) {
|
||||
reset = true;
|
||||
continue;
|
||||
}
|
||||
|
||||
if (jobName == null) {
|
||||
jobName = one;
|
||||
continue;
|
||||
}
|
||||
|
||||
if (rate == null) {
|
||||
try {
|
||||
rate = Double.parseDouble(one);
|
||||
continue;
|
||||
} catch (NumberFormatException e) {
|
||||
}
|
||||
}
|
||||
|
||||
try {
|
||||
Long t = timeModifier.getTimeRangeFromString(one);
|
||||
if (t != null)
|
||||
timeDuration = t;
|
||||
continue;
|
||||
} catch (Exception e) {
|
||||
}
|
||||
}
|
||||
|
||||
if (!reset && rate == null || jobName == null) {
|
||||
Jobs.getCommandManager().sendUsage(sender, "expboost");
|
||||
return false;
|
||||
}
|
||||
|
||||
if (rate == null)
|
||||
rate = 1D;
|
||||
|
||||
if (timeDuration == null)
|
||||
timeDuration = 0L;
|
||||
|
||||
if (!reset && jobName.equalsIgnoreCase("all")) {
|
||||
for (Job job : Jobs.getJobs()) {
|
||||
job.addBoost(CurrencyType.EXP, rate, timeDuration);
|
||||
}
|
||||
sender.sendMessage(Jobs.getLanguage().getMessage("command.expboost.output.boostalladded", "%boost%", rate));
|
||||
return true;
|
||||
}
|
||||
|
||||
if (reset) {
|
||||
if (jobName.equalsIgnoreCase("all")) {
|
||||
for (Job one : Jobs.getJobs()) {
|
||||
one.addBoost(CurrencyType.EXP, 1.0);
|
||||
}
|
||||
|
||||
sender.sendMessage(Jobs.getLanguage().getMessage("command.expboost.output.allreset"));
|
||||
} else if (args.length > 1) {
|
||||
Job job = Jobs.getJob(jobName);
|
||||
if (job == null) {
|
||||
sender.sendMessage(Jobs.getLanguage().getMessage("general.error.job"));
|
||||
return true;
|
||||
}
|
||||
|
||||
job.addBoost(CurrencyType.EXP, 1.0);
|
||||
|
||||
sender.sendMessage(Jobs.getLanguage().getMessage("command.expboost.output.jobsboostreset", "%jobname%", job.getName()));
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
Job job = Jobs.getJob(jobName);
|
||||
if (job == null) {
|
||||
sender.sendMessage(Jobs.getLanguage().getMessage("general.error.job"));
|
||||
return true;
|
||||
}
|
||||
|
||||
job.addBoost(CurrencyType.EXP, rate, timeDuration);
|
||||
sender.sendMessage(Jobs.getLanguage().getMessage("command.expboost.output.boostadded", "%boost%", rate,
|
||||
"%jobname%", job.getName()));
|
||||
return true;
|
||||
}
|
||||
}
|
@ -1,106 +0,0 @@
|
||||
package com.gamingmesh.jobs.commands.list;
|
||||
|
||||
import org.bukkit.command.CommandSender;
|
||||
|
||||
import com.gamingmesh.jobs.Jobs;
|
||||
import com.gamingmesh.jobs.commands.Cmd;
|
||||
import com.gamingmesh.jobs.container.CurrencyType;
|
||||
import com.gamingmesh.jobs.container.Job;
|
||||
|
||||
import net.Zrips.CMILib.Time.timeModifier;
|
||||
|
||||
public class moneyboost implements Cmd {
|
||||
|
||||
@Override
|
||||
public boolean perform(Jobs plugin, CommandSender sender, String[] args) {
|
||||
if (args.length > 3 || args.length <= 1) {
|
||||
Jobs.getCommandManager().sendUsage(sender, "moneyboost");
|
||||
return true;
|
||||
}
|
||||
|
||||
Double rate = null;
|
||||
Long timeDuration = null;
|
||||
String jobName = null;
|
||||
boolean reset = false;
|
||||
|
||||
for (String one : args) {
|
||||
if (one.equalsIgnoreCase("reset")) {
|
||||
reset = true;
|
||||
continue;
|
||||
}
|
||||
|
||||
if (jobName == null) {
|
||||
jobName = one;
|
||||
continue;
|
||||
}
|
||||
|
||||
if (rate == null) {
|
||||
try {
|
||||
rate = Double.parseDouble(one);
|
||||
continue;
|
||||
} catch (NumberFormatException e) {
|
||||
}
|
||||
}
|
||||
|
||||
try {
|
||||
Long t = timeModifier.getTimeRangeFromString(one);
|
||||
if (t != null)
|
||||
timeDuration = t;
|
||||
continue;
|
||||
} catch (Exception e) {
|
||||
}
|
||||
}
|
||||
|
||||
if (!reset && rate == null || jobName == null) {
|
||||
Jobs.getCommandManager().sendUsage(sender, "moneyboost");
|
||||
return false;
|
||||
}
|
||||
|
||||
if (rate == null)
|
||||
rate = 1D;
|
||||
|
||||
if (timeDuration == null)
|
||||
timeDuration = 0L;
|
||||
|
||||
if (!reset && jobName.equalsIgnoreCase("all")) {
|
||||
for (Job job : Jobs.getJobs()) {
|
||||
job.addBoost(CurrencyType.MONEY, rate, timeDuration);
|
||||
}
|
||||
sender.sendMessage(Jobs.getLanguage().getMessage("command.moneyboost.output.boostalladded", "%boost%", rate));
|
||||
return true;
|
||||
}
|
||||
|
||||
if (reset) {
|
||||
if (jobName.equalsIgnoreCase("all")) {
|
||||
for (Job one : Jobs.getJobs()) {
|
||||
one.addBoost(CurrencyType.MONEY, 1.0);
|
||||
}
|
||||
|
||||
sender.sendMessage(Jobs.getLanguage().getMessage("command.moneyboost.output.allreset"));
|
||||
} else if (args.length > 1) {
|
||||
Job job = Jobs.getJob(jobName);
|
||||
if (job == null) {
|
||||
sender.sendMessage(Jobs.getLanguage().getMessage("general.error.job"));
|
||||
return true;
|
||||
}
|
||||
|
||||
job.addBoost(CurrencyType.MONEY, 1.0);
|
||||
|
||||
sender.sendMessage(Jobs.getLanguage().getMessage("command.moneyboost.output.jobsboostreset", "%jobname%", job.getName()));
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
Job job = Jobs.getJob(jobName);
|
||||
if (job == null) {
|
||||
sender.sendMessage(Jobs.getLanguage().getMessage("general.error.job"));
|
||||
return true;
|
||||
}
|
||||
|
||||
job.addBoost(CurrencyType.MONEY, rate, timeDuration);
|
||||
sender.sendMessage(Jobs.getLanguage().getMessage("command.moneyboost.output.boostadded", "%boost%", rate,
|
||||
"%jobname%", job.getName()));
|
||||
return true;
|
||||
}
|
||||
}
|
@ -1,106 +0,0 @@
|
||||
package com.gamingmesh.jobs.commands.list;
|
||||
|
||||
import org.bukkit.command.CommandSender;
|
||||
|
||||
import com.gamingmesh.jobs.Jobs;
|
||||
import com.gamingmesh.jobs.commands.Cmd;
|
||||
import com.gamingmesh.jobs.container.CurrencyType;
|
||||
import com.gamingmesh.jobs.container.Job;
|
||||
|
||||
import net.Zrips.CMILib.Time.timeModifier;
|
||||
|
||||
public class pointboost implements Cmd {
|
||||
|
||||
@Override
|
||||
public boolean perform(Jobs plugin, CommandSender sender, String[] args) {
|
||||
if (args.length > 3 || args.length <= 1) {
|
||||
Jobs.getCommandManager().sendUsage(sender, "pointboost");
|
||||
return true;
|
||||
}
|
||||
|
||||
Double rate = null;
|
||||
Long timeDuration = null;
|
||||
String jobName = null;
|
||||
boolean reset = false;
|
||||
|
||||
for (String one : args) {
|
||||
if (one.equalsIgnoreCase("reset")) {
|
||||
reset = true;
|
||||
continue;
|
||||
}
|
||||
|
||||
if (jobName == null) {
|
||||
jobName = one;
|
||||
continue;
|
||||
}
|
||||
|
||||
if (rate == null) {
|
||||
try {
|
||||
rate = Double.parseDouble(one);
|
||||
continue;
|
||||
} catch (NumberFormatException e) {
|
||||
}
|
||||
}
|
||||
|
||||
try {
|
||||
Long t = timeModifier.getTimeRangeFromString(one);
|
||||
if (t != null)
|
||||
timeDuration = t;
|
||||
continue;
|
||||
} catch (Exception e) {
|
||||
}
|
||||
}
|
||||
|
||||
if (!reset && rate == null || jobName == null) {
|
||||
Jobs.getCommandManager().sendUsage(sender, "moneyboost");
|
||||
return false;
|
||||
}
|
||||
|
||||
if (rate == null)
|
||||
rate = 1D;
|
||||
|
||||
if (timeDuration == null)
|
||||
timeDuration = 0L;
|
||||
|
||||
if (!reset && jobName.equalsIgnoreCase("all")) {
|
||||
for (Job job : Jobs.getJobs()) {
|
||||
job.addBoost(CurrencyType.POINTS, rate, timeDuration);
|
||||
}
|
||||
sender.sendMessage(Jobs.getLanguage().getMessage("command.pointboost.output.boostalladded", "%boost%", rate));
|
||||
return true;
|
||||
}
|
||||
|
||||
if (reset) {
|
||||
if (jobName.equalsIgnoreCase("all")) {
|
||||
for (Job one : Jobs.getJobs()) {
|
||||
one.addBoost(CurrencyType.POINTS, 1.0);
|
||||
}
|
||||
|
||||
sender.sendMessage(Jobs.getLanguage().getMessage("command.pointboost.output.allreset"));
|
||||
} else if (args.length > 1) {
|
||||
Job job = Jobs.getJob(jobName);
|
||||
if (job == null) {
|
||||
sender.sendMessage(Jobs.getLanguage().getMessage("general.error.job"));
|
||||
return true;
|
||||
}
|
||||
|
||||
job.addBoost(CurrencyType.POINTS, 1.0);
|
||||
|
||||
sender.sendMessage(Jobs.getLanguage().getMessage("command.pointboost.output.jobsboostreset", "%jobname%", job.getName()));
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
Job job = Jobs.getJob(jobName);
|
||||
if (job == null) {
|
||||
sender.sendMessage(Jobs.getLanguage().getMessage("general.error.job"));
|
||||
return true;
|
||||
}
|
||||
|
||||
job.addBoost(CurrencyType.POINTS, rate, timeDuration);
|
||||
sender.sendMessage(Jobs.getLanguage().getMessage("command.pointboost.output.boostadded", "%boost%", rate,
|
||||
"%jobname%", job.getName()));
|
||||
return true;
|
||||
}
|
||||
}
|
@ -107,7 +107,7 @@ public class GeneralConfigManager {
|
||||
EnableConfirmation, jobsInfoOpensBrowse, MonsterDamageUse, useMaxPaymentCurve, blockOwnershipTakeOver,
|
||||
hideJobsInfoWithoutPermission, UseTaxes, TransferToServerAccount, TakeFromPlayersPayment, AutoJobJoinUse, AllowDelevel, RomanNumbers,
|
||||
BossBarEnabled = false, BossBarShowOnEachAction = false, BossBarsMessageByDefault = false, ExploreCompact, DBCleaningJobsUse, DBCleaningUsersUse,
|
||||
DisabledWorldsUse, UseAsWhiteListWorldList, PaymentMethodsMoney, PaymentMethodsPoints, PaymentMethodsExp, MythicMobsEnabled,
|
||||
DisabledWorldsUse, UseAsWhiteListWorldList, MythicMobsEnabled,
|
||||
LoggingUse, payForCombiningItems, BlastFurnacesReassign = false, SmokerReassign = false, payForStackedEntities, payForAbove = false,
|
||||
payForEachVTradeItem, allowEnchantingBoostedItems, bossBarAsync = false, preventShopItemEnchanting;
|
||||
|
||||
@ -586,9 +586,10 @@ public class GeneralConfigManager {
|
||||
c.addComment("Economy.PaymentMethods",
|
||||
"By disabling one of these, players no longer will get particular payment.",
|
||||
"Useful for removing particular payment method without editing whole jobConfig file");
|
||||
PaymentMethodsMoney = c.get("Economy.PaymentMethods.Money", true);
|
||||
PaymentMethodsPoints = c.get("Economy.PaymentMethods.Points", true);
|
||||
PaymentMethodsExp = c.get("Economy.PaymentMethods.Exp", true);
|
||||
|
||||
for (CurrencyType one : CurrencyType.values()) {
|
||||
one.setEnabled(c.get("Economy.PaymentMethods." + one.getName(), true));
|
||||
}
|
||||
|
||||
c.addComment("Economy.GeneralMulti",
|
||||
"Can be used to change payment amounts for all jobs and all actions if you want to readjust them",
|
||||
|
@ -7,6 +7,7 @@ import java.util.Iterator;
|
||||
import java.util.List;
|
||||
|
||||
import com.gamingmesh.jobs.Jobs;
|
||||
import com.gamingmesh.jobs.container.CurrencyType;
|
||||
import com.gamingmesh.jobs.stuff.Util;
|
||||
|
||||
import net.Zrips.CMILib.FileHandler.ConfigReader;
|
||||
@ -79,6 +80,19 @@ public class LanguageManager {
|
||||
c.get("limitedItem.error.levelup", "&cYou need to level up in [jobname] to use this item!");
|
||||
c.get("general.info.toplineseparator", "&7*********************** &6%playerdisplayname% &7***********************");
|
||||
c.get("general.info.separator", "&7*******************************************************");
|
||||
|
||||
for (CurrencyType curr : CurrencyType.values()) {
|
||||
c.get("general.info.paymentType." + curr.toString(), curr.getName());
|
||||
|
||||
String color = "&2";
|
||||
if (curr.equals(CurrencyType.POINTS))
|
||||
color = "&6";
|
||||
else if (curr.equals(CurrencyType.EXP))
|
||||
color = "&e";
|
||||
|
||||
c.get("general.info.paymentTypeValued." + curr.toString(), color + curr.getName() + ": %amount%");
|
||||
}
|
||||
|
||||
c.get("general.info.invalidPage", "&cInvalid page");
|
||||
c.get("general.info.blocks.furnace", "Furnace");
|
||||
c.get("general.info.blocks.smoker", "Smoker");
|
||||
@ -107,35 +121,17 @@ public class LanguageManager {
|
||||
|
||||
c.get("command.help.output.title", "&e-------&e ======= &6Jobs &e======= &e-------");
|
||||
|
||||
c.get("command.moneyboost.help.info", "Boosts money gain for all players");
|
||||
c.get("command.moneyboost.help.args", "[jobname]/all/reset [time]/[rate]");
|
||||
Jobs.getGCManager().getCommandArgs().put("moneyboost", Arrays.asList("[jobname]%%all%%reset", "[time]%%2", "%%2"));
|
||||
c.get("command.moneyboost.output.allreset", "All money boosts turned off");
|
||||
c.get("command.moneyboost.output.jobsboostreset", "Money boost has been turned off for %jobname%");
|
||||
c.get("command.moneyboost.output.nothingtoreset", "Nothing to reset");
|
||||
c.get("command.moneyboost.output.boostalladded", "Money boost of %boost% added for all jobs!");
|
||||
c.get("command.moneyboost.output.boostadded", "Money boost of &e%boost% &aadded for &e%jobname%!");
|
||||
c.get("command.moneyboost.output.infostats", "&c-----> &aMoney rate x%boost% enabled&c <-------");
|
||||
|
||||
c.get("command.pointboost.help.info", "Boosts point gain for all players");
|
||||
c.get("command.pointboost.help.args", "[jobname]/all/reset [time]/[rate]");
|
||||
Jobs.getGCManager().getCommandArgs().put("pointboost", Arrays.asList("[jobname]%%all%%reset", "[time]%%2", "%%2"));
|
||||
c.get("command.pointboost.output.allreset", "All point boosts turned off");
|
||||
c.get("command.pointboost.output.jobsboostreset", "Point boost has been turned off for %jobname%");
|
||||
c.get("command.pointboost.output.nothingtoreset", "Nothing to reset");
|
||||
c.get("command.pointboost.output.boostalladded", "Points boost of %boost% added for all jobs!");
|
||||
c.get("command.pointboost.output.boostadded", "Points boost of &e%boost% &aadded for &e%jobname%!");
|
||||
c.get("command.pointboost.output.infostats", "&c-----> &aPoints rate x%boost% enabled&c <-------");
|
||||
|
||||
c.get("command.expboost.help.info", "Boosts exp gain for all players");
|
||||
c.get("command.expboost.help.args", "[jobname]/all/reset [time]/[rate]");
|
||||
Jobs.getGCManager().getCommandArgs().put("expboost", Arrays.asList("[jobname]%%all%%reset", "[time]%%2", "%%2"));
|
||||
c.get("command.expboost.output.allreset", "All exp boosts turned off");
|
||||
c.get("command.expboost.output.jobsboostreset", "Exp boost has been turned off for %jobname%");
|
||||
c.get("command.expboost.output.nothingtoreset", "Nothing to reset");
|
||||
c.get("command.expboost.output.boostalladded", "Exp boost of %boost% added for all jobs!");
|
||||
c.get("command.expboost.output.boostadded", "Exp boost of &e%boost% &aadded for &e%jobname%!");
|
||||
c.get("command.expboost.output.infostats", "&c-----> &aExp rate x%boost% enabled&c <-------");
|
||||
c.get("command.boost.help.info", "Boosts jobs gains for all players");
|
||||
c.get("command.boost.help.args", "exp/money/points [jobname]/all/reset [rate] [time]");
|
||||
Jobs.getGCManager().getCommandArgs().put("boost", Arrays.asList("[jobname]", "reset%%exp%%money%%points", "[time]%%2", "%%2"));
|
||||
c.get("command.boost.output.allreset", "&aAll boosts turned off");
|
||||
c.get("command.boost.output.alltypereset", "&aAll &e%type% &aboosts turned off");
|
||||
c.get("command.boost.output.jobsboostreset", "&aBoost has been turned off for &e%jobname%");
|
||||
c.get("command.boost.output.jobstypeboostreset", "&e%type% &aboost has been turned off for &e%jobname%");
|
||||
c.get("command.boost.output.nothingtoreset", "Nothing to reset");
|
||||
c.get("command.boost.output.boostadded", "&aBoost of &e%boost% &aadded for &e%jobname%!");
|
||||
c.get("command.boost.output.infostats", "&c-----> &a%type% rate x%boost% enabled&c <-------");
|
||||
c.get("command.boost.output.boostStats", "&6%payments% &e%jobname%");
|
||||
|
||||
c.get("command.schedule.help.info", "Enables the given scheduler");
|
||||
c.get("command.schedule.help.args", "enable [scheduleName] [untilTime]");
|
||||
|
@ -24,12 +24,14 @@ public class BoostMultiplier implements Cloneable {
|
||||
|
||||
public BoostMultiplier add(CurrencyType type, double amount) {
|
||||
map.put(type, amount);
|
||||
timers.remove(type);
|
||||
return this;
|
||||
}
|
||||
|
||||
public BoostMultiplier add(CurrencyType type, double amount, long time) {
|
||||
add(type, amount);
|
||||
timers.put(type, time);
|
||||
return add(type, amount);
|
||||
return this;
|
||||
}
|
||||
|
||||
public BoostMultiplier add(double amount) {
|
||||
|
@ -18,6 +18,8 @@
|
||||
|
||||
package com.gamingmesh.jobs.container;
|
||||
|
||||
import com.gamingmesh.jobs.Jobs;
|
||||
|
||||
public enum CurrencyType {
|
||||
MONEY("Money", 1),
|
||||
EXP("Exp", 2),
|
||||
@ -25,6 +27,7 @@ public enum CurrencyType {
|
||||
|
||||
private String name;
|
||||
private int id = 0;
|
||||
private boolean enabled = true;
|
||||
|
||||
CurrencyType(String name, int id) {
|
||||
this.name = name;
|
||||
@ -54,4 +57,16 @@ public enum CurrencyType {
|
||||
public int getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public String getDisplayName() {
|
||||
return Jobs.getLanguage().getMessage("general.info.paymentType." + this.toString());
|
||||
}
|
||||
|
||||
public boolean isEnabled() {
|
||||
return enabled;
|
||||
}
|
||||
|
||||
public void setEnabled(boolean enabled) {
|
||||
this.enabled = enabled;
|
||||
}
|
||||
}
|
||||
|
@ -113,7 +113,7 @@ public class JobInfo {
|
||||
public double getIncome(double level, int numjobs, int maxJobs) {
|
||||
if (softIncomeLevelLimit != null && level > softIncomeLevelLimit)
|
||||
level = softIncomeLevelLimit;
|
||||
if (baseIncome == 0 || !Jobs.getGCManager().PaymentMethodsMoney)
|
||||
if (baseIncome == 0 || !CurrencyType.MONEY.isEnabled())
|
||||
return 0;
|
||||
moneyEquation.setVariable("joblevel", level);
|
||||
moneyEquation.setVariable("numjobs", numjobs);
|
||||
@ -125,7 +125,7 @@ public class JobInfo {
|
||||
public double getExperience(double level, int numjobs, int maxJobs) {
|
||||
if (softExpLevelLimit != null && level > softExpLevelLimit)
|
||||
level = softExpLevelLimit;
|
||||
if (baseXp == 0 || !Jobs.getGCManager().PaymentMethodsExp)
|
||||
if (baseXp == 0 || !CurrencyType.EXP.isEnabled())
|
||||
return 0;
|
||||
xpEquation.setVariable("joblevel", level);
|
||||
xpEquation.setVariable("numjobs", numjobs);
|
||||
@ -137,7 +137,7 @@ public class JobInfo {
|
||||
public double getPoints(double level, int numjobs, int maxJobs) {
|
||||
if (softPointsLevelLimit != null && level > softPointsLevelLimit)
|
||||
level = softPointsLevelLimit;
|
||||
if (basePoints == 0 || !Jobs.getGCManager().PaymentMethodsPoints)
|
||||
if (basePoints == 0 || !CurrencyType.POINTS.isEnabled())
|
||||
return 0;
|
||||
pointsEquation.setVariable("joblevel", level);
|
||||
pointsEquation.setVariable("numjobs", numjobs);
|
||||
|
@ -60,7 +60,7 @@ public final class TabComplete implements TabCompleter {
|
||||
temp.addAll(Jobs.getScheduleManager().getConf().getConfig().getConfigurationSection("Boost").getKeys(false));
|
||||
break;
|
||||
case "[time]":
|
||||
temp.add("1hour10minute20s");
|
||||
temp.add("1h10m20s");
|
||||
break;
|
||||
case "[questname]":
|
||||
case "[quest]":
|
||||
|
Loading…
Reference in New Issue
Block a user