本文整理汇总了Java中net.minecraftforge.common.Configuration.hasChanged方法的典型用法代码示例。如果您正苦于以下问题:Java Configuration.hasChanged方法的具体用法?Java Configuration.hasChanged怎么用?Java Configuration.hasChanged使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类net.minecraftforge.common.Configuration
的用法示例。
在下文中一共展示了Configuration.hasChanged方法的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: preModInit
import net.minecraftforge.common.Configuration; //导入方法依赖的package包/类
@EventHandler
public void preModInit(FMLPreInitializationEvent event) {
Configuration cfg = new Configuration(event.getSuggestedConfigurationFile());
try {
cfg.load();
HandlersInit.DROPFISH = cfg.get(Configuration.CATEGORY_GENERAL, HandlersInit.DROPFISH_NAME, HandlersInit.DROPFISH_DEFAULT).getBoolean(HandlersInit.DROPFISH_DEFAULT);
HandlersInit.EGGDROPCHANCE = cfg.get(Configuration.CATEGORY_GENERAL, HandlersInit.EGGDROPCHANCE_NAME, HandlersInit.EGGDROPCHANCE_DEFAULT).getDouble(HandlersInit.EGGDROPCHANCE_DEFAULT);
HandlersInit.FISHCHANCE = cfg.get(Configuration.CATEGORY_GENERAL, HandlersInit.FISHCHANCE_NAME, HandlersInit.FISHCHANCE_DEFAULT).getDouble(HandlersInit.FISHCHANCE_DEFAULT);
} catch (Exception e) {
FMLLog.log(Level.SEVERE, e, ModLib.MOD_NAME + " has a problem loading it's configuration");
} finally {
if (cfg.hasChanged())
cfg.save();
}
LanguageRegistry.instance().loadLocalization(ModLib.LANG_RESOURCE_LOCATION + "en_US.xml", "en_US", true);
}
示例2: createConfig
import net.minecraftforge.common.Configuration; //导入方法依赖的package包/类
public static void createConfig(FMLPreInitializationEvent event) {
Configuration config = new Configuration(new File(event.getModConfigurationDirectory() + "Updater.cfg"));
try {
config.load();
DataProxy.versionurl = config.get(Reference.options, "URL used to check for updates", "http://www.dnstechpack.com/<path>").getString();
DataProxy.infourl = config.get(Reference.options, "URL used to provide update info", "http://www.dnstechpack.com/<path>").getString();
DataProxy.delay = config.get(Reference.options, "How long to wait before notifications are shown", 200).getInt();
Reference.updaterName = config.get(Reference.options, "Name of the modpack the updater will use", "DNS Techpack").getString();
Reference.outputColour = config.get(Reference.options, "The colout the updater will use", "green").getString();
Reference.allowCape = config.get(Reference.options, "Do you want to enable cape rendering", true).getBoolean(true);
} catch(Exception e) {
e.printStackTrace();
} finally {
if(config.hasChanged())
config.save();
}
}
示例3: preInit
import net.minecraftforge.common.Configuration; //导入方法依赖的package包/类
@EventHandler
public void preInit(FMLPreInitializationEvent evt) {
Configuration configFile = new Configuration(evt.getSuggestedConfigurationFile());
Config.readConfig(configFile);
if (configFile.hasChanged()) {
configFile.save();
}
Config.register();
NetworkRegistry.instance().registerGuiHandler(instance, OpenMods.proxy.wrapHandler(null));
proxy.preInit();
}
示例4: preInit
import net.minecraftforge.common.Configuration; //导入方法依赖的package包/类
@Mod.EventHandler
public void preInit(FMLPreInitializationEvent event) {
Configuration config = new Configuration(event.getSuggestedConfigurationFile());
config.load();
HandlerItem.init(config);
HandlerBlock.init(config);
if (config.hasChanged()) {
config.save();
}
proxy.registerRenders();
}
示例5: preInit
import net.minecraftforge.common.Configuration; //导入方法依赖的package包/类
@EventHandler
public void preInit(FMLPreInitializationEvent event) {
ObjectPool.init();
logger = event.getModLog();
config = new Configuration(event.getSuggestedConfigurationFile());
config.load();
settings.loadFromConfig(config);
if (config.hasChanged()) config.save();
executor = Executors.newFixedThreadPool(settings.threadPoolSize);
String physRulesName = event.getSuggestedConfigurationFile().toString().replace(".cfg", "-rules.cfg");
physicsRuleConfig = new Configuration(new File(physRulesName));
}
示例6: initConfig
import net.minecraftforge.common.Configuration; //导入方法依赖的package包/类
private void initConfig(FMLPreInitializationEvent event)
{
Configuration config = new Configuration(event.getSuggestedConfigurationFile());
config.load();
rendererFormat = config.get(Configuration.CATEGORY_GENERAL, ConfigKeys.format.toString(), Format.Interlaced.toString(),
configComment("sterescopic 3D output format to be used", Format.values()));
swapSides = config.get(Configuration.CATEGORY_GENERAL, ConfigKeys.swapSides.toString(), false,
configComment("whether to swap the left and right image", new Boolean[] { true, false })).getBoolean(false);
if (config.hasChanged()) {
config.save();
}
}
示例7: preModInit
import net.minecraftforge.common.Configuration; //导入方法依赖的package包/类
@EventHandler
public void preModInit(FMLPreInitializationEvent event) {
Configuration cfg = new Configuration(event.getSuggestedConfigurationFile());
try {
cfg.load();
// blockId =
// ItemsInit.COBBLEHAMMER = cfg.getBlock("standInBlock", 975).getInt(975);
// ItemsInit.WOODHAMMER = cfg.getBlock("standInBlock", 975).getInt(975);
ItemsInit.WOODHAMMER = cfg.getItem(ItemsInit.WOODHAMMER_NAME, ItemsInit.WOODHAMMER_DEFAULT).getInt(ItemsInit.WOODHAMMER_DEFAULT);
ItemsInit.COBBLEHAMMER = cfg.getItem(ItemsInit.COBBLEHAMMER_NAME, ItemsInit.COBBLEHAMMER_DEFAULT).getInt(ItemsInit.COBBLEHAMMER_DEFAULT);
ItemsInit.IRONHAMMER = cfg.getItem(ItemsInit.IRONHAMMER_NAME, ItemsInit.IRONHAMMER_DEFAULT).getInt(ItemsInit.IRONHAMMER_DEFAULT);
ItemsInit.GOLDHAMMER = cfg.getItem(ItemsInit.GOLDHAMMER_NAME, ItemsInit.GOLDHAMMER_DEFAULT).getInt(ItemsInit.GOLDHAMMER_DEFAULT);
ItemsInit.DIAMONDHAMMER = cfg.getItem(ItemsInit.DIAMONDHAMMER_NAME, ItemsInit.DIAMONDHAMMER_DEFAULT).getInt(ItemsInit.DIAMONDHAMMER_DEFAULT);
ItemsInit.FILLWAND = cfg.getItem(ItemsInit.FILLWAND_NAME, ItemsInit.FILLWAND_DEFAULT).getInt(ItemsInit.FILLWAND_DEFAULT);
ItemsInit.WOODPADDLE = cfg.getItem(ItemsInit.WOODPADDLE_NAME, ItemsInit.WOODPADDLE_DEFAULT).getInt(ItemsInit.WOODPADDLE_DEFAULT);
ItemsInit.COBBLEPADDLE = cfg.getItem(ItemsInit.COBBLEPADDLE_NAME, ItemsInit.COBBLEPADDLE_DEFAULT).getInt(ItemsInit.COBBLEPADDLE_DEFAULT);
ItemsInit.IRONPADDLE = cfg.getItem(ItemsInit.IRONPADDLE_NAME, ItemsInit.IRONPADDLE_DEFAULT).getInt(ItemsInit.IRONPADDLE_DEFAULT);
ItemsInit.GOLDPADDLE = cfg.getItem(ItemsInit.GOLDPADDLE_NAME, ItemsInit.GOLDPADDLE_DEFAULT).getInt(ItemsInit.GOLDPADDLE_DEFAULT);
ItemsInit.DIAMONDPADDLE = cfg.getItem(ItemsInit.DIAMONDPADDLE_NAME, ItemsInit.DIAMONDPADDLE_DEFAULT).getInt(ItemsInit.DIAMONDPADDLE_DEFAULT);
ItemsInit.CLEARALLBLOCKS = cfg.get(Configuration.CATEGORY_GENERAL, ItemsInit.CLEARALLBLOCKS_NAME, ItemsInit.CLEARALLBLOCKS_DEFAULT).getBoolean(ItemsInit.CLEARALLBLOCKS_DEFAULT);
// cfg.addCustomCategoryComment("LOVE_HATE_RELATIONSHIP", "Custom bools");
// boolean love = cfg.get("LOVE_HATE_RELATIONSHIP", "love", true).getBoolean(true);
// boolean hate = cfg.get("LOVE_HATE_RELATIONSHIP", "hate", false).getBoolean(false);
} catch (Exception e) {
FMLLog.log(Level.SEVERE, e, ModLib.MOD_NAME + " has a problem loading it's configuration");
} finally {
if (cfg.hasChanged())
cfg.save();
}
LanguageRegistry.instance().loadLocalization(ModLib.LANG_RESOURCE_LOCATION + "en_US.xml", "en_US", true);
// Initialize the Version Check Tick Handler (Client only)
// TickRegistry.registerTickHandler(new VersionCheckTickHandler(), Side.CLIENT);
// Initialize the Render Tick Handler (Client only)
proxy.registerRenderTickHandler();
// Register the KeyBinding Handler (Client only)
proxy.registerKeyBindingHandler();
// Register the Sound Handler (Client only)
proxy.registerSoundHandler();
ItemsInit.init();
}
示例8: Config
import net.minecraftforge.common.Configuration; //导入方法依赖的package包/类
public Config(Configuration config)
{
config.load();
// Cofigs for armor//
netherStarHelmetID = config.get("Item", "Nether Star Helmet", startItemID + ItemIncr++).getInt();
netherStarChestplateID = config.get("Item", "Nether Star Chestplate", startItemID + ItemIncr++).getInt();
netherStarLeggingsID = config.get("Item", "Nether Star Leggings", startItemID + ItemIncr++).getInt();
netherStarBootsID = config.get("Item", "Nether Star Boots", startItemID + ItemIncr++).getInt();
disableNetherStarHelmet = config.get("Options", "disable Nether Star Helmet", false).getBoolean(false);
disableNetherStarChestplate = config.get("Options", "disable Nether Star Chestplate", false).getBoolean(false);
disableNetherStarLeggings = config.get("Options", "disable Nether Star Leggings", false).getBoolean(false);
disableNetherStarBoots = config.get("Options", "disable Nether Star Boots", false).getBoolean(false);
// Configs for Items//
netherStarShardID = config.get("Item", "Nether Star Shard", startItemID + ItemIncr++).getInt();
netherStarNuggetID = config.get("Item", "Nether Star Nugget", startItemID + ItemIncr++).getInt();
enderHeartID = config.get("Item", "Ender Heart", startItemID + ItemIncr++).getInt();
DoublerID = config.get("Item", "Doubler", startItemID + ItemIncr++).getInt();
disableDragonEgg = config.get("Options", "disable Dragon Egg crafting", false).getBoolean(false);
// Configs for Food//
sugarCookieID = config.get("Item", "Sugar Cookie", startItemID + ItemIncr++).getInt();
sugarCookieDoughID = config.get("Item", "Sugar Cookie Dough", startItemID + ItemIncr++).getInt();
cookieDoughID = config.get("Item", "Cookie Dough", startItemID + ItemIncr++).getInt();
disableAlternateCookie = config.get("Options", "disable alternate cookie recipes", false).getBoolean(false);
// Configs for Tools//
netherStarSwordID = config.get("Item", "Nether Star Sword", startItemID + ItemIncr++).getInt();
netherStarShovelID = config.get("Item", "Nether Star Shovel", startItemID + ItemIncr++).getInt();
netherStarPickaxeID = config.get("Item", "Nether Star Pickaxe", startItemID + ItemIncr++).getInt();
netherStarAxeID = config.get("Item", "Nether Star Axe", startItemID + ItemIncr++).getInt();
netherStarHoeID = config.get("Item", "Nether Star Hoe", startItemID + ItemIncr++).getInt();
netherStarOmniToolID = config.get("Item", "Nether Star Omni Tool", startItemID + ItemIncr++).getInt();
netherStarBowID = config.get("Item", "Nether Star Bow", startItemID + ItemIncr++).getInt();
netherStarQuiverID = config.get("Item", "Nether Star Quiver", startItemID + ItemIncr++).getInt();
advancedClockID = config.get("Item", "Advanced Clock", startItemID + ItemIncr++).getInt();
weathermansCompassID = config.get("Item", "Weatherman's Clock", startItemID + ItemIncr++).getInt();
// talismanOfRecollectionID = config.get("Item", "Talisman Of Recollection", startItemID + ItemIncr++).getInt();
SpongeID = config.get("Item", "Sponge", startItemID + ItemIncr++).getInt();
blockPlacerID = config.get("Item", "Block Placer", startItemID + ItemIncr++).getInt();
controlPanelID = config.get("Item", "Control Panel", startItemID + ItemIncr++).getInt();
// Configs for suits of armor//
suitOfArmor_NetherStarID = config.get("Item", "Suit Of Armor - Nether Star", startItemID + ItemIncr++).getInt();
suitOfArmor_DiamondID = config.get("Item", "Suit Of Armor - Diamond", startItemID + ItemIncr++).getInt();
suitOfArmor_IronID = config.get("Item", "Suit Of Armor - Iron", startItemID + ItemIncr++).getInt();
suitOfArmor_GoldID = config.get("Item", "Suit Of Armor - Gold", startItemID + ItemIncr++).getInt();
// Configs for Blocks//
netherStarBlockID = config.get("Block", "Nether Star Block", startBlockID + BlockIncr++).getInt();
netherStarOreID = config.get("Block", "Nether Star Ore", startBlockID + BlockIncr++).getInt();
advancedFurnaceIdleID = config.get("Block", "Advanced Furnace (Idle)", startBlockID + BlockIncr++).getInt();
advancedFurnaceActiveID = config.get("Block", "Advanced Furnace (Active)", startBlockID + BlockIncr++).getInt();
mobCurtainID = config.get("Block", "Mob Curtain", startBlockID + BlockIncr++).getInt();
cobblestoneGeneratorID = config.get("Block", "Cobblestone Generator", startBlockID + BlockIncr++).getInt();
nerdPoleID = config.get("Block", "Nerd Pole", startBlockID + BlockIncr++).getInt();
LiquidRemove_HolderID = config.get("Block", "Sponge_utility", startBlockID + BlockIncr++).getInt();
RemoteInterfaceID = config.get("Block", "Remote Interface", startBlockID + BlockIncr++).getInt();
// Configs for fuels//
disableFuels = config.get("Options", "disable alternate smelting fuels", false).getBoolean(false);
//Configs for Doubler//
disableDoubler = config.get("Options", "disable item Doubler", false).getBoolean(false);
disableAdvancedDoubler = config.get("Options", "disable item Doubler NBT Copy (does not disable doubler completely)", false).getBoolean(false);
//Config for Options//
validDistance = config.get("Options", "Max Remote Interface Distance", 16).getInt(16);
if (config.hasChanged())
{
config.save();
}
}
示例9: init
import net.minecraftforge.common.Configuration; //导入方法依赖的package包/类
public static void init(FMLPreInitializationEvent event)
{
Configuration config = new Configuration(event.getSuggestedConfigurationFile());
InitializeConfig(config);
if (config.hasChanged()) config.save();
}
示例10: initProperties
import net.minecraftforge.common.Configuration; //导入方法依赖的package包/类
public static void initProperties(FMLPreInitializationEvent event) {
Configuration config = new Configuration(event.getSuggestedConfigurationFile());
config.load();
AltarID = config.getBlock("Altar", 2621).getInt();
AltarBlockID = config.getBlock("Altar Building Block", 2622).getInt();
SewingID = config.getBlock("Sewing", 2623).getInt();
BloodID = config.getBlock("Blood", 2625).getInt();
ScentBurnerID = config.getBlock("Scent Burner", 2626).getInt();
ScentID = config.getBlock("Scent", 2627).getInt();
BucketBloodID = config.getItem("BloodStationary", 2621).getInt();
ScytheID = config.getItem("Scythe", 2622).getInt();
ScytheBoneID = config.getItem("Bone Scythe", 2629).getInt();
GenericItemID = config.getItem("item", "main items", 2623).getInt();
NecronomiconID = config.getItem("item", "necronomicon", 2624).getInt();
OrgansID = config.getItem("item", "organs", 2625).getInt();
BodyPartID = config.getItem("item", "bodyparts", 2626).getInt();
SpawnerID = config.getItem("item", "spawner", 2628).getInt();
SearchMinionID = config.get("Entity", "Search for free Minion ID", true).getBoolean(true);
MinionID = SearchMinionID ? EntityRegistry.findGlobalUniqueEntityId() : config.get("entity", "Minion ID", 123).getInt();
SearchTeddyID = config.get("Entity", "Search for free Teddy ID", true).getBoolean(true);
TeddyID = SearchTeddyID ? EntityRegistry.findGlobalUniqueEntityId() : config.get("entity", "Teddy ID", 124).getInt();
SearchIsaacID = config.get("Entity", "Search for free Isaac ID", true).getBoolean(true);
IsaacID = SearchIsaacID ? EntityRegistry.findGlobalUniqueEntityId() : config.get("entity", "Isaac ID", 125).getInt();
SearchIsaacBloodID = config.get("Entity", "Search for free Isaac Blood ID", true).getBoolean(true);
IsaacBloodID = SearchIsaacBloodID ? EntityRegistry.findGlobalUniqueEntityId() : config.get("entity", "Isaac Blood ID", 126).getInt();
SearchIsaacBodyID = config.get("Entity", "Search for free Isaac Body ID", true).getBoolean(true);
IsaacBodyID = SearchIsaacBodyID ? EntityRegistry.findGlobalUniqueEntityId() : config.get("entity", "Isaac Body ID", 127).getInt();
SearchIsaacHeadID = config.get("Entity", "Search for free Isaac Head ID", true).getBoolean(true);
IsaacHeadID = SearchIsaacHeadID ? EntityRegistry.findGlobalUniqueEntityId() : config.get("entity", "Isaac Head ID", 128).getInt();
SearchNecroVillagerID = config.get("Entity", "Search for free Necro Villager ID", true).getBoolean(true);
NecroVillagerID = SearchNecroVillagerID ? EntityRegistry.findGlobalUniqueEntityId() : config.get("entity", "Necro Villager ID", 129).getInt();
IsaacsHeadID = config.getItem("armor", "Isaac's Severed Head", 2627).getInt();
Christmas = config.get("rendering", "christmas hats", false).getBoolean(false);
RenderSpecialScythe = config.get("special scythes (only for a select number of people)", "Other", true).getBoolean(false);
InitDuringPreInit = config.get("Init items during pre init", "Other", false).getBoolean(false);
NecroVillagerID = config.get("NecroVillagerID", "Other", 666).getInt();
if (config.hasChanged()) {
config.save();
}
}
示例11: preInit
import net.minecraftforge.common.Configuration; //导入方法依赖的package包/类
@Mod.EventHandler
public void preInit(FMLPreInitializationEvent event){
//Load Config, register blocks & Items
config = new Configuration(event.getSuggestedConfigurationFile());
config.load();
CAHCE_SIZE = config.get(Configuration.CATEGORY_GENERAL, "Cache Size", 25).getInt(25);
blockFlagPole = new BlockFlagPole(config.getBlock("Flag Pole Id", 2700).getInt(2700));
itemFlag = new ItemFlag(config.getItem("Flag Id", 24532).getInt());
registerBlock(blockFlagPole, "flagpole");
registerTileEntity(TileEntityFlagPole.class, "flagpole_tile");
Item.itemsList[blockFlagPole.blockID] = new ItemBlockFlagPole(blockFlagPole.blockID - 256);
for(int i = 0; i < 4; i++){
GameRegistry.addRecipe(new ItemStack(Item.itemsList[blockFlagPole.blockID], 4, i),
new Object[]{
"W",
"W",
"W", Character.valueOf('W'), new ItemStack(Block.wood, 1, i)
});
}
GameRegistry.addRecipe(new ItemStack(Item.itemsList[blockFlagPole.blockID], 4, 4),
new Object[]{
"I",
"I",
"I", Character.valueOf('I'), Item.ingotIron
});
period = ((10-config.get(Configuration.CATEGORY_GENERAL, "Flag Speed", 3).getInt(3)) * 100) + 250;
period = Math.max(period, 250);
period = Math.min(period, 1250);
if(config.get(Configuration.CATEGORY_GENERAL, "Use System L&F", true).getBoolean(true)){
try {
// Set System L&F
UIManager.setLookAndFeel(
UIManager.getSystemLookAndFeelClassName());
}
catch (Exception e) {e.printStackTrace();}
}
FcLoadImages = config.get(Configuration.CATEGORY_GENERAL, "Load Images in FileChooser", true).getBoolean(true);
flag_sections = config.get(Configuration.CATEGORY_GENERAL, "Animation Detail Level", 16).getInt(16);
flag_sections = Math.max(0, flag_sections);
DISPLAY_INSTRUCTIONS = config.get(Configuration.CATEGORY_GENERAL, "Display Instruction Message", true).getBoolean(true);
addRecipe(new FlagRecipie());
if(config.hasChanged()){
config.save();
}
}
示例12: init
import net.minecraftforge.common.Configuration; //导入方法依赖的package包/类
public static void init(FMLPreInitializationEvent event) {
File configFile = new File(event.getModConfigurationDirectory(), Reference.modName + ".cfg");
Configuration config = new Configuration(configFile);
try{
config.load();
configDebug(config);
configWorld(config);
configItems(config);
configBlocks(config);
setDefaults();
configGeneral(config);
}catch(Exception e){
FMLLog.log(Level.SEVERE, e, Reference.modName
+ " has had a problem loading its configuration");
}finally{
if (config.hasChanged())
config.save();
}
}