Пример #1
0
 public VanillaSettingsProvider()
 {
     ServerProperties = new Dictionary <string, string>();
     keyLookup        = new Dictionary <string, string>();
     keyLookup.Add("server.port", "server-port");
     keyLookup.Add("level.type", "level-type");
     keyLookup.Add("server.rcon", "enable-rcon");
     keyLookup.Add("level.seed", "level-seed");
     keyLookup.Add("server.buildmax", "max-build-height");
     keyLookup.Add("server.mobs.villagers.enabled", "spawn-npcs");
     keyLookup.Add("server.whitelist.enabled", "white-list");
     keyLookup.Add("server.mobs.friendly.enabled", "spawn-animals");
     keyLookup.Add("server.snoop.enabled", "snooper-enabled");
     keyLookup.Add("server.hardcore.enabled", "hardcore");
     keyLookup.Add("server.texturepack", "texture-pack");
     keyLookup.Add("server.onlinemode", "online-mode");
     keyLookup.Add("server.pvp.enabled", "pvp");
     keyLookup.Add("level.gamemode", "gamemode");
     keyLookup.Add("server.maxplayers", "max-players");
     keyLookup.Add("server.mobs.hostile.enabled", "spawn-monsters");
     keyLookup.Add("level.generator.generatestructures", "generate-structures");
     keyLookup.Add("server.viewdistance", "view-distance");
     keyLookup.Add("server.motd", "motd");
     foreach (var key in keyLookup) // Set default keys
     {
         if (DefaultSettings.ContainsKey(key.Key))
         {
             Set(key.Key, Get <string>(key.Key)); // This works because it goes to the default setting provider when it can't find a key
         }
     }
 }
Пример #2
0
        public bool ContainsKey(string key)
        {
            bool local = ContainsKeyNoRecurse(key);

            if (local)
            {
                return(true);
            }
            return(DefaultSettings.ContainsKey(key));
        }