diff --git a/src/main/java/org/shanerx/tradeshop/enumys/SettingSectionKeys.java b/src/main/java/org/shanerx/tradeshop/enumys/SettingSectionKeys.java index 754c7f78..6e3e309d 100644 --- a/src/main/java/org/shanerx/tradeshop/enumys/SettingSectionKeys.java +++ b/src/main/java/org/shanerx/tradeshop/enumys/SettingSectionKeys.java @@ -68,7 +68,7 @@ public enum SettingSectionKeys { this.key = key; this.sectionHeader = sectionHeader; this.postComment = postComment; - this.preComment = preComment; + this.preComment = fixPreCommentNewLines(preComment); if (!key.isEmpty()) this.value_lead = " "; } @@ -78,7 +78,7 @@ public enum SettingSectionKeys { this.sectionHeader = sectionHeader; this.parent = parent; this.postComment = postComment; - this.preComment = preComment; + this.preComment = fixPreCommentNewLines(preComment); if (!key.isEmpty()) this.value_lead = parent.value_lead + " "; } @@ -148,4 +148,8 @@ public SettingSectionKeys getParent() { public boolean hasParent() { return parent != null; } + + private String fixPreCommentNewLines(String str) { + return str.replace("\n ", "\n" + getValueLead() + "# "); + } } diff --git a/src/main/java/org/shanerx/tradeshop/objects/IllegalItemList.java b/src/main/java/org/shanerx/tradeshop/objects/IllegalItemList.java index 6639ea81..fd0acbc0 100644 --- a/src/main/java/org/shanerx/tradeshop/objects/IllegalItemList.java +++ b/src/main/java/org/shanerx/tradeshop/objects/IllegalItemList.java @@ -82,6 +82,10 @@ public boolean add(Material mat) { return list.add(mat); } + public boolean remove(Material mat) { + return list.remove(mat); + } + public void addColourSet(String mat) { List colourSet = Arrays.asList("BLACK", "RED", "GREEN", "BROWN", "BLUE", "PURPLE", "LIGHT_BLUE", "LIGHT_GRAY", "GRAY", "PINK", "LIME", "YELLOW", "CYAN", "MAGENTA", "ORANGE", "WHITE"); diff --git a/src/main/java/org/shanerx/tradeshop/objects/ListManager.java b/src/main/java/org/shanerx/tradeshop/objects/ListManager.java index 97989256..a1b1ed1b 100644 --- a/src/main/java/org/shanerx/tradeshop/objects/ListManager.java +++ b/src/main/java/org/shanerx/tradeshop/objects/ListManager.java @@ -147,6 +147,10 @@ private void updateIllegalLists() { globalList.add(Material.AIR); globalList.add(Material.CAVE_AIR); globalList.add(Material.VOID_AIR); + } else if (globalList.getType().equals(ListType.WHITELIST)) { + globalList.remove(Material.AIR); + globalList.remove(Material.CAVE_AIR); + globalList.remove(Material.VOID_AIR); } for (String str : Setting.GLOBAL_ILLEGAL_ITEMS_LIST.getStringList()) {