Added utility methods in IOffPlayer and IOnlinePlayer interfaces
This commit is contained in:
parent
783b6651b0
commit
6a2f14ae39
@ -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();
|
||||
}
|
||||
|
||||
|
||||
|
||||
/*
|
||||
|
@ -41,13 +41,21 @@ public interface IOnlinePlayer extends IOffPlayer {
|
||||
*/
|
||||
|
||||
public default boolean isBedrockClient() {
|
||||
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();
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user