1
0
mirror of https://github.com/Zrips/Jobs.git synced 2025-01-06 16:27:59 +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 @Override
public String getNameWithSub() { public String getNameWithSub() {
return getName() + ":" + ageOrLevel; return getName() + "-" + ageOrLevel;
} }
} }

View File

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

View File

@ -1083,10 +1083,6 @@ public class ConfigManager {
continue; continue;
} }
int id = itemSection.getInt("id");
String name = itemSection.getString("name");
List<String> lore = new ArrayList<>(); List<String> lore = new ArrayList<>();
if (itemSection.isList("lore")) if (itemSection.isList("lore"))
itemSection.getStringList("lore").stream().map(CMIChatColor::translate).forEach(lore::add); itemSection.getStringList("lore").stream().map(CMIChatColor::translate).forEach(lore::add);
@ -1109,9 +1105,9 @@ public class ConfigManager {
enchants.put(ench, level); enchants.put(ench, level);
} }
int level = itemSection.getInt("level");
String node = itemKey.toLowerCase(); 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()) { for (ActionType actionType : ActionType.values()) {
ConfigurationSection typeSection = jobSection.getConfigurationSection(actionType.getName()); ConfigurationSection typeSection = jobSection.getConfigurationSection(actionType.getName());
ArrayList<JobInfo> jobInfo = new ArrayList<>(); List<JobInfo> jobInfo = new ArrayList<>();
if (typeSection != null) { if (typeSection != null) {
if (typeSection.isList("materials")) { if (!typeSection.getStringList("materials").isEmpty()) {
for (String mat : typeSection.getStringList("materials")) { for (String mat : typeSection.getStringList("materials")) {
if (!mat.contains(";")) { if (!mat.contains(";")) {
continue; continue;

View File

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

View File

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