Added compatibility with GeyserMC/Floodgate
This commit is contained in:
parent
0d6ad6705d
commit
d54cd63fb9
|
@ -473,6 +473,9 @@ public class CommandAdd
|
||||||
|
|
||||||
if (!WhitelistedPlayers.usingEasyWhitelist && authorPermissions.isUserCanUseCommand())
|
if (!WhitelistedPlayers.usingEasyWhitelist && authorPermissions.isUserCanUseCommand())
|
||||||
DiscordClient.ExecuteServerCommand("whitelist add " + finalNameToAdd);
|
DiscordClient.ExecuteServerCommand("whitelist add " + finalNameToAdd);
|
||||||
|
if(MainConfig.getMainConfig().getBoolean("use-geyser/floodgate-compatibility")) {
|
||||||
|
addBedrockUser(finalNameToAdd);
|
||||||
|
}
|
||||||
|
|
||||||
// have to use !invalidMinecraftName else the easy whitelist plugin will add the name regardless of whether it is valid on not
|
// have to use !invalidMinecraftName else the easy whitelist plugin will add the name regardless of whether it is valid on not
|
||||||
if (WhitelistedPlayers.usingEasyWhitelist && !invalidMinecraftName && authorPermissions.isUserCanUseCommand())
|
if (WhitelistedPlayers.usingEasyWhitelist && !invalidMinecraftName && authorPermissions.isUserCanUseCommand())
|
||||||
|
@ -615,4 +618,16 @@ public class CommandAdd
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private static void addBedrockUser(String finalNameToAdd) {
|
||||||
|
String bedrockPrefix = MainConfig.getMainConfig().getString("geyser/floodgate prefix");
|
||||||
|
String bedrockName = bedrockPrefix + finalNameToAdd;
|
||||||
|
if(bedrockName.length() > 16) {
|
||||||
|
bedrockName = bedrockName.substring(0, 16);
|
||||||
|
}
|
||||||
|
//check if we actually NEED to add
|
||||||
|
if(finalNameToAdd.length() < bedrockPrefix.length() || !finalNameToAdd.substring(0, bedrockPrefix.length() - 1).equals(bedrockPrefix)) {
|
||||||
|
DiscordClient.ExecuteServerCommand("whitelist add " + bedrockName);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -157,6 +157,10 @@ public class MainConfig
|
||||||
|
|
||||||
CheckEntry("use-crafatar-for-avatars", false);
|
CheckEntry("use-crafatar-for-avatars", false);
|
||||||
|
|
||||||
|
CheckEntry("use-geyser/floodgate-compatibility", false);
|
||||||
|
|
||||||
|
CheckEntry("geyser/floodgate prefix", "SetThisToWhateverPrefixYouUse");
|
||||||
|
|
||||||
// Remove old role entry if found, move role to new array (for people with v1.3.6 or below)
|
// Remove old role entry if found, move role to new array (for people with v1.3.6 or below)
|
||||||
if(whitelisterBotConfig.get("whitelisted-role") != null)
|
if(whitelisterBotConfig.get("whitelisted-role") != null)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue