mirror of
https://github.com/TotalFreedomMC/TF-EssentialsX.git
synced 2025-08-04 19:46:27 +00:00
Filter out comment lines when loading items.json
This commit is contained in:
parent
73bb41d579
commit
a7fcafb245
1 changed files with 7 additions and 1 deletions
|
@ -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…
Add table
Add a link
Reference in a new issue