Skip to content

Commit

Permalink
remove keepSprintingOnDeath as its not relevant on 1.19
Browse files Browse the repository at this point in the history
the config will still load/save it for compatibility with newer versions
using the same config, but otherwise it won't do anything.
  • Loading branch information
celestialfault committed Jan 5, 2024
1 parent c13d231 commit 1134f03
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 16 deletions.
16 changes: 3 additions & 13 deletions src/main/java/me/celestialfault/toggletogglesprint/Config.java
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@ public class Config {
private static final TypeAdapter<JsonObject> ADAPTER = new Gson().getAdapter(JsonObject.class);
public static final Config INSTANCE = new Config();

/**
* this isn't applicable on 1.19.4, but is loaded and saved for compatibility with 1.20.1+ configs
*/
public boolean keepSprintingOnDeath = true;

public boolean sprintOnJoin = true;
Expand Down Expand Up @@ -94,7 +97,6 @@ public Screen getConfigScreen(Screen parent) {
.title(Text.translatable("toggle-toggle-sprint.name"))
.category(ConfigCategory.createBuilder()
.name(Text.translatable("toggle-toggle-sprint.name"))
.group(buildGeneral())
.group(buildSprint())
.group(buildSneak())
.build())
Expand All @@ -103,18 +105,6 @@ public Screen getConfigScreen(Screen parent) {
.generateScreen(parent);
}

private OptionGroup buildGeneral() {
return OptionGroup.createBuilder()
.name(Text.translatable("toggle-toggle-sprint.general"))
.option(Option.<Boolean>createBuilder()
.name(Text.translatable("toggle-toggle-sprint.sprintOnDeath"))
.description(OptionDescription.of(Text.translatable("toggle-toggle-sprint.sprintOnDeath.description")))
.binding(true, () -> keepSprintingOnDeath, value -> this.keepSprintingOnDeath = value)
.controller(TickBoxControllerBuilderImpl::new)
.build())
.build();
}

private OptionGroup buildSprint() {
//noinspection UnstableApiUsage
return OptionGroup.createBuilder()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,6 @@
"toggle-toggle-sprint.state.off": "Off",
"toggle-toggle-sprint.state.unchanged": "Don't modify",

"toggle-toggle-sprint.sprintOnDeath": "Keep sprinting on death",
"toggle-toggle-sprint.sprintOnDeath.description": "If enabled, your sprinting won't be broken upon respawning",

"toggle-toggle-sprint.sprintOnJoin": "Sprint when joining",
"toggle-toggle-sprint.sprintOnJoin.description": "If enabled, you'll start sprinting upon joining a world if your sprint key is set to toggle",
"toggle-toggle-sprint.sprintState": "Default sprinting state",
Expand Down

0 comments on commit 1134f03

Please sign in to comment.