Skip to content

Commit

Permalink
remove unnecessary access widener
Browse files Browse the repository at this point in the history
not sure how i didnt notice this before ngl, but oh well.
  • Loading branch information
celestialfault committed Feb 2, 2024
1 parent d4d9ffb commit 8c9ad99
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 23 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ as close to the vanilla sprinting behavior as possible, avoiding anti-cheats get

## Modpacks?

Go for it. I'd prefer that the download remains within the Modrinth ecosystem, but as this mod is licensed under [CC-0],
you're free to redistribute it however you see fit (but I'd still appreciate credit where possible).
Go for it. I'd prefer that the download remains within the Modrinth ecosystem, but as this mod is licensed under the
[CC-0], you're free to redistribute it however you see fit (but I'd still appreciate credit where possible).

[YACL]: https://modrinth.com/mod/yacl
[Mod Menu]: https://modrinth.com/mod/modmenu
Expand Down
9 changes: 0 additions & 9 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -49,16 +49,7 @@ tasks.withType(JavaCompile).configureEach {
it.options.release = 17
}

loom {
accessWidenerPath = file("src/main/resources/toggle-toggle-sprint.accesswidener")
}

java {
// Loom will automatically attach sourcesJar to a RemapSourcesJar task and to the "build" task
// if it is present.
// If you remove this line, sources will not be generated.
withSourcesJar()

sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,12 @@ public class ToggleToggleSprint implements ClientModInitializer {

public static final OnPressKeyBinding TOGGLE_SPRINT = new OnPressKeyBinding("key.toggle-toggle-sprint.sprint", GLFW.GLFW_KEY_RIGHT_CONTROL, KeyBinding.MOVEMENT_CATEGORY, () -> {
MinecraftClient client = MinecraftClient.getInstance();
toggleOption(client.options.sprintToggled, client.options.sprintKey, Config.INSTANCE.alsoStartSprinting);
toggleOption(client.options.getSprintToggled(), client.options.sprintKey, Config.INSTANCE.alsoStartSprinting);
});

public static final OnPressKeyBinding TOGGLE_SNEAK = new OnPressKeyBinding("key.toggle-toggle-sprint.sneak", GLFW.GLFW_KEY_RIGHT_SHIFT, KeyBinding.MOVEMENT_CATEGORY, () -> {
MinecraftClient client = MinecraftClient.getInstance();
toggleOption(client.options.sneakToggled, client.options.sneakKey, Config.INSTANCE.alsoStartSneaking);
toggleOption(client.options.getSneakToggled(), client.options.sneakKey, Config.INSTANCE.alsoStartSneaking);
});

@Override
Expand All @@ -45,28 +45,28 @@ private void onTick(MinecraftClient client) {
private void applyJoinStates(MinecraftClient client) {
// Default sprint state
if(Config.INSTANCE.defaultSprintState == Config.ToggleState.ON) {
client.options.sprintToggled.setValue(true);
client.options.getSprintToggled().setValue(true);
// pressing the key is done later
} else if(Config.INSTANCE.defaultSprintState == Config.ToggleState.OFF) {
client.options.sprintToggled.setValue(false);
client.options.getSprintToggled().setValue(false);
// ... but, we still want to ensure that the key is unpressed if we're loading into a world for a
// second time, and the sprint key was toggled when the last one was left
client.options.sprintKey.setPressed(false);
}

// Default sneak state
if(Config.INSTANCE.defaultSneakState == Config.ToggleState.ON) {
client.options.sneakToggled.setValue(true);
client.options.getSneakToggled().setValue(true);
} else if(Config.INSTANCE.defaultSneakState == Config.ToggleState.OFF) {
client.options.sneakToggled.setValue(false);
client.options.getSneakToggled().setValue(false);
client.options.sneakKey.setPressed(false);
}

// Press the keys if they're configured to be pressed when joining a world, and the relevant toggle latch is on
if(Config.INSTANCE.sprintOnJoin && client.options.sprintToggled.getValue() && !client.options.sprintKey.isPressed()) {
if(Config.INSTANCE.sprintOnJoin && client.options.getSprintToggled().getValue() && !client.options.sprintKey.isPressed()) {
client.options.sprintKey.setPressed(true);
}
if(Config.INSTANCE.sneakOnJoin && client.options.sneakToggled.getValue() && !client.options.sneakKey.isPressed()) {
if(Config.INSTANCE.sneakOnJoin && client.options.getSneakToggled().getValue() && !client.options.sneakKey.isPressed()) {
client.options.sneakKey.setPressed(true);
}
}
Expand Down
1 change: 0 additions & 1 deletion src/main/resources/fabric.mod.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
"client": ["me.celestialfault.toggletogglesprint.ToggleToggleSprint"],
"modmenu": ["me.celestialfault.toggletogglesprint.ModMenuCompat"]
},
"accessWidener": "toggle-toggle-sprint.accesswidener",
"mixins": ["toggle-toggle-sprint.mixins.json"],
"depends": {
"fabricloader": ">=0.15",
Expand Down
3 changes: 0 additions & 3 deletions src/main/resources/toggle-toggle-sprint.accesswidener

This file was deleted.

0 comments on commit 8c9ad99

Please sign in to comment.