Skip to content

Commit

Permalink
Fix EMI compat
Browse files Browse the repository at this point in the history
  • Loading branch information
Motschen committed Feb 14, 2024
1 parent dd0795b commit cba8a4e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ midnightlib_version=1.5.3-fabric
modmenu_version=7.0.0
emotecraft_version=2.1.3-SNAPSHOT-build.29-MC1.19-fabric
bendylib_version=2.0.+
emi_version=0.5.0+1.19.3
emi_version=1.1.1+1.20.4+fabric
libgui_version=6.0.0+1.19
inventorytabs_version=inventorytabs-0.9.beta-1.19.x
clothconfig_version=7.0.72
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
package eu.midnightdust.midnightcontrols.client.compat;

import dev.emi.emi.api.EmiApi;
import dev.emi.emi.config.EmiConfig;
import dev.emi.emi.screen.EmiScreen;
import dev.emi.emi.screen.EmiScreenManager;
import eu.midnightdust.midnightcontrols.client.MidnightControlsClient;
import eu.midnightdust.midnightcontrols.client.controller.ButtonBinding;
import eu.midnightdust.midnightcontrols.client.controller.ButtonCategory;
import eu.midnightdust.midnightcontrols.client.controller.InputManager;
import net.minecraft.client.gui.screen.ingame.HandledScreen;
import org.aperlambda.lambdacommon.Identifier;
import org.jetbrains.annotations.NotNull;
import org.lwjgl.glfw.GLFW;
Expand All @@ -30,13 +29,13 @@ public void handle(@NotNull MidnightControlsClient mod) {
.buttons(GLFW.GLFW_GAMEPAD_BUTTON_LEFT_BUMPER, ButtonBinding.axisAsButton(GLFW.GLFW_GAMEPAD_AXIS_LEFT_TRIGGER, true))
.category(category)
.action((client,action,value,buttonState)->handleTabs(false)).cooldown()
.filter(((client, buttonBinding) -> client.currentScreen instanceof HandledScreen<?> || client.currentScreen instanceof EmiScreen))
.filter(((client, buttonBinding) -> EmiApi.getHandledScreen() != null))
.register();
new ButtonBinding.Builder("emi_page_right")
.buttons(GLFW.GLFW_GAMEPAD_BUTTON_RIGHT_BUMPER, ButtonBinding.axisAsButton(GLFW.GLFW_GAMEPAD_AXIS_RIGHT_TRIGGER, true))
.category(category)
.action((client,action,value,buttonState)->handleTabs(true)).cooldown()
.filter(((client, buttonBinding) -> client.currentScreen instanceof HandledScreen<?> || client.currentScreen instanceof EmiScreen))
.filter(((client, buttonBinding) -> EmiApi.getHandledScreen() != null))
.register();
}
public static boolean isEMIEnabled() {
Expand Down

0 comments on commit cba8a4e

Please sign in to comment.