mirror of
https://github.com/Zrips/Jobs.git
synced 2025-01-08 01:08:23 +01:00
Fix when the bonus not works correctly
https://github.com/Zrips/Jobs/issues/365#issuecomment-664134673
This commit is contained in:
parent
ba9610618a
commit
47d4cd1258
@ -144,7 +144,6 @@ public class PermissionManager {
|
|||||||
try {
|
try {
|
||||||
t = Double.parseDouble(uno.getKey().replace(perm, ""));
|
t = Double.parseDouble(uno.getKey().replace(perm, ""));
|
||||||
} catch (NumberFormatException e) {
|
} catch (NumberFormatException e) {
|
||||||
continue;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
amount += t;
|
amount += t;
|
||||||
|
@ -478,7 +478,7 @@ public class Placeholder {
|
|||||||
CurrencyType.getByName(vals.get(1))));
|
CurrencyType.getByName(vals.get(1))));
|
||||||
case user_jtoplvl_$1_$2:
|
case user_jtoplvl_$1_$2:
|
||||||
vals = placeHolder.getComplexValues(value);
|
vals = placeHolder.getComplexValues(value);
|
||||||
if (vals.isEmpty())
|
if (vals.isEmpty() || vals.size() < 2)
|
||||||
return "";
|
return "";
|
||||||
|
|
||||||
Job job = getJobFromValue(vals.get(0));
|
Job job = getJobFromValue(vals.get(0));
|
||||||
|
@ -1039,6 +1039,7 @@ public class JobsPlayer {
|
|||||||
int i = g.size();
|
int i = g.size();
|
||||||
while (i > 0) {
|
while (i > 0) {
|
||||||
--i;
|
--i;
|
||||||
|
|
||||||
g.remove(g.entrySet().iterator().next().getKey());
|
g.remove(g.entrySet().iterator().next().getKey());
|
||||||
|
|
||||||
if (g.size() <= job.getMaxDailyQuests())
|
if (g.size() <= job.getMaxDailyQuests())
|
||||||
@ -1082,20 +1083,20 @@ public class JobsPlayer {
|
|||||||
|
|
||||||
for (QuestProgression one : getQuestProgressions()) {
|
for (QuestProgression one : getQuestProgressions()) {
|
||||||
Quest q = one.getQuest();
|
Quest q = one.getQuest();
|
||||||
if (q == null) {
|
if (q == null || q.getObjectives().isEmpty())
|
||||||
continue;
|
continue;
|
||||||
}
|
|
||||||
|
|
||||||
if (q.getObjectives().isEmpty())
|
|
||||||
continue;
|
|
||||||
if (!prog.isEmpty())
|
if (!prog.isEmpty())
|
||||||
prog += ";:;";
|
prog += ";:;";
|
||||||
|
|
||||||
prog += q.getJob().getName() + ":" + q.getConfigName() + ":" + one.getValidUntil() + ":";
|
prog += q.getJob().getName() + ":" + q.getConfigName() + ":" + one.getValidUntil() + ":";
|
||||||
|
|
||||||
for (Entry<ActionType, HashMap<String, QuestObjective>> oneA : q.getObjectives().entrySet()) {
|
for (Entry<ActionType, HashMap<String, QuestObjective>> oneA : q.getObjectives().entrySet()) {
|
||||||
for (Entry<String, QuestObjective> oneO : oneA.getValue().entrySet()) {
|
for (Entry<String, QuestObjective> oneO : oneA.getValue().entrySet()) {
|
||||||
prog += oneO.getValue().getAction().toString() + ";" + oneO.getKey() + ";" + one.getAmountDone(oneO.getValue()) + ":;:";
|
prog += oneO.getValue().getAction().toString() + ";" + oneO.getKey() + ";" + one.getAmountDone(oneO.getValue()) + ":;:";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
prog = prog.endsWith(":;:") ? prog.substring(0, prog.length() - 3) : prog;
|
prog = prog.endsWith(":;:") ? prog.substring(0, prog.length() - 3) : prog;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1105,21 +1106,18 @@ public class JobsPlayer {
|
|||||||
public void setQuestProgressionFromString(String qprog) {
|
public void setQuestProgressionFromString(String qprog) {
|
||||||
if (qprog == null || qprog.isEmpty())
|
if (qprog == null || qprog.isEmpty())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
String[] byJob = qprog.split(";:;");
|
String[] byJob = qprog.split(";:;");
|
||||||
|
|
||||||
for (String one : byJob) {
|
for (String one : byJob) {
|
||||||
|
|
||||||
try {
|
try {
|
||||||
String jname = one.split(":")[0];
|
String jname = one.split(":")[0];
|
||||||
Job job = Jobs.getJob(jname);
|
Job job = Jobs.getJob(jname);
|
||||||
|
|
||||||
if (job == null)
|
if (job == null)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
one = one.substring(jname.length() + 1);
|
one = one.substring(jname.length() + 1);
|
||||||
String qname = one.split(":")[0];
|
String qname = one.split(":")[0];
|
||||||
Quest quest = job.getQuest(qname);
|
Quest quest = job.getQuest(qname);
|
||||||
|
|
||||||
if (quest == null)
|
if (quest == null)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
@ -1143,13 +1141,11 @@ public class JobsPlayer {
|
|||||||
}
|
}
|
||||||
|
|
||||||
for (String oneA : one.split(":;:")) {
|
for (String oneA : one.split(":;:")) {
|
||||||
|
|
||||||
String prog = oneA.split(";")[0];
|
String prog = oneA.split(";")[0];
|
||||||
ActionType action = ActionType.getByName(prog);
|
ActionType action = ActionType.getByName(prog);
|
||||||
if (action == null)
|
if (action == null || oneA.length() < prog.length() + 1)
|
||||||
continue;
|
|
||||||
if (oneA.length() < prog.length() + 1)
|
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
oneA = oneA.substring(prog.length() + 1);
|
oneA = oneA.substring(prog.length() + 1);
|
||||||
|
|
||||||
String target = oneA.split(";")[0];
|
String target = oneA.split(";")[0];
|
||||||
@ -1158,7 +1154,6 @@ public class JobsPlayer {
|
|||||||
continue;
|
continue;
|
||||||
|
|
||||||
QuestObjective obj = old.get(target);
|
QuestObjective obj = old.get(target);
|
||||||
|
|
||||||
if (obj == null)
|
if (obj == null)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user