Skip to content

Commit

Permalink
Finish MidnightControls migration
Browse files Browse the repository at this point in the history
  • Loading branch information
Motschen committed Jul 20, 2022
1 parent 09a9584 commit 3e9e890
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 18 deletions.
4 changes: 2 additions & 2 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ loader_version=0.13.3
fabric_version=0.51.1+1.18.2

# Other Dependencies
midnightcontrols_version=1.0.0
midnightlib_version=0.4.0
midnightcontrols_version=1.4.1-1.18
midnightlib_version=0.4.4
spruceui_version=3.3.3+1.18
myron_version=1.6.3+1.18.1
arrp_version=0.5.5
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ public void onInitialize() {

PayloadPackets.init();
AutomobilityData.setup();
ControllerUtils.initMCHandler();
ControllerUtils.initMidnightControlsHandler();
}

public static Identifier id(String path) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,6 @@
import java.util.function.Supplier;

import static org.lwjgl.glfw.GLFW.*;

/*
* LambdaControls is discontinued and this has a nearly 100% chance of being removed in the future (once the mod is broken)
*/
//
public class AutomobilityMidnightControls implements CompatHandler {
public static final PairPredicate<MinecraftClient, ButtonBinding> ON_AUTOMOBILE = (client, button) -> client.player != null && client.player.getVehicle() instanceof AutomobileEntity;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,26 +4,26 @@

public enum ControllerUtils {;
public static boolean accelerating() {
return isMCLoaded() && AutomobilityMidnightControls.ACCELERATE.isButtonDown();
return isMidnightControlsLoaded() && AutomobilityMidnightControls.ACCELERATE.isButtonDown();
}

public static boolean braking() {
return isMCLoaded() && AutomobilityMidnightControls.BRAKE.isButtonDown();
return isMidnightControlsLoaded() && AutomobilityMidnightControls.BRAKE.isButtonDown();
}

public static boolean drifting() {
return isMCLoaded() && AutomobilityMidnightControls.DRIFT.isButtonDown();
return isMidnightControlsLoaded() && AutomobilityMidnightControls.DRIFT.isButtonDown();
}

public static boolean inControllerMode() {
return isMCLoaded() && AutomobilityMidnightControls.IN_CONTROLLER_MODE.get();
return isMidnightControlsLoaded() && AutomobilityMidnightControls.IN_CONTROLLER_MODE.get();
}

public static void initMCHandler() {
if (isMCLoaded()) AutomobilityMidnightControls.init();
public static void initMidnightControlsHandler() {
if (isMidnightControlsLoaded()) AutomobilityMidnightControls.init();
}

public static boolean isMCLoaded() {
public static boolean isMidnightControlsLoaded() {
return FabricLoader.getInstance().isModLoaded("midnightcontrols");
}
}
6 changes: 3 additions & 3 deletions src/main/resources/assets/automobility/lang/en_us.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@
"itemGroup.automobility.automobility_prefabs": "Automobility: Prefabs",

"automobility.automobility": "Automobility",
"lambdacontrols.action.automobility.accelerate_automobile": "Accelerate",
"lambdacontrols.action.automobility.brake_automobile": "Brake/Reverse",
"lambdacontrols.action.automobility.drift_automobile": "Drift",
"midnightcontrols.action.automobility.accelerate_automobile": "Accelerate",
"midnightcontrols.action.automobility.brake_automobile": "Brake/Reverse",
"midnightcontrols.action.automobility.drift_automobile": "Drift",

"item.automobility.automobile": "Automobile",
"item.automobility.crowbar": "Crowbar",
Expand Down

0 comments on commit 3e9e890

Please sign in to comment.