net.minecraftforge.common.config.Configuration.getInt()方法的使用及代码示例

x33g5p2x  于2022-01-18 转载在 其他  
字(11.6k)|赞(0)|评价(0)|浏览(133)

本文整理了Java中net.minecraftforge.common.config.Configuration.getInt()方法的一些代码示例,展示了Configuration.getInt()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Configuration.getInt()方法的具体详情如下:
包路径:net.minecraftforge.common.config.Configuration
类名称:Configuration
方法名:getInt

Configuration.getInt介绍

暂无

代码示例

代码示例来源:origin: AppliedEnergistics/Applied-Energistics-2

/**
 * @param file requires fully qualified file in which the config is saved
 */
public VersionCheckerConfig( @Nonnull final File file )
{
  Preconditions.checkNotNull( file );
  Preconditions.checkState( !file.isDirectory() );
  this.config = new Configuration( file );
  // initializes default values by caching
  this.isEnabled = this.config.getBoolean( "enabled", "general", true, "If true, the version checker is enabled. Acts as a master switch." );
  this.lastCheck = this.config.getString( "lastCheck", "cache", "0",
      "The number of milliseconds since January 1, 1970, 00:00:00 GMT of the last successful check." );
  this.interval = this.config.getInt( "interval", "cache", DEFAULT_INTERVAL_HOURS, MIN_INTERVAL_HOURS, MAX_INTERVAL_HOURS,
      "Waits as many hours, until it checks again." );
  this.level = this.config.getString( "level", "channel", "Beta",
      "Determines the channel level which should be checked for updates. Can be either Stable, Beta or Alpha." );
  this.shouldNotifyPlayer = this.config.getBoolean( "notify", "client", true,
      "If true, the player is getting a notification, that a new version is available." );
  this.shouldPostChangelog = this.config.getBoolean( "changelog", "client", true,
      "If true, the player is getting a notification including changelog. Only happens if notification are enabled." );
}

代码示例来源:origin: Vazkii/Quark

@Override
public void setupConfig(String category) {
  rootChance = ModuleLoader.config.getInt("Root Chance", category, 40, 0, Integer.MAX_VALUE, "The higher, the less roots will spawn");
  dirtChance = ModuleLoader.config.getInt("Dirt Chance", category, 2, 0, Integer.MAX_VALUE, "The higher, the less dirt will spawn");
}

代码示例来源:origin: Vazkii/Quark

@Override
public void setupConfig(String category) {
  floorCobwebChance = ModuleLoader.config.getInt("Floor Cobweb Chance", category, 30, 0, Integer.MAX_VALUE, "The higher, the less floor cobwebs will spawn");
  ceilingCobwebChance = ModuleLoader.config.getInt("Ceiling Cobweb Chance", category, 10, 0, Integer.MAX_VALUE, "The higher, the less ceiling cobwebs will spawn");
  caveSpiderSpawnerChance = ModuleLoader.config.getInt("Cave Spider Spawner Chance", category, 4, 0, Integer.MAX_VALUE, "The (1 in X) chance for a spider spawner to be a cave spider spawner instead");
  nestCobwebChance = ModuleLoader.config.getInt("Nest Cobweb Chance", category, 2, 0, Integer.MAX_VALUE, "The higher, the less cobwebs will spawn in nests");
  nestCobwebRange = ModuleLoader.config.getInt("Nest Cobweb Range", category, 3, 0, Integer.MAX_VALUE, "The range for cobwebs to be spawned in spider nests");
}

代码示例来源:origin: Vazkii/Quark

TradeInfo(String category, Biome biome, boolean enabled, int level, int minPrice, int maxPrice, int color, String name) {
    this.enabled = ModuleLoader.config.getBoolean("Enabled", category, enabled, "");
    this.biome = biome;
    this.level = ModuleLoader.config.getInt("Required Villager Level", category, level, 0, 10, "");
    this.minPrice = ModuleLoader.config.getInt("Minimum Emerald Price", category, minPrice, 1, 64, "");
    this.maxPrice = Math.max(minPrice, ModuleLoader.config.getInt("Maximum Emerald Price", category, maxPrice, 1, 64, ""));
    this.color = color;
    this.name = name;
  }
}

代码示例来源:origin: Vazkii/Quark

