mirror of
https://github.com/TeamMidnightDust/MidnightControls.git
synced 2025-12-13 15:25:08 +01:00
Way too many changes & fixes to list here, still got some work to do, but this is coming along great already
30 lines
1.4 KiB
Java
30 lines
1.4 KiB
Java
package eu.midnightdust.midnightcontrols.client.compat;
|
|
|
|
import eu.midnightdust.midnightcontrols.client.controller.InputManager;
|
|
import io.github.kosmx.emotes.arch.gui.screen.ingame.FastChosseScreen;
|
|
import net.minecraft.client.MinecraftClient;
|
|
import net.minecraft.client.gui.screen.Screen;
|
|
|
|
public class EmotecraftCompat {
|
|
public static boolean isEmotecraftScreen(Screen screen) {
|
|
return screen instanceof FastChosseScreen;
|
|
}
|
|
public static void handleEmoteSelector(int index) {
|
|
MinecraftClient client = MinecraftClient.getInstance();
|
|
if (client.currentScreen instanceof FastChosseScreen) {
|
|
int x = client.getWindow().getWidth() / 2;
|
|
int y = client.getWindow().getHeight() / 2;
|
|
if (index == 0) InputManager.queueMousePosition(x-200, y-200);
|
|
if (index == 1) InputManager.queueMousePosition(x, y-200);
|
|
if (index == 2) InputManager.queueMousePosition(x+200, y-200);
|
|
if (index == 3) InputManager.queueMousePosition(x-200, y);
|
|
if (index == 4) InputManager.queueMousePosition(x+200, y);
|
|
if (index == 5) InputManager.queueMousePosition(x-200, y+200);
|
|
if (index == 6) InputManager.queueMousePosition(x, y+200);
|
|
if (index == 7) InputManager.queueMousePosition(x+200, y+200);
|
|
|
|
InputManager.INPUT_MANAGER.updateMousePosition(client);
|
|
}
|
|
}
|
|
}
|