Skip to content

Commit

Permalink
Merge pull request #4 from umjammer/0.0.5
Browse files Browse the repository at this point in the history
0.0.5
  • Loading branch information
umjammer authored Apr 26, 2024
2 parents a1761e5 + e299e3f commit 6ccdd3b
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 9 deletions.
9 changes: 5 additions & 4 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

<groupId>vavi</groupId>
<artifactId>vavi-apps-hub</artifactId>
<version>0.0.4</version>
<version>0.0.5</version>

<properties>
<javapackager.name>Hub</javapackager.name>
Expand Down Expand Up @@ -71,6 +71,7 @@

<additionalResources>
<additionalResource>${project.build.resources[0].directory}/logging.properties</additionalResource>
<additionalResource>${project.build.resources[0].directory}/minecraft.properties</additionalResource>
<additionalResource>${project.build.resources[0].directory}/static</additionalResource>
<additionalResource>local.properties</additionalResource>
</additionalResources>
Expand Down Expand Up @@ -176,7 +177,7 @@
<dependency>
<groupId>com.github.umjammer</groupId> <!-- vavi / com.github.umjammer -->
<artifactId>vavi-awt-joystick</artifactId>
<version>0.0.11</version>
<version>0.0.12</version>
</dependency>

<dependency>
Expand All @@ -189,7 +190,7 @@
<dependency>
<groupId>jakarta.websocket</groupId>
<artifactId>jakarta.websocket-api</artifactId>
<version>2.1.1</version>
<version>2.2.0-M1</version>
</dependency>
<dependency>
<groupId>org.eclipse.jetty.ee10.websocket</groupId>
Expand Down Expand Up @@ -253,7 +254,7 @@
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-jdk14</artifactId>
<version>2.0.11</version>
<version>2.0.13</version>
</dependency>
<dependency>
<groupId>com.github.umjammer</groupId>
Expand Down
18 changes: 13 additions & 5 deletions src/main/java/vavi/games/input/listener/MinecraftListener.java
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,9 @@
import java.awt.MouseInfo;
import java.awt.Point;
import java.awt.Rectangle;
import java.io.IOException;
import java.util.NoSuchElementException;
import java.util.Properties;
import java.util.concurrent.Executors;
import java.util.concurrent.atomic.AtomicReference;
import java.util.logging.Level;
Expand Down Expand Up @@ -58,11 +60,17 @@ public class MinecraftListener extends GamepadAdapter {
private static final String bundleId = "com.mojang.Minecraft";

/** minecraft launchers descriptor#dusplayName */
private static final String[] mcLaunchers = {
"net.minecraft.client.main.Main", // mc launcher -> original
"net.fabricmc.loader.impl.launch.knot.KnotClient", // mc launcher -> fabric
"org.prismlauncher.EntryPoint" // prism launcher
};
private static final String[] mcLaunchers;

static {
try {
Properties props = new Properties();
props.load(MinecraftListener.class.getResourceAsStream("/minecraft.properties"));
mcLaunchers = props.stringPropertyNames().toArray(String[]::new);
} catch (IOException e) {
throw new IllegalStateException(e);
}
}

private long prevForBounds;

Expand Down
7 changes: 7 additions & 0 deletions src/main/resources/minecraft.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# mc launcher -> original\
net.minecraft.client.main.Main
# mc launcher -> fabric
net.fabricmc.loader.impl.launch.knot.KnotClient
net.fabricmc.devlaunchinjector.Main
# prism launcher
org.prismlauncher.EntryPoint

0 comments on commit 6ccdd3b

Please sign in to comment.