1
0
forked from Clones/Controlify

1.1 changelog, bump version, update comparison

This commit is contained in:
isXander
2023-04-14 11:55:30 +01:00
parent 95e1ce2385
commit 20e662f927
16 changed files with 511 additions and 126 deletions

View File

@ -14,6 +14,7 @@ import dev.isxander.controlify.rumble.RumbleSource;
import net.minecraft.CrashReport;
import net.minecraft.CrashReportCategory;
import net.minecraft.ReportedException;
import org.hid4java.HidDevice;
import org.lwjgl.glfw.GLFW;
import java.util.HashMap;
@ -41,7 +42,6 @@ public interface Controller<S extends ControllerState, C extends ControllerConfi
void updateState();
void clearState();
default void open() {}
default void close() {}
RumbleManager rumbleManager();
@ -77,12 +77,13 @@ public interface Controller<S extends ControllerState, C extends ControllerConfi
CrashReportCategory category = crashReport.addCategory("Controller Info");
category.setDetail("Joystick ID", joystickId);
category.setDetail("Controller identification", hidInfo.type());
category.setDetail("HID path", hidInfo.path().orElse("N/A"));
category.setDetail("HID path", hidInfo.hidDevice().map(HidDevice::getPath).orElse("N/A"));
throw new ReportedException(crashReport);
}
}
static void remove(Controller<?, ?> controller) {
controller.close();
CONTROLLERS.remove(controller.uid(), controller);
}