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 0e8a1a5 commit 47dac07
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 17 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
12 changes: 8 additions & 4 deletions common/src/main/resources/assets/woodenbucket/lang/en_us.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,20 +16,23 @@
"text.autoconfig.woodenbucket.option.BREAK_TEMPERATURE.@Tooltip[1]": "Minimum temperature of fluid at which the",
"text.autoconfig.woodenbucket.option.BREAK_TEMPERATURE.@Tooltip[2]": "Wooden Bucket breaks when emptied.",
"text.autoconfig.woodenbucket.option.BREAK_TEMPERATURE.@Tooltip[3]": "§7§oDeactivation by setting a number larger than the hottest fluid",
"text.autoconfig.woodenbucket.option.BREAK_TEMPERATURE.@Tooltip[4]": "§7§oDefault: 1000",
"text.autoconfig.woodenbucket.option.BREAK_TEMPERATURE.@Tooltip[4]": "§7§oMin: -10000; Max: 10000",
"text.autoconfig.woodenbucket.option.BREAK_TEMPERATURE.@Tooltip[5]": "§7§oDefault: 1000",

"text.autoconfig.woodenbucket.option.BURNING_TEMPERATURE": "Burning temperature",
"text.autoconfig.woodenbucket.option.BURNING_TEMPERATURE.@Tooltip[0]": "§6§lBurning temperature",
"text.autoconfig.woodenbucket.option.BURNING_TEMPERATURE.@Tooltip[1]": "Fluid temperature from which you get a burning effect",
"text.autoconfig.woodenbucket.option.BURNING_TEMPERATURE.@Tooltip[2]": "if a Wooden Bucket contains such a hot fluid.",
"text.autoconfig.woodenbucket.option.BURNING_TEMPERATURE.@Tooltip[3]": "§7§oDeactivation by setting a number larger than the hottest fluid",
"text.autoconfig.woodenbucket.option.BURNING_TEMPERATURE.@Tooltip[4]": "§7§oDefault: 1000",
"text.autoconfig.woodenbucket.option.BURNING_TEMPERATURE.@Tooltip[4]": "§7§oMin: -10000; Max: 10000",
"text.autoconfig.woodenbucket.option.BURNING_TEMPERATURE.@Tooltip[5]": "§7§oDefault: 1000",

"text.autoconfig.woodenbucket.option.DURABILITY": "Durability",
"text.autoconfig.woodenbucket.option.DURABILITY.@Tooltip[0]": "§6§lDurability",
"text.autoconfig.woodenbucket.option.DURABILITY.@Tooltip[1]": "Defines the maximum durability of a Wooden Bucket.",
"text.autoconfig.woodenbucket.option.DURABILITY.@Tooltip[2]": "§7§o0: deactivates the durability",
"text.autoconfig.woodenbucket.option.DURABILITY.@Tooltip[3]": "§7§oDefault: 0",
"text.autoconfig.woodenbucket.option.DURABILITY.@Tooltip[3]": "§7§oMin: 0; Max: 10000",
"text.autoconfig.woodenbucket.option.DURABILITY.@Tooltip[4]": "§7§oDefault: 25",

"text.autoconfig.woodenbucket.option.FISH_OBTAINING_ENABLED": "Fish obtaining enabled",
"text.autoconfig.woodenbucket.option.FISH_OBTAINING_ENABLED.@Tooltip[0]": "§6§lFish obtaining enabled",
Expand All @@ -42,7 +45,8 @@
"text.autoconfig.woodenbucket.option.FREEZING_TEMPERATURE.@Tooltip[1]": "Fluid temperature from which you get a freezing effect",
"text.autoconfig.woodenbucket.option.FREEZING_TEMPERATURE.@Tooltip[2]": "if a Wooden Bucket contains such a cold fluid.",
"text.autoconfig.woodenbucket.option.FREEZING_TEMPERATURE.@Tooltip[3]": "§7§oDeactivation by setting a number lower than the coldest fluid",
"text.autoconfig.woodenbucket.option.FREEZING_TEMPERATURE.@Tooltip[4]": "§7§oDefault: -1",
"text.autoconfig.woodenbucket.option.FREEZING_TEMPERATURE.@Tooltip[4]": "§7§oMin: -10000; Max: 10000",
"text.autoconfig.woodenbucket.option.FREEZING_TEMPERATURE.@Tooltip[5]": "§7§oDefault: -1",