@Override
public void setupConfig(String category) {
  stalactiteChance = ModuleLoader.config.getInt("Stalactite Chance", category, 10, 0, Integer.MAX_VALUE, "The higher, the less stalactites will spawn");
  chiseledSandstoneChance = ModuleLoader.config.getInt("Chiseled Sandstone Chance", category, 10, 0, Integer.MAX_VALUE, "The higher, the less chiseled sandstone will spawn");
  deadBushChance = ModuleLoader.config.getInt("Dead Bush Chance", category, 20, 0, Integer.MAX_VALUE, "The higher, the less dead bushes will spawn");
  enableSand = ModuleLoader.config.getBoolean("Enable Sand Floors", category, true, "");
  allowGenInMesa = ModuleLoader.config.getBoolean("Allow in Mesa biomes", category, false, "");
}

代码示例来源:origin: Vazkii/Quark

private ButtonInfo loadButtonInfo(String name, String comment, int xShift, int yShift) {
  ButtonInfo info = new ButtonInfo();
  String category = configCategory + "." + name;
  
  info.enabled = ModuleLoader.config.getBoolean("Enabled", category, true, comment); 
  info.xShift = ModuleLoader.config.getInt("X Position", category, xShift, Integer.MIN_VALUE, Integer.MAX_VALUE, "");
  info.yShift = ModuleLoader.config.getInt("Y Position", category, yShift, Integer.MIN_VALUE, Integer.MAX_VALUE, "");
  return info;
}

代码示例来源:origin: Vazkii/Quark

private StoneInfo(String category, int clusterSize, int clusterRarity, int upperBound, int lowerBound, boolean enabled, String dimStr, BiomeDictionary.Type... biomes) {
    this.enabled = ModuleLoader.config.getBoolean("Enabled", category, true, "") && enabled;
    this.clusterSize = ModuleLoader.config.getInt("Cluster Radius", category, clusterSize, 0, Integer.MAX_VALUE, "");
    this.clusterRarity = ModuleLoader.config.getInt("Cluster Rarity", category, clusterRarity, 0, Integer.MAX_VALUE, "Out of how many chunks would one of these clusters generate");
    this.upperBound = ModuleLoader.config.getInt("Y Level Max", category, upperBound, 0, 255, "");
    this.lowerBound = ModuleLoader.config.getInt("Y Level Min", category, lowerBound, 0, 255, "");
    clustersRarityPerChunk = ModuleLoader.config.getBoolean("Invert Cluster Rarity", category, false, "Setting this to true will make the 'Cluster Rarity' feature be X per chunk rather than 1 per X chunks");
    
    dims = new DimensionConfig(category, dimStr);
    allowedBiomes = BiomeTypeConfigHandler.parseBiomeTypeArrayConfig("Allowed Biome Types", category, biomes);
  }
}

代码示例来源:origin: Vazkii/Quark

@Override
public void setupConfig(String category) {
  slimeBlockChance = ModuleLoader.config.getInt("Slime Block Chance", category, 12, 0, Integer.MAX_VALUE, "The higher, the less slime blocks will spawn");
  waterFloor = ModuleLoader.config.getBoolean("Enable Water Floor", category, true, "");
}

代码示例来源:origin: Vazkii/Quark

@Override
public void setupConfig(String category) {
  stalagmiteChance = ModuleLoader.config.getInt("Stalagmite Chance", category, 60, 0, Integer.MAX_VALUE, "The higher, the less stalagmites will spawn");
  usePackedIce = ModuleLoader.config.getBoolean("Use Packed Ice", category, true, "");
}

代码示例来源:origin: CoFH/ThermalExpansion

public static void config() {
  String category = "Device.ItemCollector";
  BlockDevice.enable[TYPE] = ThermalExpansion.CONFIG.get(category, "Enable", true);
  String comment = "Adjust this value to change the capture radius for the Vacuumulator.";
  radius = ThermalExpansion.CONFIG.getConfiguration().getInt("Radius", category, radius, 2, 16, comment);
}

代码示例来源:origin: CoFH/CoFHCore

public static void config() {
  String category = "Command." + INSTANCE.getCommandName();
  String comment = "Adjust this value to change the default permission level for the " + INSTANCE.getCommandName() + " command.";
  permissionLevel = CoFHCore.CONFIG_CORE.getConfiguration().getInt("PermissionLevel", category, permissionLevel, -1, 4, comment);
}

代码示例来源:origin: CoFH/CoFHCore

public static void config() {
  String category = "Command." + INSTANCE.getCommandName();
  String comment = "Adjust this value to change the default permission level for the " + INSTANCE.getCommandName() + " command.";
  permissionLevel = CoFHCore.CONFIG_CORE.getConfiguration().getInt("PermissionLevel", category, permissionLevel, -1, 4, comment);
}

