本文整理汇总了Java中net.minecraftforge.common.config.Configuration.getInt方法的典型用法代码示例。如果您正苦于以下问题:Java Configuration.getInt方法的具体用法?Java Configuration.getInt怎么用?Java Configuration.getInt使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类net.minecraftforge.common.config.Configuration
的用法示例。
在下文中一共展示了Configuration.getInt方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: initAreaProtConfig
import net.minecraftforge.common.config.Configuration; //导入方法依赖的package包/类
/**
* Adds configuration entries to the AreaProt category of the config file
* @param cfg Configuration object
*/
private static void initAreaProtConfig(Configuration cfg) {
cfg.addCustomCategoryComment(CATEGORY_AREAPROTECTOR, "Area Protector configuration");
areaProtectorX = cfg.getInt("areaprotectorx", CATEGORY_AREAPROTECTOR, 5, 1, 64,
"Distance from the Area Protector to protect, along the x axis (total distance is 2*this+1)");
areaProtectorY = cfg.getInt("areaprotectory", CATEGORY_AREAPROTECTOR, 5, 1, 64,
"Distance from the Area Protector to protect, along the y axis (total distance is 2*this+1)");
areaProtectorZ = cfg.getInt("areaprotectorz", CATEGORY_AREAPROTECTOR, 5, 1, 64,
"Distance from the Area Protector to protect, along the z axis (total distance is 2*this+1)");
enableMobProtectionAreaProtector = cfg.getBoolean("enablemobprotectionareaprotector", CATEGORY_AREAPROTECTOR, true,
"Set to false to disable teleporting hostile mobs out of the protected area.");
enableArrowProtectionAreaProtector = cfg.getBoolean("enablearrowprotectionareaprotector", CATEGORY_AREAPROTECTOR, true,
"Set to false to disable killing Skeleton arrows shot into the protected area.");
enablePotionProtectionAreaProtector = cfg.getBoolean("enablepotionprotectionareaprotector", CATEGORY_AREAPROTECTOR, true,
"Set to false to disable blocking Witch potions from entering the protected area.");
enableWolfProtectionAreaProtector = cfg.getBoolean("enablewolfprotectionareaprotector", CATEGORY_AREAPROTECTOR, false,
"Set to false to disable calming hostile wolves in the protected area.");
enableSlimeProtectionAreaProtector = cfg.getBoolean("enableslimeprotectionareaprotector", CATEGORY_AREAPROTECTOR, true,
"Set to false to disable teleporting slimes out of the protected area.");
enableAreaProtectorRecipe = cfg.getBoolean("enableareaprotectorrecipe", CATEGORY_AREAPROTECTOR, true,
"Enables the crafting recipe for the Area Protector block.");
}
示例2: preLoad
import net.minecraftforge.common.config.Configuration; //导入方法依赖的package包/类
@Mod.EventHandler
public void preLoad(FMLPreInitializationEvent event)
{
Configuration config = new Configuration(event.getSuggestedConfigurationFile());
config.load();
config.addCustomCategoryComment("general", "General settings");
fancyWeightage = config.getInt("fancyWeightage", "general", 80, 0, 100, "Weightage of llamas wearing parts of their outfit, in percentage% (0-100)");
randomizeParts = config.getInt("randomizeParts", "general", 1, 0, 1, "0 = Render the entire outfit (except disabled parts)\n1 = Randomly choose which parts of the outfit to render (per llama)");
disabledParts = config.getStringList("disabledParts", "general", disabledParts, "Disable parts of the outfit", new String[] { "hat", "monocle", "pipe", "bowtie", "fez", "moustache" });
if(config.hasChanged())
{
config.save();
}
MinecraftForge.EVENT_BUS.register(this);
}
示例3: preInit
import net.minecraftforge.common.config.Configuration; //导入方法依赖的package包/类
@EventHandler
public void preInit(FMLPreInitializationEvent event){
Configuration config = new Configuration(event.getSuggestedConfigurationFile());
config.load();
canBeDeactivated = config.getBoolean("canBeDeactivated", Configuration.CATEGORY_GENERAL, true, "If the wopper can be deactivated using redstone");
wopperSpeed = config.getInt("speed", Configuration.CATEGORY_GENERAL, 10, 1, 1000, "The amount of ticks that have to pass before the wopper does a movement action again");
if(config.hasChanged()){
config.save();
}
blockWopper = new BlockWopper("wopper");
GameRegistry.registerTileEntity(TileEntityWopper.class, MOD_ID+":wopper");
proxy.preInit();
}
示例4: initGeneralConfig
import net.minecraftforge.common.config.Configuration; //导入方法依赖的package包/类
private static void initGeneralConfig(Configuration cfg) {
cfg.addCustomCategoryComment(CATEGORY_GENERAL, "General Options");
cfg.addCustomCategoryComment(CATEGORY_WORLD, "World Generation Options");
LODESTONE_FREQUENCY = cfg.getInt("Lodestone Frequency", CATEGORY_WORLD, 4, 0, 64, "Number of lodestone veins per chunk");
LODESTONE_VEIN_SIZE = cfg.getInt("Lodestone Vein Size", CATEGORY_WORLD, 5, 0, 64, "Blocks per lodestone vein");
LODESTONE_MIN_Y = cfg.getInt("Lodestone Min Y", CATEGORY_WORLD, 0, 0, 256, "Minimum y value where lodestone veins can spawn");
LODESTONE_MAX_Y = cfg.getInt("Lodestone Max Y", CATEGORY_WORLD, 40, 0, 256, "Maximum y value where lodestone veins can spawn");
RIFT_FREQUENCY = cfg.getInt("Rift Frequency", CATEGORY_WORLD, 16, 0, 1024, "How common rifts are in worldgen.\nA rift will spawn in 1 in every x chunks with a low enough stability value.");
PROPERTY_ORDER_WORLD.add("Lodestone Frequency");
PROPERTY_ORDER_WORLD.add("Lodestone Vein Size");
PROPERTY_ORDER_WORLD.add("Lodestone Min Y");
PROPERTY_ORDER_WORLD.add("Lodestone Max Y");
PROPERTY_ORDER_WORLD.add("Rift Frequency");
cfg.setCategoryPropertyOrder(CATEGORY_GENERAL, PROPERTY_ORDER_GENERAL);
cfg.setCategoryPropertyOrder(CATEGORY_WORLD, PROPERTY_ORDER_WORLD);
}
示例5: ProspectingConfiguration
import net.minecraftforge.common.config.Configuration; //导入方法依赖的package包/类
public ProspectingConfiguration(FMLPreInitializationEvent e) {
final Configuration config = new Configuration(e.getSuggestedConfigurationFile());
config.load();
// this.nugget_amount = config.getInt("Nuggets Per Chunk", "General", 1, 0, 999999999, "The number of nuggets that can be prospected in a chunk, if it has applicable ore in it.");
this.chunk_expiry = config.getInt("Chunk Expiry", "Caching", 300, 1, 999999999, "The number of seconds until a chunk's cache expires. After the cache expires, the chunk will be re-scanned for ore when it is prospected.");
this.nugget_chance = config.getFloat("Nugget Chance", "Probabilities", 0.8f, 0f, 1f, "The chance that a chunk will have nuggets. The number of nuggets produced is determined by the \"Ore Per Nugget\" setting");
this.ore_per_nugget = config.getInt("Ore Per Nugget", "Probabilities", 50, 0, 4096, "The number of ore, on average, that will produce 1 nugget in a chunk. For example, if this value is 50, and a chunk has 100 iron ore, you can expect to get 2 nuggets from the chunk through prospecting.");
this.ore_per_nugget_deviation = config.getInt("Ore Per Nugget Deviation", "Probabilities", 10, 0, 4096, "The maximum deviation for nugget calculations. Your value for \"Ore Per Nugget\" well be randomly modified +- this value when calculating nuggets.");
this.max_nuggets = config.getInt("Maximum Nugget Count", "Probabilities", 5, 0, 4096, "The maximum number of nuggets to spawn in a given chunk for each ore.");
this.flower_chance = config.getFloat("Flower Chance", "Probabilities", 0.8f, 0f, 1f, "The chance that a given chunk will produce flowers, if it contains ore. The number of flowers produced is determined by the \"Ore Per Flower\" setting.");
this.flower_false_chance = config.getFloat("Flower False Positive Chance", "Probabilities", 0.05f, 0f, 1f, "This chance that a chunk will have some indicator flowers spawn despite having no ore.");
this.ore_per_flower = config.getInt("Ore Per Flower", "Probabilities", 50, 0, 4096, "The number of ore, on average, that it takes to produce 1 flower on the surface.");
this.ore_per_flower_deviation = config.getInt("Ore Per Flower Deviation", "Probabilities", 10, 0, 4096, "The maximum deviation for flower calculations. Your value for \"Ore Per Flower\" well be randomly modified +- this value when calculating flowers.");
this.max_flowers = config.getInt("Maximum Flower Count", "Probabilities", 10, 0, 4096, "The maximum number of flowers to spawn in a given chunk for each type of ore.");
config.save();
}
示例6: loadOre
import net.minecraftforge.common.config.Configuration; //导入方法依赖的package包/类
private ConfigOregenEntry loadOre(Configuration config, String name, int minY, int maxY, int minVs, int maxVs, int minVeins, int maxVeins, float chance, String[] dimList, boolean dimListMode)
{
ConfigOregenEntry entr = new ConfigOregenEntry();
entr.generate = config.getBoolean(name, WORLD, true, "");
entr.minY = config.getInt(name + " Min Y", WORLD, minY, 0, Integer.MAX_VALUE, "");
entr.maxY = config.getInt(name + " Max Y", WORLD, maxY, 0, Integer.MAX_VALUE, "");
entr.minVeinSize = config.getInt(name + " Min Vein Size", WORLD, minVs, 0, Integer.MAX_VALUE, "");
entr.maxVeinSize = config.getInt(name + " Max Vein Size", WORLD, maxVs, 0, Integer.MAX_VALUE, "");
entr.minVeins = config.getInt(name + " Min Veins Per Chunk", WORLD, minVeins, 0, Integer.MAX_VALUE, "");
entr.maxVeins = config.getInt(name + " Max Veins Per Chunk", WORLD, maxVeins, 0, Integer.MAX_VALUE, "");
entr.chance = config.getFloat(name + " Generation Chance", WORLD, chance, 0, 1, "");
entr.dimList = loadIntList(config, name + " DimList", WORLD, dimList, "");
entr.dimListMode = config.getBoolean(name + " DimList Mode", WORLD, dimListMode, "True = whitelist; False = blacklist");
return entr;
}
示例7: initGeneralConfig
import net.minecraftforge.common.config.Configuration; //导入方法依赖的package包/类
/**
* Adds configuration entries to the General category of the config file
* @param cfg Configuration object
*/
private static void initGeneralConfig(Configuration cfg) {
cfg.addCustomCategoryComment(CATEGORY_GENERAL, "General configuration");
ticksToLive = cfg.getInt("ticksbeforedecay", CATEGORY_GENERAL, ticksToLive, -1, Integer.MAX_VALUE,
"How long (in ticks) before the Chunk Protector decays. Set to -1 to disable decay.");
giveNewPlayersProtector = cfg.getBoolean("givenewplayerschunkprotector", CATEGORY_GENERAL, true,
"Set to true to give players a free Chunk Protector when first logging into a world.");
}
示例8: loadGround
import net.minecraftforge.common.config.Configuration; //导入方法依赖的package包/类
private ConfigGroundgenEntry loadGround(Configuration config, String name, int minY, int maxY, int minCount, int maxCount, float chance, String[] dimList, boolean dimListMode)
{
ConfigGroundgenEntry entr = new ConfigGroundgenEntry();
entr.generate = config.getBoolean(name, WORLD, true, "");
entr.minY = config.getInt(name + " Min Y", WORLD, minY, 0, Integer.MAX_VALUE, "");
entr.maxY = config.getInt(name + " Max Y", WORLD, maxY, 0, Integer.MAX_VALUE, "");
entr.minCount = config.getInt(name + " Min Count Per Chunk", WORLD, minCount, 0, Integer.MAX_VALUE, "");
entr.maxCount = config.getInt(name + " Max Count Per Chunk", WORLD, maxCount, 0, Integer.MAX_VALUE, "");
entr.chance = config.getFloat(name + " Generation Chance", WORLD, chance, 0, 1, "");
entr.dimList = loadIntList(config, name + " DimList", WORLD, dimList, "");
entr.dimListMode = config.getBoolean(name + " DimList Mode", WORLD, dimListMode, "True = whitelist; False = blacklist");
return entr;
}
示例9: initGeneralConfig
import net.minecraftforge.common.config.Configuration; //导入方法依赖的package包/类
private static void initGeneralConfig(Configuration cfg)
{
cfg.addCustomCategoryComment(catGeneral, "General configuration");
shiny_stone_drop_rate = cfg.getInt("shiny_stone_rate", catGeneral, shiny_stone_drop_rate, 0, 100, "Drop rate of shiny stone (percentage)");
butter_emits_redstone_signal = cfg.getBoolean("butter_emits_redstone_signal", catGeneral, butter_emits_redstone_signal, "Whether butter randomly emits a redstone signal");
}
示例10: initFoodConfig
import net.minecraftforge.common.config.Configuration; //导入方法依赖的package包/类
private static void initFoodConfig(Configuration cfg)
{
cfg.addCustomCategoryComment(catFood, "Food configuration");
chickendinner_hunger = cfg.getInt("chicken_dinner_hunger", catFood, chickendinner_hunger, 0, 20, "Chicken Dinner hunger value");
meatshroom_hunger = cfg.getInt("meatshroom_hunger", catFood, meatshroom_hunger, 0, 20, "Meatshroom hunger value");
}
示例11: commonPreinit
import net.minecraftforge.common.config.Configuration; //导入方法依赖的package包/类
public static final void commonPreinit(FMLPreInitializationEvent e) {
Configuration config = new Configuration(new File(e.getModConfigurationDirectory(), "/miningwells/config.cfg"));
config.load();
displayMiningWellJoke = config.getBoolean("displayMiningWellJoke", "misc", true, "Displays the a pun on all Mining Well items. Yes, very necessary.");
ticksBetweenMining = config.getInt("ticksBetweenMining", "miningwell", 0, 0, 35, "The minimum number of ticks per mining operation. 0 means that the next block will be broken in the next tick, if power supply is high enough.");
energyPerOperation = config.getInt("energyPerOperation", "miningwell", 256, 20, 1200, "The number of energy units per operation (this is multiplied by the hardness of a block + 1). If this number is 20, stone will require 40 to mine. Subtract and extra 20 for exact calculations.");
maxEnergy = config.getInt("maxEnergy", "miningwell", 16384, 100, 1000000, "The maximum number of energy units that can be stored inside the mining well.");
silkRatio = config.getFloat("silkRation", "miningwell", 1.0f, 0.0f, 10.0f, "The required energy is multiplied by this number if a silk touch upgrade is present, and then added back to the required energy.");
fortuneRatio = config.getFloat("fortuneRatio", "miningwell", 0.45f, 0.0f, 3.0f, "The level of fortune present is multiplied by this, then the required energy is multiplied by that, and then added back to the required energy.");
config.save();
}
示例12: initConfig
import net.minecraftforge.common.config.Configuration; //导入方法依赖的package包/类
private static void initConfig(Configuration cfg){
cfg.addCustomCategoryComment(CATEGORY_GENERAL, "Configuration");
CharcoalTime=cfg.getInt("CharcoalTime", CATEGORY_GENERAL, 18000, 1000, 1000000, "Time the charcoal pit takes to finish. 1000 Ticks = 1 MC hour");
CokeTime=cfg.getInt("CokeTime", CATEGORY_GENERAL, 36000, 1000, 1000000, "Time the coke oven takes to finish. 1000 Tick = 1 MC hour");
CharcoalCreosote=cfg.getInt("CharcoalCreosote", CATEGORY_GENERAL, 50, 0, 1000, "Amount of Creosote Oil in mB produced per log");
CokeCreosote=cfg.getInt("CokeCreosote", CATEGORY_GENERAL, 100, 0, 1000, "Amount of Creosote Oil in mB produced per coal");
CokeBlocks=cfg.getStringList("CokeBlocks", CATEGORY_GENERAL, new String[]{"minecraft:brick_block","minecraft:nether_brick"}, "List of block registry names that are valid for the coke oven outer shell");
CharcoalMin=cfg.getInt("CharcoalMin", CATEGORY_GENERAL, 3, 0, 1000, "The minimum amount of charcoal a charcoal pile can drop");
CharcoalMax=cfg.getInt("CharcoalMax", CATEGORY_GENERAL, 6, 0, 1000, "The maximum amount of charcoal a charcoal pile can drop without fortune");
CharcoalTotal=cfg.getInt("CharcoalTotal", CATEGORY_GENERAL, 9, 0, 1000, "The maximum amount of charcoal a charcoal pile can ever drop");
CokeMin=cfg.getInt("CokeMin", CATEGORY_GENERAL, 6, 0, 1000, "The minimum amount of coke a coke pile can drop");
CokeMax=cfg.getInt("CokeMax", CATEGORY_GENERAL, 9, 0, 1000, "The maximum amount of coke a coke pile can drop without fortune");
CokeTotal=cfg.getInt("CokeTotal", CATEGORY_GENERAL, 9, 0, 1000, "The maximum amount of coke a coke pile can ever drop");
AllowFortune=cfg.getBoolean("AllowFortune", CATEGORY_GENERAL, true, "If Fortune enchant applies to charcoal/coke piles");
CokeFuel=cfg.getInt("CokeFuel", CATEGORY_GENERAL, 3200, 0, 1000000, "The fuel value of coke. (char)coal is 1600");
CreosoteFuel=cfg.getInt("CreosoteFuel", CATEGORY_GENERAL, 4800, 0, 1000000, "The fuel value of a creosote bucket. (char)coal is 1600");
DisableFurnaceCharcoal=cfg.getBoolean("DisableFurnaceCharcoal", CATEGORY_GENERAL, true, "If the vanilla log->charcoal furnace recipe should be disabled");
AshPreference=cfg.getString("AshPreference", CATEGORY_GENERAL, "forestry:ash", "The prefered ash item to drop from charcoal/coke piles. Defaults to the mod's own if invalid");
AshMeta=cfg.getInt("AshMeta", CATEGORY_GENERAL, 0, 0, Integer.MAX_VALUE, "The metadata of the prefered ash item to drop from charcoal/coke piles");
CokePreference=cfg.getString("CokePreference", CATEGORY_GENERAL, "railcraft:fuel_coke", "The prefered coke item to drop from coke piles. Defaults to mod's own if invalid");
CokeMeta=cfg.getInt("CokeMeta", CATEGORY_GENERAL, 0, 0, Integer.MAX_VALUE, "The metadata of the prefered coke item to drop from coke piles");
RegisterRecipes=cfg.getBoolean("RegisterRecipes", CATEGORY_GENERAL, true, "Set to false to disable hard coded recipes");
PotteryTime=cfg.getInt("PotteryTime", CATEGORY_GENERAL, 8000, 1000, 1000000, "Time the pottery kiln takes to finish. 1000 Ticks = 1 MC hour");
ThatchAmount=cfg.getInt("ThatchAmount", CATEGORY_GENERAL, 1, 1, 64, "The amount of thatch needed by the pottery kiln");
WoodAmount=cfg.getInt("WoodAmount", CATEGORY_GENERAL, 3, 1, 64, "The amount of wood needed by the pottery kiln");
WoodDefault=cfg.getString("WoodDefault", CATEGORY_GENERAL, "minecraft:log", "The wood dropped if a pottery kiln or log pile is dismantled");
ThatchID=cfg.getString("ThatchID", CATEGORY_GENERAL, "minecraft:hay_block", "The block used as thatch for the pottery kiln");
WoodMeta=cfg.getInt("WoodMeta", CATEGORY_GENERAL, 0, 0, Integer.MAX_VALUE, "The metadata of the wood dropped if a pottery kiln or log pile is dismantled");
ThatchMeta=cfg.getInt("ThatchMeta", CATEGORY_GENERAL, 0, 0, Integer.MAX_VALUE, "The metadata of the block used as thatch for the pottery kiln");
DismantleLogPiles=cfg.getBoolean("DismantleLogPiles", CATEGORY_GENERAL, true, "If log piles can be dismantled");
PotteryAsh=cfg.getInt("PotteryAsh", CATEGORY_GENERAL, 4, 0, 64, "The amount of ash dropped by a completed pottery kiln");
RainyPottery=cfg.getBoolean("RainyPottery", CATEGORY_GENERAL, true, "If pottery kilns get extingushed by rain");
DisableVanillaPottery=cfg.getBoolean("DisableVanillaPottery", CATEGORY_GENERAL, true, "If the vanilla methods of making pottery should be disabled");
DisableDefaultPottery=cfg.getBoolean("DisableDefaultPottery", CATEGORY_GENERAL, false, "If the default pottery kiln recipes should be disabled");
PotteryRecipes=cfg.getStringList("PotteryRecipes", CATEGORY_GENERAL, new String[]{""}, "Register custom pottery kiln recipes in the format 'modId:ingredientId' ingredientMeta 'modId:resultId' resultMeta. ex: minecraft:clay_ball 0 minecraft:brick 0");
}
示例13: loadOreOnOre
import net.minecraftforge.common.config.Configuration; //导入方法依赖的package包/类
private ConfigOreOnOreEntry loadOreOnOre(Configuration config, String orename, int minY, int maxY, float chance, String[] dimList, boolean dimListMode)
{
ConfigOreOnOreEntry entr = new ConfigOreOnOreEntry();
entr.generate = config.getBoolean(orename, WORLD, true, "");
entr.minY = config.getInt(orename + " Min Y", WORLD, minY, 0, Integer.MAX_VALUE, "");
entr.maxY = config.getInt(orename + " Max Y", WORLD, maxY, 0, Integer.MAX_VALUE, "");
entr.chance = config.getFloat(orename + " Generation Chance", WORLD, chance, 0, 1, "");
entr.dimList = loadIntList(config, orename + " DimList", WORLD, dimList, "");
entr.dimListMode = config.getBoolean(orename + " DimList Mode", WORLD, dimListMode, "True = whitelist; False = blacklist");
return entr;
}
示例14: preInit
import net.minecraftforge.common.config.Configuration; //导入方法依赖的package包/类
@EventHandler
public void preInit(FMLPreInitializationEvent event) {
proxy.preInit();
CONFIG = new Configuration(event.getSuggestedConfigurationFile());
CONFIG.setCategoryComment("neohell", "These keys affect how the world is generated, and whether it is generated.");
CONFIG_SHOULD_REGISTER_NEOHELL = CONFIG.getBoolean("enabled", "neohell", CONFIG_SHOULD_REGISTER_NEOHELL,
"Setting this to false disables neohell entirely, and this mod's blocks will be unobtainable unless tweaked in.");
CONFIG_DIMENSION_ID_NEOHELL = CONFIG.getInt("id", "neohell", CONFIG_DIMENSION_ID_NEOHELL, Integer.MIN_VALUE, Integer.MAX_VALUE,
"Remaps neohell to a different dimension ID, possibly causing it to replace a different dimension. May be catastrophically bad for existing maps.");
CONFIG.save();
if (CONFIG_SHOULD_REGISTER_NEOHELL) {
if (DimensionManager.isDimensionRegistered(CONFIG_DIMENSION_ID_NEOHELL)) {
//Nuking hell just makes it stronger
DimensionManager.unregisterDimension(CONFIG_DIMENSION_ID_NEOHELL);
}
DimensionType neohellType = DimensionType.register("Neo-Hell", "_neohell", CONFIG_DIMENSION_ID_NEOHELL, WorldProviderNeoHell.class, false);
DimensionManager.registerDimension(CONFIG_DIMENSION_ID_NEOHELL, neohellType);
@SuppressWarnings("unused")
WorldProvider provider = DimensionManager.createProviderFor(CONFIG_DIMENSION_ID_NEOHELL);
}
/* Obsidian is a glossy, vitreous rock, useful because when struck it easily forms conchoidal fractures,
* meaning you can hit it with an ordinary rock, and it shatters, making a super-sharp edge you can use for an
* axe head or a knife blade. It's frequently found
* just lying around volcanic islands. None of this describes what we see in Minecraft when we look at an
* obsidian block or the way we use that block.
*/
Blocks.OBSIDIAN.setUnlocalizedName("thermionics_world.basalt");
Blocks.OBSIDIAN.setHardness(2.5f);
Blocks.OBSIDIAN.setHarvestLevel("pickaxe",2);
//Ender Chest and Enchantment Table should have the same hardness as raw Basalt
Blocks.ENDER_CHEST.setHardness(2.5f);
Blocks.ENCHANTING_TABLE.setHardness(2.5f);
MinecraftForge.EVENT_BUS.register(this);
MinecraftForge.EVENT_BUS.register(proxy);
MinecraftForge.EVENT_BUS.register(TWBlocks.class);
MinecraftForge.EVENT_BUS.register(TWItems.class);
MinecraftForge.EVENT_BUS.register(BiomeRegistry.class);
}
示例15: readConfig
import net.minecraftforge.common.config.Configuration; //导入方法依赖的package包/类
private void readConfig(FMLPreInitializationEvent event) {
Configuration cfg = new Configuration(event.getSuggestedConfigurationFile());
allowDebugDevice = cfg.getBoolean("allowDebugDevice", Configuration.CATEGORY_GENERAL, defaultAllowDebugDevice,
"Whether to make the debugging device available.\nThis writes to the Minecraft log under computer control; you should\ndisable this unless you're debugging something that you can't debug any\nother way.\nDoes not provide input, only output.\n");
logUIFErrors = cfg.getBoolean("logUIFErrors", Configuration.CATEGORY_GENERAL, defaultLogUIFErrors,
"Whether to log the reason for rejecting invalid UIF transmissions.\nThis writes to the Minecraft log under (partial) computer control; you\nshould disable this unless you're debugging something that you can't\ndebug any other way.\n");
biosOptional = cfg.getBoolean("biosOptional", Configuration.CATEGORY_GENERAL, defaultBIOSOptional,
"Whether computers with no EEPROM installed will use the Standard BIOS.\nThis is a pretty cheaty option, but may be necessary, since there is not\ncurrently a crafting recipe for the Standard BIOS.\nIf the Standard BIOS is missing from your jar, this option will have no\neffect.\n");
logInvokes = cfg.getBoolean("logInvokes", Configuration.CATEGORY_GENERAL, defaultLogInvokes,
"Log ALL invokes, replies, and signals to the Minecraft log!\nYou should pretty seriously consider never enabling this.\n");
logDeadlineSlippage = cfg.getBoolean("logDeadlineSlippage", Configuration.CATEGORY_GENERAL, defaultLogDeadlineSlippage,
"Log whenever runThreaded terminates due to a missed deadline.\nMainly useful for debugging OCMOS.\n");
maxInvokeSize = cfg.getInt("maxInvokeSize", Configuration.CATEGORY_GENERAL, defaultMaxInvokeSize, 128, 1<<30,
"The maximum size, in bytes, an outgoing command can take. The higher you\nset this option, the more memory a malicious program can consume.\n");
deadlineMilliseconds = cfg.getInt("deadlineMilliseconds", Configuration.CATEGORY_GENERAL, defaultDeadlineMilliseconds, 0, 100000000,
"The maximum amount of time that runThreaded can run before giving up on\nmeeting the cycle budget. This option is a workaround for a difficult-\nto-debug hang in the OCMOS MMU, and should also help on overloaded\nservers.\n0 = no deadline\n");
banksPerMebibyte = cfg.getInt("banksPerMebibyte", Configuration.CATEGORY_GENERAL, defaultBanksPerMebibyte, 1, 1<<30,
"The number of 4096-byte banks a RAM module provides, per mebibyte of\nmemory it would provide a Lua computer.\n65C02 computers require MUCH less memory to perform a task than Lua\ncomputers do. The default attempts to provide a comfortable amount of\nmemory, without making large memory modules pointless.\n");
cpuCyclesPerTick = getTierBasedIntList(cfg, "cpuCyclesPerTick", Configuration.CATEGORY_GENERAL, defaultCpuCyclesPerTick,
"CPU cycles per Minecraft tick, at each CPU tier.\nDefault values are 25000, 50000, 100000 (500KHz/1MHz/2MHz)");
ramTier1Latency = getTierBasedIntList(cfg, "ramTier1Latency", Configuration.CATEGORY_GENERAL, defaultRamTier1Latency,
"CPU cycles per tier 1 RAM access, at each CPU tier.");
ramTier2Latency = getTierBasedIntList(cfg, "ramTier2Latency", Configuration.CATEGORY_GENERAL, defaultRamTier2Latency,
"CPU cycles per tier 2 RAM access, at each CPU tier.");
ramTier3Latency = getTierBasedIntList(cfg, "ramTier3Latency", Configuration.CATEGORY_GENERAL, defaultRamTier3Latency,
"CPU cycles per tier 3 RAM access, at each CPU tier.");
romLatency = getTierBasedIntList(cfg, "romLatency", Configuration.CATEGORY_GENERAL, defaultRomLatency,
"CPU cycles per ROM access, at each CPU tier.");
ioLatency = getTierBasedIntList(cfg, "ioLatency", Configuration.CATEGORY_GENERAL, defaultIoLatency,
"CPU cycles per IO-space access, at each CPU tier.");
for(int n = 0; n < 3; ++n) {
if(cpuCyclesPerTick[n] < 1) cpuCyclesPerTick[n] = 1;
if(ramTier1Latency[n] < 1) ramTier1Latency[n] = 1;
if(ramTier2Latency[n] < 1) ramTier2Latency[n] = 1;
if(ramTier3Latency[n] < 1) ramTier3Latency[n] = 1;
if(romLatency[n] < 1) romLatency[n] = 1;
if(ioLatency[n] < 1) ioLatency[n] = 1;
}
cfg.getCategory(Configuration.CATEGORY_GENERAL).setPropertyOrder(new ArrayList<String>(Arrays.asList("cpuCyclesPerTick","deadlineMilliseconds","logDeadlineSlippage","banksPerMebibyte","romLatency","ramTier1Latency","ramTier2Latency","ramTier3Latency","ioLatency","allowDebugDevice","logUIFErrors","logInvokes","maxInvokeSize","biosOptional")));
cfg.save();
}