Change floodgate hook

This commit is contained in:
HaHaWTH 2024-03-30 13:35:04 +08:00
parent f2876d79fb
commit 7d09faf528
2 changed files with 6 additions and 2 deletions

View File

@ -119,7 +119,7 @@ public class PlayerListener implements Listener{
if (validationService.isUnrestricted(name)) {
return;
}
if (settings.getProperty(HooksSettings.HOOK_FLOODGATE_PLAYER)) {
if (settings.getProperty(HooksSettings.HOOK_FLOODGATE_PLAYER) && settings.getProperty(HooksSettings.IGNORE_BEDROCK_NAME_CHECK)) {
if (getServer().getPluginManager().getPlugin("floodgate") != null) {
if (org.geysermc.floodgate.api.FloodgateApi.getInstance().isFloodgateId(event.getUniqueId())) return;
}

View File

@ -19,12 +19,16 @@ public final class HooksSettings implements SettingsHolder {
public static final Property<Boolean> BUNGEECORD =
newProperty("Hooks.bungeecord", false);
@Comment({"Allow FloodGatePlayer Join Without checkIsValidName()",
@Comment({"Hook into floodgate.",
"This must be true if you want to use other bedrock features."
})
public static final Property<Boolean> HOOK_FLOODGATE_PLAYER =
newProperty("Hooks.floodgate", false);
@Comment("Allow bedrock players join without check isValidName?")
public static final Property<Boolean> IGNORE_BEDROCK_NAME_CHECK =
newProperty("Hooks.ignoreBedrockNameCheck", true);
@Comment("Send player to this BungeeCord server after register/login")
public static final Property<String> BUNGEECORD_SERVER =