Skip to content

Commit

Permalink
number config options are now text fields instead of sliders (Fabric)
Browse files Browse the repository at this point in the history
  • Loading branch information
cech12 committed Aug 30, 2024
1 parent 8bd15df commit 484886b
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 11 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@ All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) and this project adheres to [Forge Recommended Versioning](https://mcforge.readthedocs.io/en/latest/conventions/versioning/).

## [1.21-4.1.1.0] - 2024-08-30
### Changed
- number config options are now text fields instead of sliders (Fabric)

## [1.21-4.1.0.0] - 2024-07-14
### Changed
- updated NeoForge to 21.0.94-beta
Expand Down
6 changes: 4 additions & 2 deletions common/src/main/resources/assets/solarcooker/lang/en_us.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,16 @@
"text.autoconfig.solarcooker.option.COOK_TIME_FACTOR.@Tooltip[1]": "Cook time factor of the solar cooker in relation",
"text.autoconfig.solarcooker.option.COOK_TIME_FACTOR.@Tooltip[2]": "to corresponding vanilla furnace. (percent)",
"text.autoconfig.solarcooker.option.COOK_TIME_FACTOR.@Tooltip[3]": "§7§o50 - half the time, 100 same time, 200 twice the time",
"text.autoconfig.solarcooker.option.COOK_TIME_FACTOR.@Tooltip[4]": "§7§oDefault: 400",
"text.autoconfig.solarcooker.option.COOK_TIME_FACTOR.@Tooltip[4]": "§7§oMin: 0; Max: 10000",
"text.autoconfig.solarcooker.option.COOK_TIME_FACTOR.@Tooltip[5]": "§7§oDefault: 400",

"text.autoconfig.solarcooker.option.MAX_REFLECTOR_TIME_FACTOR": "Max Reflector time factor",
"text.autoconfig.solarcooker.option.MAX_REFLECTOR_TIME_FACTOR.@Tooltip[0]": "§6§lMax Reflector time factor",
"text.autoconfig.solarcooker.option.MAX_REFLECTOR_TIME_FACTOR.@Tooltip[1]": "Speed factor when reflector slots are filled",
"text.autoconfig.solarcooker.option.MAX_REFLECTOR_TIME_FACTOR.@Tooltip[2]": "in the solar cooker. (percent)",
"text.autoconfig.solarcooker.option.MAX_REFLECTOR_TIME_FACTOR.@Tooltip[3]": "§7§o50 - half the time, 100 same time",
"text.autoconfig.solarcooker.option.MAX_REFLECTOR_TIME_FACTOR.@Tooltip[4]": "§7§oDefault: 50",
"text.autoconfig.solarcooker.option.MAX_REFLECTOR_TIME_FACTOR.@Tooltip[4]": "§7§oMin: 0; Max: 100",
"text.autoconfig.solarcooker.option.MAX_REFLECTOR_TIME_FACTOR.@Tooltip[5]": "§7§oDefault: 50",

"text.autoconfig.solarcooker.option.RECIPE_BLOCKED_LIST": "Recipe blocked list",
"text.autoconfig.solarcooker.option.RECIPE_BLOCKED_LIST.@Tooltip[0]": "§6§lRecipe blocked list",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,11 @@ public class FabricConfigHelper implements ConfigData, IConfigHelper {
@ConfigEntry.Gui.Tooltip(count = 4)
public String VANILLA_RECIPE_TYPE = BuiltInRegistries.RECIPE_TYPE.getKey(VANILLA_RECIPE_TYPE_DEFAULT).getPath();

@ConfigEntry.Gui.Tooltip(count = 5)
@ConfigEntry.BoundedDiscrete(min = (long) (COOK_TIME_FACTOR_MIN * 100), max = (long) (COOK_TIME_FACTOR_MAX * 100))
public long COOK_TIME_FACTOR = (long) (COOK_TIME_FACTOR_DEFAULT * 100);
@ConfigEntry.Gui.Tooltip(count = 6)
public int COOK_TIME_FACTOR = (int) (COOK_TIME_FACTOR_DEFAULT * 100);

@ConfigEntry.Gui.Tooltip(count = 5)
@ConfigEntry.BoundedDiscrete(min = (long) (MAX_REFLECTOR_TIME_FACTOR_MIN * 100), max = (long) (MAX_REFLECTOR_TIME_FACTOR_MAX * 100))
public long MAX_REFLECTOR_TIME_FACTOR = (long) (MAX_REFLECTOR_TIME_FACTOR_DEFAULT * 100);
@ConfigEntry.Gui.Tooltip(count = 6)
public int MAX_REFLECTOR_TIME_FACTOR = (int) (MAX_REFLECTOR_TIME_FACTOR_DEFAULT * 100);

@ConfigEntry.Gui.Tooltip(count = 5)
public String RECIPE_BLOCKED_LIST = RECIPE_BLOCKED_LIST_DEFAULT;
Expand Down Expand Up @@ -61,12 +59,12 @@ public RecipeType<? extends AbstractCookingRecipe> getRecipeType() {

@Override
public double getCookTimeFactor() {
return getConfig().COOK_TIME_FACTOR / 100D;
return Math.clamp(getConfig().COOK_TIME_FACTOR / 100D, COOK_TIME_FACTOR_MIN, COOK_TIME_FACTOR_MAX);
}

@Override
public double getMaxReflectorTimeFactor() {
return getConfig().MAX_REFLECTOR_TIME_FACTOR / 100D;
return Math.clamp(getConfig().MAX_REFLECTOR_TIME_FACTOR / 100D, MAX_REFLECTOR_TIME_FACTOR_MIN, MAX_REFLECTOR_TIME_FACTOR_MAX);
}

@Override
Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

# Project
group=de.cech12.solarcooker
mod_version=4.1.0.0
mod_version=4.1.1.0
mod_id=solarcooker
mod_name=Solar Cooker
mod_author=Cech12
Expand Down

0 comments on commit 484886b

Please sign in to comment.