"text.autoconfig.woodenbucket.option.MILKING_ENABLED": "Milking enabled",
"text.autoconfig.woodenbucket.option.MILKING_ENABLED.@Tooltip[0]": "§6§lMilking enabled",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,23 +14,19 @@
@Config(name = Constants.MOD_ID)
public class FabricConfigHelper implements ConfigData, IConfigHelper {

@ConfigEntry.Gui.Tooltip(count = 5)
@ConfigEntry.BoundedDiscrete(min = BREAK_TEMPERATURE_MIN, max = BREAK_TEMPERATURE_MAX)
@ConfigEntry.Gui.Tooltip(count = 6)
public long BREAK_TEMPERATURE = BREAK_TEMPERATURE_DEFAULT;

@ConfigEntry.Gui.Tooltip(count = 5)
@ConfigEntry.BoundedDiscrete(min = BURNING_TEMPERATURE_MIN, max = BURNING_TEMPERATURE_MAX)
@ConfigEntry.Gui.Tooltip(count = 6)
public long BURNING_TEMPERATURE = BURNING_TEMPERATURE_DEFAULT;

@ConfigEntry.Gui.Tooltip(count = 4)
@ConfigEntry.BoundedDiscrete(min = DURABILITY_MIN, max = DURABILITY_MAX)
@ConfigEntry.Gui.Tooltip(count = 5)
public long DURABILITY = DURABILITY_DEFAULT;

@ConfigEntry.Gui.Tooltip(count = 4)
public boolean FISH_OBTAINING_ENABLED = FISH_OBTAINING_ENABLED_DEFAULT;

@ConfigEntry.Gui.Tooltip(count = 5)
@ConfigEntry.BoundedDiscrete(min = FREEZING_TEMPERATURE_MIN, max = FREEZING_TEMPERATURE_MAX)
@ConfigEntry.Gui.Tooltip(count = 6)
public long FREEZING_TEMPERATURE = FREEZING_TEMPERATURE_DEFAULT;

@ConfigEntry.Gui.Tooltip(count = 4)
Expand All @@ -47,17 +43,17 @@ private FabricConfigHelper getConfig() {

@Override
public int getBreakTemperature() {
return (int) getConfig().BREAK_TEMPERATURE;
return Math.clamp((int) getConfig().BREAK_TEMPERATURE, BREAK_TEMPERATURE_MIN, BREAK_TEMPERATURE_MAX);
}

@Override
public int getBurningTemperature() {
return (int) getConfig().BURNING_TEMPERATURE;
return Math.clamp((int) getConfig().BURNING_TEMPERATURE, BURNING_TEMPERATURE_MIN, BURNING_TEMPERATURE_MAX);
}

@Override
public int getDurability() {
return (int) getConfig().DURABILITY;
return Math.clamp((int) getConfig().DURABILITY, DURABILITY_MIN, DURABILITY_MAX);
}

@Override
Expand All @@ -67,7 +63,7 @@ public boolean isFishObtainingEnabled() {

@Override
public int getFreezingTemperature() {
return (int) getConfig().FREEZING_TEMPERATURE;
return Math.clamp((int) getConfig().FREEZING_TEMPERATURE, FREEZING_TEMPERATURE_MIN, FREEZING_TEMPERATURE_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.woodenbucket
mod_version=4.1.0.0
mod_version=4.1.1.0
mod_id=woodenbucket
mod_name=Wooden Bucket
mod_author=Cech12
Expand Down

0 comments on commit 47dac07

Please sign in to comment.