Filter out comment lines when loading items.json

This commit is contained in:
md678685 2018-10-27 15:00:04 +01:00
parent 73bb41d579
commit a7fcafb245

View File

@ -20,6 +20,7 @@ import org.bukkit.potion.PotionEffect;
import java.util.*; import java.util.*;
import java.util.logging.Logger; import java.util.logging.Logger;
import java.util.stream.Collectors;
import static com.earth2me.essentials.I18n.tl; import static com.earth2me.essentials.I18n.tl;
@ -57,7 +58,12 @@ public class ItemDb implements IConf, net.ess3.api.IItemDb {
private void rebuild() { private void rebuild() {
this.reset(); this.reset();
this.loadJSON(String.join("\n", file.getLines()));
String json = file.getLines().stream()
.filter(line -> !line.startsWith("#"))
.collect(Collectors.joining());
this.loadJSON(String.join("\n", json));
} }
private void reset() { private void reset() {