= Improved reload, but not for localized commands or enabling yet. Must be restarted first.
This commit is contained in:
@@ -169,7 +169,6 @@ public abstract class BaseLocFile implements IConfigSection
|
|||||||
@Override
|
@Override
|
||||||
public void consume(List<ConfigItem> pairs)
|
public void consume(List<ConfigItem> pairs)
|
||||||
{
|
{
|
||||||
GlobalLog.log("Ok nice!");
|
|
||||||
localized.clear();
|
localized.clear();
|
||||||
buildLocalized(pairs);
|
buildLocalized(pairs);
|
||||||
scrapeAll();
|
scrapeAll();
|
||||||
|
|||||||
@@ -5,7 +5,6 @@ import java.util.Collections;
|
|||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Vector;
|
import java.util.Vector;
|
||||||
import dataStructures.Pair;
|
|
||||||
import utils.GlobalLog;
|
import utils.GlobalLog;
|
||||||
import utils.LogFilter;
|
import utils.LogFilter;
|
||||||
|
|
||||||
@@ -50,6 +49,9 @@ public class CommandEnabler implements IConfigSection
|
|||||||
// Reads in the config file and parses it, keeping tabs on the order it read things
|
// Reads in the config file and parses it, keeping tabs on the order it read things
|
||||||
private void readIn(List<ConfigItem> items)
|
private void readIn(List<ConfigItem> items)
|
||||||
{
|
{
|
||||||
|
keyList.clear();
|
||||||
|
enabledMap.clear();
|
||||||
|
|
||||||
for(ConfigItem item : items)
|
for(ConfigItem item : items)
|
||||||
{
|
{
|
||||||
String key = item.key;
|
String key = item.key;
|
||||||
@@ -90,7 +92,7 @@ public class CommandEnabler implements IConfigSection
|
|||||||
private List<ConfigItem> writeOut()
|
private List<ConfigItem> writeOut()
|
||||||
{
|
{
|
||||||
// Parse in original format
|
// Parse in original format
|
||||||
List<Pair<String, String>> list = new Vector<Pair<String, String>>();
|
List<ConfigItem> configItems = new Vector<ConfigItem>();
|
||||||
|
|
||||||
for(int i = 0; i < keyList.size(); ++i)
|
for(int i = 0; i < keyList.size(); ++i)
|
||||||
{
|
{
|
||||||
@@ -102,19 +104,11 @@ public class CommandEnabler implements IConfigSection
|
|||||||
value = disabled.toLowerCase();
|
value = disabled.toLowerCase();
|
||||||
}
|
}
|
||||||
|
|
||||||
list.add(new Pair<String, String>(key, value));
|
configItems.add(new ConfigItem(HeaderName, key, value));
|
||||||
}
|
|
||||||
|
|
||||||
Collections.sort(list, (c1, c2) -> { return c1.First.compareTo(c2.First); });
|
|
||||||
|
|
||||||
// Convert to new ConfigItem list format for return
|
|
||||||
List<ConfigItem> configItems = new Vector<ConfigItem>();
|
|
||||||
|
|
||||||
for(Pair<String, String> pair : list)
|
|
||||||
{
|
|
||||||
configItems.add(new ConfigItem(HeaderName, pair.First, pair.Second));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Collections.sort(configItems, (c1, c2) -> { return c1.key.compareTo(c2.key); });
|
||||||
|
|
||||||
return configItems;
|
return configItems;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user