Preserve order of entries in the lists read from the configuration.

This commit is contained in:
asofold 2012-06-24 03:22:56 +02:00
parent f6b666220f
commit a59efb80f9
3 changed files with 9 additions and 5 deletions

View File

@ -20,4 +20,8 @@ STACK
VERSION HISTORY
---------------------------
(0.1.0)
- (add) List to enable plugins: plugins.ensure-enable [Forces their events to be processed before NoCheatPlus gets them!]
- (bugfix) Preserve order of entries in the lists read from the configuration.
(0.0.0) [initial version]

View File

@ -3,7 +3,7 @@ package me.asofold.bukkit.cncp;
import java.io.File;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.HashSet;
import java.util.LinkedHashSet;
import java.util.Map;
import java.util.Set;
import java.util.logging.Logger;
@ -168,7 +168,7 @@ public class CompatNoCheatPlus extends JavaPlugin implements Listener {
}
public boolean reloadSettings() {
final Set<String> oldForceEnableLater = new HashSet<String>();
final Set<String> oldForceEnableLater = new LinkedHashSet<String>();
oldForceEnableLater.addAll(settings.forceEnableLater);
// Read and apply config to settings:
File file = new File(getDataFolder() , "cncp.yml");

View File

@ -1,7 +1,7 @@
package me.asofold.bukkit.cncp.setttings;
import java.util.Arrays;
import java.util.HashSet;
import java.util.LinkedHashSet;
import java.util.Set;
import me.asofold.bukkit.cncp.config.compatlayer.CompatConfig;
@ -9,8 +9,8 @@ import me.asofold.bukkit.cncp.config.compatlayer.ConfigUtil;
import me.asofold.bukkit.cncp.config.compatlayer.NewConfig;
public class Settings {
public Set<String> forceEnableLater = new HashSet<String>();
public Set<String> loadPlugins = new HashSet<String>();
public Set<String> forceEnableLater = new LinkedHashSet<String>();
public Set<String> loadPlugins = new LinkedHashSet<String>();
public static CompatConfig getDefaultConfig(){
CompatConfig cfg = new NewConfig(null);