Skip to content

Commit cd34c7e

Browse files
committed
Fix Geyser detection
1 parent c970c1a commit cd34c7e

File tree

1 file changed

+5
-12
lines changed

1 file changed

+5
-12
lines changed

common/src/main/java/me/caseload/knockbacksync/util/GeyserUtil.java

Lines changed: 5 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -40,20 +40,13 @@ public static boolean isGeyserPlayer(UUID uuid) {
4040
if (GEYSER_PRESENT) {
4141
if (GEYSER_API_CLASS == null) {
4242
try {
43-
switch (Base.INSTANCE.getPlatform()) {
44-
case BUKKIT:
45-
case FOLIA:
46-
ClassLoader classLoader = PacketEvents.getAPI().getPlugin().getClass().getClassLoader();
47-
GEYSER_API_CLASS = classLoader.loadClass("org.geysermc.api.GeyserApiBase");
48-
break;
49-
case FABRIC:
50-
GEYSER_CLASS = Class.forName("org.geysermc.api.GeyserApiBase");
51-
GEYSER_PRESENT = true;
52-
break;
53-
}
43+
ClassLoader classLoader = PacketEvents.getAPI().getPlugin().getClass().getClassLoader();
44+
GEYSER_CLASS = classLoader.loadClass("org.geysermc.api.Geyser");
45+
GEYSER_PRESENT = true;
5446
} catch (ClassNotFoundException e) {
55-
e.printStackTrace();
47+
GEYSER_PRESENT = false;
5648
}
49+
CHECKED_FOR_GEYSER = true;
5750
}
5851
if (GEYSER_API_METHOD == null) {
5952
GEYSER_API_METHOD = Reflection.getMethodExact(GEYSER_CLASS, "api", null);

0 commit comments

Comments
 (0)