Package net.minecraftforge.common.config

Examples of net.minecraftforge.common.config.Configuration.save()


  @Mod.EventHandler
  public void preInit(FMLPreInitializationEvent evt) {
    final File configFile = evt.getSuggestedConfigurationFile();
    Configuration config = new Configuration(configFile);
    ConfigProcessing.processAnnotations(configFile, ModInfo.ID, config, Config.class);
    if (config.hasChanged()) config.save();
  }

  @Mod.EventHandler
  public void init(FMLInitializationEvent evt) {
    ClientCommandHandler.instance.registerCommand(new CommandDump());
View Full Code Here


            FMLLog.log(Level.ERROR, e, "IronChest has a problem loading it's configuration");
        }
        finally
        {
            if (cfg.hasChanged())
                cfg.save();
        }
        ironChestBlock = new BlockIronChest();
        GameRegistry.registerBlock(ironChestBlock, ItemIronChest.class, "BlockIronChest");
        PacketHandler.INSTANCE.ordinal();
    }
View Full Code Here

        seaLevel = config.get("general", "Sea level", 64).getInt(64);

        /* Save the configuration file */
        if(config.hasChanged())
             config.save();
    }

    /* Prototype fields, used elsewhere */

    public static int seaLevel;
View Full Code Here

           
            useforcedchunks = cfg.get("Settings""UseForcedChunks", true).getBoolean(true);
        }
        finally
        {
            cfg.save();
        }

    }

    @EventHandler
View Full Code Here

                    // not an integer
                }
            }
        }

        config.save();

    }
}
View Full Code Here

        for (Entry<String, Object> entry : objectData.getAllFields())
        {
            writeFieldToProperty(cfg, type.getFileSafeName(), entry.getKey(), entry.getValue());
        }

        cfg.save();

        return wasSuccessful;
    }

    @Override
View Full Code Here

    unloadedModules.removeAll(toLoad);
    loadedModules.addAll(toLoad);

    if (config.hasChanged())
      config.save();

    Locale.setDefault(locale);

    stage = Stage.PRE_INIT;
    for (Module m : loadedModules) {
View Full Code Here

        unloadedModules.removeAll(toLoad);
        loadedModules.addAll(toLoad);

        if (config.hasChanged())
            config.save();

        Locale.setDefault(locale);

        for (Module m : loadedModules) {
            preInit(m);
View Full Code Here

        config.get("Helmet_Options" + Configuration.CATEGORY_SPLITTER + "Block_Tracker", "stat Y", 46).set(blockTrackInfo.getBaseY());
        config.get("Helmet_Options" + Configuration.CATEGORY_SPLITTER + "Block_Tracker", "stat leftsided", true).set(blockTrackInfo.isLeftSided());
        statX = blockTrackInfo.getBaseX();
        statY = blockTrackInfo.getBaseY();
        statLeftSided = blockTrackInfo.isLeftSided();
        config.save();
    }

    @Override
    public void update(EntityPlayer player, int rangeUpgrades){
        ticksExisted++;
View Full Code Here

            messagesStatLeftSided = testMessageStat.isLeftSided();
            messagesStatX = testMessageStat.getBaseX();
            messagesStatY = testMessageStat.getBaseY();
            messagesStatLeftSided = testMessageStat.isLeftSided();
        }
        config.save();
    }

    @Override
    @SideOnly(Side.CLIENT)
    public void update(EntityPlayer player, int rangeUpgrades){
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.