1
0
mirror of https://github.com/Zrips/Jobs.git synced 2025-01-02 14:29:07 +01:00

Change ":" to "-" in material actions for better match

This commit is contained in:
montlikadani 2021-02-20 15:16:36 +01:00
parent 5cd8550ba9
commit 2a941c76cb
5 changed files with 9 additions and 18 deletions

View File

@ -23,6 +23,6 @@ public class BlockCollectInfo extends BaseActionInfo {
@Override
public String getNameWithSub() {
return getName() + ":" + ageOrLevel;
return getName() + "-" + ageOrLevel;
}
}

View File

@ -39,7 +39,7 @@ public abstract class MaterialActionInfo extends BaseActionInfo {
@Override
public String getNameWithSub() {
return getName() + ":" + data;
return getName() + "-" + data;
}
}

View File

@ -1083,10 +1083,6 @@ public class ConfigManager {
continue;
}
int id = itemSection.getInt("id");
String name = itemSection.getString("name");
List<String> lore = new ArrayList<>();
if (itemSection.isList("lore"))
itemSection.getStringList("lore").stream().map(CMIChatColor::translate).forEach(lore::add);
@ -1109,9 +1105,9 @@ public class ConfigManager {
enchants.put(ench, level);
}
int level = itemSection.getInt("level");
String node = itemKey.toLowerCase();
jobLimitedItems.put(node, new JobLimitedItems(node, id, 0, 1, name, lore, enchants, level));
jobLimitedItems.put(node, new JobLimitedItems(node, itemSection.getInt("id"), 0, 1, itemSection.getString("name"),
lore, enchants, itemSection.getInt("level")));
}
}
@ -1233,9 +1229,9 @@ public class ConfigManager {
for (ActionType actionType : ActionType.values()) {
ConfigurationSection typeSection = jobSection.getConfigurationSection(actionType.getName());
ArrayList<JobInfo> jobInfo = new ArrayList<>();
List<JobInfo> jobInfo = new ArrayList<>();
if (typeSection != null) {
if (typeSection.isList("materials")) {
if (!typeSection.getStringList("materials").isEmpty()) {
for (String mat : typeSection.getStringList("materials")) {
if (!mat.contains(";")) {
continue;
@ -1327,7 +1323,7 @@ public class ConfigManager {
Integer itemSoftPointsLimit = softPointsLimit;
if (section.isInt("softPointsLimit"))
itemSoftPointsLimit = section.getInt("softPointsLimit");
jobInfo.add(new JobInfo(actionType, id, meta, type + subType, income, incomeEquation, experience, expEquation, pointsEquation, points, fromlevel,
untilLevel, section.getCurrentPath(), itemSoftIncomeLimit, itemSoftExpLimit, itemSoftPointsLimit));
}

View File

@ -33,9 +33,7 @@ public class JobInfo {
private int untilLevel = Integer.MAX_VALUE;
private String configPath = "";
private Integer softIncomeLevelLimit;
private Integer softExpLevelLimit;
private Integer softPointsLevelLimit;
private Integer softIncomeLevelLimit, softExpLevelLimit, softPointsLevelLimit;
public JobInfo(ActionType actionType, int id, String meta, String name, double baseIncome, Parser moneyEquation, double baseXp, Parser xpEquation,
Parser pointsEquation, double basePoints, int fromLevel, int untilLevel, String configPath) {
@ -150,10 +148,6 @@ public class JobInfo {
return configPath;
}
public void setConfigPath(String configPath) {
this.configPath = configPath;
}
public void setBaseIncome(double baseIncome) {
this.baseIncome = baseIncome;
}

View File

@ -1222,6 +1222,7 @@ public abstract class JobsDAO {
prestt.setInt(2, job.getId());
prestt.execute();
} catch (SQLException e) {
e.printStackTrace();
} finally {
close(prestt);
close(res);