diff --git a/lib/bin/net/java/games/input/AWTEnvironmentPlugin.class b/lib/bin/net/java/games/input/AWTEnvironmentPlugin.class index fc0b9c0..08ae3f4 100644 Binary files a/lib/bin/net/java/games/input/AWTEnvironmentPlugin.class and b/lib/bin/net/java/games/input/AWTEnvironmentPlugin.class differ diff --git a/lib/bin/net/java/games/input/ControllerEnvironment.class b/lib/bin/net/java/games/input/ControllerEnvironment.class index 4077c1a..7033c54 100644 Binary files a/lib/bin/net/java/games/input/ControllerEnvironment.class and b/lib/bin/net/java/games/input/ControllerEnvironment.class differ diff --git a/lib/bin/net/java/games/input/DefaultControllerEnvironment.class b/lib/bin/net/java/games/input/DefaultControllerEnvironment.class index 1e11efc..2221516 100644 Binary files a/lib/bin/net/java/games/input/DefaultControllerEnvironment.class and b/lib/bin/net/java/games/input/DefaultControllerEnvironment.class differ diff --git a/lib/bin/net/java/games/input/DirectAndRawInputEnvironmentPlugin.class b/lib/bin/net/java/games/input/DirectAndRawInputEnvironmentPlugin.class index 5ded1c6..ee9b572 100644 Binary files a/lib/bin/net/java/games/input/DirectAndRawInputEnvironmentPlugin.class and b/lib/bin/net/java/games/input/DirectAndRawInputEnvironmentPlugin.class differ diff --git a/lib/bin/net/java/games/input/DirectInputEnvironmentPlugin$ShutdownHook.class b/lib/bin/net/java/games/input/DirectInputEnvironmentPlugin$ShutdownHook.class index 1d58975..dea7316 100644 Binary files a/lib/bin/net/java/games/input/DirectInputEnvironmentPlugin$ShutdownHook.class and b/lib/bin/net/java/games/input/DirectInputEnvironmentPlugin$ShutdownHook.class differ diff --git a/lib/bin/net/java/games/input/DirectInputEnvironmentPlugin.class b/lib/bin/net/java/games/input/DirectInputEnvironmentPlugin.class index cabbf12..47b7287 100644 Binary files a/lib/bin/net/java/games/input/DirectInputEnvironmentPlugin.class and b/lib/bin/net/java/games/input/DirectInputEnvironmentPlugin.class differ diff --git a/lib/bin/net/java/games/input/LinuxEnvironmentPlugin$1.class b/lib/bin/net/java/games/input/LinuxEnvironmentPlugin$1.class index 49c4e47..69b94ac 100644 Binary files a/lib/bin/net/java/games/input/LinuxEnvironmentPlugin$1.class and b/lib/bin/net/java/games/input/LinuxEnvironmentPlugin$1.class differ diff --git a/lib/bin/net/java/games/input/LinuxEnvironmentPlugin$ShutdownHook.class b/lib/bin/net/java/games/input/LinuxEnvironmentPlugin$ShutdownHook.class index f2c31a0..d7b7936 100644 Binary files a/lib/bin/net/java/games/input/LinuxEnvironmentPlugin$ShutdownHook.class and b/lib/bin/net/java/games/input/LinuxEnvironmentPlugin$ShutdownHook.class differ diff --git a/lib/bin/net/java/games/input/LinuxEnvironmentPlugin.class b/lib/bin/net/java/games/input/LinuxEnvironmentPlugin.class index 95e2227..a2e83c4 100644 Binary files a/lib/bin/net/java/games/input/LinuxEnvironmentPlugin.class and b/lib/bin/net/java/games/input/LinuxEnvironmentPlugin.class differ diff --git a/lib/bin/net/java/games/input/OSXEnvironmentPlugin.class b/lib/bin/net/java/games/input/OSXEnvironmentPlugin.class index 4e317ff..512b5b5 100644 Binary files a/lib/bin/net/java/games/input/OSXEnvironmentPlugin.class and b/lib/bin/net/java/games/input/OSXEnvironmentPlugin.class differ diff --git a/lib/bin/net/java/games/input/RawInputEnvironmentPlugin.class b/lib/bin/net/java/games/input/RawInputEnvironmentPlugin.class index 44fc8c4..4461038 100644 Binary files a/lib/bin/net/java/games/input/RawInputEnvironmentPlugin.class and b/lib/bin/net/java/games/input/RawInputEnvironmentPlugin.class differ diff --git a/lib/jinput.jar b/lib/jinput.jar index 82579cd..b3465d6 100644 Binary files a/lib/jinput.jar and b/lib/jinput.jar differ diff --git a/src/sig/RabiClone.java b/src/sig/RabiClone.java index e53bf43..0aca154 100644 --- a/src/sig/RabiClone.java +++ b/src/sig/RabiClone.java @@ -51,19 +51,6 @@ public class RabiClone{ public static long lastControllerScan = System.currentTimeMillis(); - private static ControllerEnvironment createDefaultEnvironment() throws ReflectiveOperationException { - - // Find constructor (class is package private, so we can't access it directly) - Constructor constructor = (Constructor) - Class.forName("net.java.games.input.DefaultControllerEnvironment").getDeclaredConstructors()[0]; - - // Constructor is package private, so we have to deactivate access control checks - constructor.setAccessible(true); - - // Create object with default constructor - return constructor.newInstance(); - } - public static void main(String[] args) { Key.InitializeKeyConversionMap(); @@ -95,11 +82,7 @@ public class RabiClone{ long lastGameTime = System.nanoTime(); - try { - CONTROLLERS = createDefaultEnvironment().getControllers(); - } catch (ReflectiveOperationException e) { - e.printStackTrace(); - } + CONTROLLERS = ControllerEnvironment.getDefaultEnvironment().getControllers(); while (true) { long timePassed = System.nanoTime()-lastGameTime; lastGameTime=System.nanoTime(); @@ -150,11 +133,8 @@ public class RabiClone{ OBJ.add(new ConfigureControls(p)); } if (Key.isKeyHeld(KeyEvent.VK_F5)&&System.currentTimeMillis()-lastControllerScan>5000) { - try { - CONTROLLERS=createDefaultEnvironment().getControllers(); - } catch (ReflectiveOperationException e) { - e.printStackTrace(); - } + CONTROLLERS=ControllerEnvironment.getDefaultEnvironment().rescanControllers(); + lastControllerScan=System.currentTimeMillis(); } for (int i=0;i