代码示例来源:origin: CoFH/CoFHCore

public static void config() {
  String category = "Command." + INSTANCE.getCommandName();
  String comment = "Adjust this value to change the default permission level for the " + INSTANCE.getCommandName() + " command.";
  permissionLevel = CoFHCore.CONFIG_CORE.getConfiguration().getInt("PermissionLevel", category, permissionLevel, -1, 4, comment);
}

代码示例来源:origin: CoFH/CoFHCore

public static void config() {
  String category = "Command." + INSTANCE.getCommandName();
  String comment = "Adjust this value to change the default permission level for the " + INSTANCE.getCommandName() + " command.";
  permissionLevel = CoFHCore.CONFIG_CORE.getConfiguration().getInt("PermissionLevel", category, permissionLevel, -1, 4, comment);
}

代码示例来源:origin: CoFH/ThermalExpansion

public static void config() {
  String category = "Dynamo.Enervation";
  enable = ThermalExpansion.CONFIG.get(category, "Enable", true);
  String comment = "Adjust this value to change the Energy generation (in RF/t) for an Enervation Dynamo. This base value will scale with block level and Augments.";
  basePower = ThermalExpansion.CONFIG.getConfiguration().getInt("BasePower", category, basePower, MIN_BASE_POWER, MAX_BASE_POWER, comment);
  ENERGY_CONFIG.setDefaultParams(basePower, smallStorage);
}

代码示例来源:origin: CoFH/ThermalExpansion

public static void config() {
  String category = "Dynamo.Steam";
  enable = ThermalExpansion.CONFIG.get(category, "Enable", true);
  String comment = "Adjust this value to change the Energy generation (in RF/t) for a Steam Dynamo. This base value will scale with block level and Augments.";
  basePower = ThermalExpansion.CONFIG.getConfiguration().getInt("BasePower", category, basePower, MIN_BASE_POWER, MAX_BASE_POWER, comment);
  ENERGY_CONFIG.setDefaultParams(basePower, smallStorage);
}

代码示例来源:origin: CoFH/CoFHCore

public static void config() {
  String category = "Command." + INSTANCE.getCommandName();
  String comment = "Adjust this value to change the default permission level for the " + INSTANCE.getCommandName() + " command.";
  permissionLevel = CoFHCore.CONFIG_CORE.getConfiguration().getInt("PermissionLevel", category, permissionLevel, -1, 4, comment);
}

代码示例来源:origin: CoFH/CoFHCore

public static void config() {
  String category = "Command." + INSTANCE.getCommandName();
  String comment = "Adjust this value to change the default permission level for the " + INSTANCE.getCommandName() + " command.";
  permissionLevel = CoFHCore.CONFIG_CORE.getConfiguration().getInt("PermissionLevel", category, permissionLevel, -1, 4, comment);
}

代码示例来源:origin: MatrexsVigil/harvestcraft

private void initBeesSettings() {
  enableBeehiveGeneration = config.getBoolean("enableBeehiveGeneration", CATEGORY_BEE, true, "Enable generation of beehives.");
  beehiveRarity = config.getInt("beehiveRarity", CATEGORY_BEE, 10, 0, Short.MAX_VALUE, "The higher the value, the more beehives are generated.");
  queenbeelastresultequalsQueen = config.getBoolean("apiarylastresultequalsQueen", CATEGORY_BEE, true, "If true, the last item produced by a queen bee will be another queen bee.");
  enablebeegrubaslistAllmeat  = config.getBoolean("enablebeegrubaslistAllmeat", CATEGORY_BEE, true, "Allows grubs and cooked grubs to be used in listAllrawmeat and listAllcookedmeat.");
}

代码示例来源:origin: CoFH/ThermalExpansion

public static void config() {
  String category = "Machine.Furnace";
  BlockMachine.enable[TYPE] = ThermalExpansion.CONFIG.get(category, "Enable", true);
  String comment = "Adjust this value to change the Energy consumption (in RF/t) for a Redstone Furnace. This base value will scale with block level and Augments.";
  basePower = ThermalExpansion.CONFIG.getConfiguration().getInt("BasePower", category, basePower, MIN_BASE_POWER, MAX_BASE_POWER, comment);
  ENERGY_CONFIGS[TYPE] = new EnergyConfig();
  ENERGY_CONFIGS[TYPE].setDefaultParams(basePower, smallStorage);
}

相关文章