-
-
Notifications
You must be signed in to change notification settings - Fork 107
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
2c2c2b8
commit c724d4e
Showing
3 changed files
with
35 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
24 changes: 24 additions & 0 deletions
24
plugin/src/main/java/com/craftmend/openaudiomc/bungee/utils/BungeeUtils.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
package com.craftmend.openaudiomc.bungee.utils; | ||
|
||
import net.md_5.bungee.UserConnection; | ||
import net.md_5.bungee.api.connection.ProxiedPlayer; | ||
|
||
public class BungeeUtils { | ||
|
||
public static boolean doesUserHaveConfigPhase(ProxiedPlayer player) { | ||
UserConnection connection = (UserConnection) player; | ||
// check if protocol is 764 or higher | ||
return connection.getPendingConnection().getVersion() >= 764; | ||
} | ||
|
||
public static boolean serverSupportsConfigurationPhase() { | ||
// check if the class net.md_5.bungee.protocol.packet.StartConfiguration exists | ||
try { | ||
Class.forName("net.md_5.bungee.protocol.packet.StartConfiguration"); | ||
return true; | ||
} catch (ClassNotFoundException e) { | ||
return false; | ||
} | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters