Tabnine Logo
Property.setMaxValue
Code IndexAdd Tabnine to your IDE (free)

How to use
setMaxValue
method
in
net.minecraftforge.common.config.Property

Best Java code snippets using net.minecraftforge.common.config.Property.setMaxValue (Showing top 6 results out of 315)

origin: SleepyTrousers/EnderCore

static void setBounds(Property prop, Bound<?> bound) throws IllegalArgumentException {
 if (bound.equals(Bound.MAX_BOUND)) {
  return;
 }
 if (prop.getType() == Type.INTEGER) {
  Bound<Integer> b = Bound.of(bound.min.intValue(), bound.max.intValue());
  prop.setMinValue(b.min);
  prop.setMaxValue(b.max);
 } else if (prop.getType() == Type.DOUBLE) {
  Bound<Double> b = Bound.of(bound.min.doubleValue(), bound.max.doubleValue());
  prop.setMinValue(b.min);
  prop.setMaxValue(b.max);
 } else {
  throw new IllegalArgumentException(String.format("A mod tried to set bounds %s on a property that was not either of Integer of Double type.", bound));
 }
}
origin: MatterOverdrive/MatterOverdrive-Legacy-Edition

public double getMachineDouble(String machine, String prop, double def, double min, double max, String comment) {
  Property p = config.get(CATEGORY_MACHINES + "." + machine.replaceFirst("tile.", ""), prop, def);
  p.setComment(comment);
  p.setLanguageKey(String.format("%s.config.%s", machine, prop));
  p.setMinValue(min);
  p.setMaxValue(max);
  return p.getDouble(def);
}
origin: SonarSonic/Calculator

  public static float FLOAT(Configuration config, String name, String category, float defaultValue, float minValue, float maxValue){
    Property prop = config.get(category, name, Float.toString(defaultValue), name);
    prop.setLanguageKey(name);
    prop.setComment("");
    prop.setMinValue(minValue);
    prop.setMaxValue(maxValue);
    try
    {
      float parseFloat = Float.parseFloat(prop.getString());
      return Floats.constrainToRange(parseFloat, minValue, maxValue);
    }
    catch (Exception e)
    {
      FMLLog.log.error("Failed to get float for {}/{}", name, category, e);
    }
    return defaultValue;
  }
}
origin: SonarSonic/Calculator

public static double DOUBLE(Configuration config, String category, String name, float defaultValue, float minValue, float maxValue){
  Property prop = config.get(category, name, defaultValue);
  prop.setLanguageKey(name);
  prop.setComment("");
  prop.setMinValue(minValue);
  prop.setMaxValue(maxValue);
  return (prop.getDouble(defaultValue) < minValue ? minValue : (prop.getDouble(defaultValue) > maxValue ? maxValue : prop.getDouble(defaultValue)));
}
origin: SonarSonic/Calculator

public static int INT(Configuration config, String category, String name, int defaultValue, int minValue, int maxValue){
  Property prop = config.get(category, name, defaultValue);
  prop.setLanguageKey(name);
  prop.setComment("");
  prop.setMinValue(minValue);
  prop.setMaxValue(maxValue);
  return prop.getInt(defaultValue) < minValue ? minValue : (prop.getInt(defaultValue) > maxValue ? maxValue : prop.getInt(defaultValue));
}
origin: ForestryMC/ForestryMC

private TreeConfig parseConfig(LocalizedConfiguration config) {
  for (int dimId : config.get(CONFIG_CATEGORY_TREE + "." + treeName + ".dimensions", "blacklist", new int[0]).getIntList()) {
    blacklistedDimensions.add(dimId);
  }
  for (int dimId : config.get(CONFIG_CATEGORY_TREE + "." + treeName + ".dimensions", "whitelist", new int[0]).getIntList()) {
    whitelistedDimensions.add(dimId);
  }
  for (String typeName : config.get(CONFIG_CATEGORY_TREE + "." + treeName + ".biomes.blacklist", "types", new String[0]).getStringList()) {
    blacklistedBiomeTypes.add(BiomeDictionary.Type.getType(typeName));
  }
  for (String biomeName : config.get(CONFIG_CATEGORY_TREE + "." + treeName + ".biomes.blacklist", "names", new String[0]).getStringList()) {
    Biome biome = ForgeRegistries.BIOMES.getValue(new ResourceLocation(biomeName));
    if (biome != null) {
      blacklistedBiomes.add(biome);
    } else {
      Log.error("Failed to identify biome for the config property for the tree with the uid '" + treeName + "'. No biome is registered under the registry name '" + biomeName + "'.");
    }
  }
  spawnRarity = (float) config.get(CONFIG_CATEGORY_TREE + "." + treeName, "rarity", defaultRarity).setMinValue(0.0F).setMaxValue(1.0F).getDouble();
  return this;
}
net.minecraftforge.common.configPropertysetMaxValue

Popular methods of Property

  • getBoolean
  • getInt
  • getDouble
  • getString
  • set
  • getStringList
  • setComment
  • getIntList
  • setRequiresMcRestart
  • setLanguageKey
  • setMinValue
  • getName
  • setMinValue,
  • getName,
  • setValidValues,
  • getType,
  • <init>,
  • getDefault,
  • isList,
  • setValue,
  • getBooleanList

Popular in Java

  • Updating database using SQL prepared statement
  • findViewById (Activity)
  • runOnUiThread (Activity)
  • onRequestPermissionsResult (Fragment)
  • URLEncoder (java.net)
    This class is used to encode a string using the format required by application/x-www-form-urlencoded
  • LinkedList (java.util)
    Doubly-linked list implementation of the List and Dequeinterfaces. Implements all optional list oper
  • Queue (java.util)
    A collection designed for holding elements prior to processing. Besides basic java.util.Collection o
  • JFileChooser (javax.swing)
  • Logger (org.apache.log4j)
    This is the central class in the log4j package. Most logging operations, except configuration, are d
  • DateTimeFormat (org.joda.time.format)
    Factory that creates instances of DateTimeFormatter from patterns and styles. Datetime formatting i
  • Top PhpStorm plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now