Added utility methods in IOffPlayer and IOnlinePlayer interfaces

This commit is contained in:
Marc Baloup 2022-01-14 19:38:51 +01:00
parent 783b6651b0
commit 6a2f14ae39
Signed by: marcbal
GPG Key ID: BBC0FE3ABC30B893
2 changed files with 13 additions and 1 deletions

View File

@ -70,6 +70,10 @@ public interface IOffPlayer {
return v == 0 || v == 8; // also 8 if one day we supports alt accounts for floodgate players
}
public default boolean isJavaAccount() {
return !isBedrockAccount();
}
/*

View File

@ -41,13 +41,21 @@ public interface IOnlinePlayer extends IOffPlayer {
*/
public default boolean isBedrockClient() {
return FloodgateApi.getInstance().isFloodgatePlayer(getUniqueId());
try {
return FloodgateApi.getInstance().isFloodgatePlayer(getUniqueId());
} catch (NoClassDefFoundError e) {
return false;
}
}
public default FloodgatePlayer getBedrockClient() {
return FloodgateApi.getInstance().getPlayer(getUniqueId());
}
public default boolean isJavaClient() {
return !isBedrockClient();
}