Shadows-of-Fire / Foundry

Minecraft mod that adds liquid metals
GNU Lesser General Public License v3.0
5 stars 3 forks source link

default values for "Fluid Ore Value" doesn't work #36

Closed sergeycherepanov closed 6 years ago

sergeycherepanov commented 6 years ago

As we can see there passed the 1 as min value https://github.com/Shadows-of-Fire/Foundry/blob/1.12.2/src/main/java/exter/foundry/config/FoundryConfig.java#L65

And there implementation of getInt in forge

    /**
     * Creates a integer property.
     *
     * @param name Name of the property.
     * @param category Category of the property.
     * @param defaultValue Default value of the property.
     * @param minValue Minimum value of the property.
     * @param maxValue Maximum value of the property.
     * @param comment A brief description what the property does.
     * @param langKey A language key used for localization of GUIs
     * @return The value of the new integer property.
     */
    public int getInt(String name, String category, int defaultValue, int minValue, int maxValue, String comment, String langKey)
    {
        Property prop = this.get(category, name, defaultValue);
        prop.setLanguageKey(langKey);
        prop.setComment(comment + " [range: " + minValue + " ~ " + maxValue + ", default: " + defaultValue + "]");
        prop.setMinValue(minValue);
        prop.setMaxValue(maxValue);
        return prop.getInt(defaultValue) < minValue ? minValue : (prop.getInt(defaultValue) > maxValue ? maxValue : prop.getInt(defaultValue));
    }

As you can see it returns min value if value in config lower than it. It means the default zero value is will be translated always to 1.

Shadows-of-Fire commented 6 years ago

Surprised nobody caught that before now, anyway, it'll reset itself back to 0 if its one as of 3.3.2, and the min has been changed to 0 as per f510af1