mirror of
https://github.com/EssentialsX/Essentials.git
synced 2024-11-03 01:19:58 +01:00
Filter out comment lines when loading items.json
This commit is contained in:
parent
73bb41d579
commit
a7fcafb245
@ -20,6 +20,7 @@ import org.bukkit.potion.PotionEffect;
|
||||
|
||||
import java.util.*;
|
||||
import java.util.logging.Logger;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import static com.earth2me.essentials.I18n.tl;
|
||||
|
||||
@ -57,7 +58,12 @@ public class ItemDb implements IConf, net.ess3.api.IItemDb {
|
||||
|
||||
private void rebuild() {
|
||||
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() {
|
||||
|
Loading…
Reference in New Issue
Block a user