添加对 floodgate 的支持
This commit is contained in:
@@ -52,6 +52,7 @@ import org.bukkit.event.player.PlayerRespawnEvent;
|
||||
import org.bukkit.event.player.PlayerShearEntityEvent;
|
||||
import org.bukkit.event.player.PlayerSwapHandItemsEvent;
|
||||
import org.bukkit.inventory.InventoryView;
|
||||
import org.geysermc.floodgate.api.FloodgateApi;
|
||||
|
||||
import javax.inject.Inject;
|
||||
import java.util.Locale;
|
||||
@@ -112,7 +113,9 @@ public class PlayerListener implements Listener {
|
||||
if (validationService.isUnrestricted(name)) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (settings.getProperty(RestrictionSettings.HOOK_FLOODGATE_PLAYER) && FloodgateApi.getInstance().isFloodgateId(event.getUniqueId())){
|
||||
return;
|
||||
}
|
||||
// Non-blocking checks
|
||||
try {
|
||||
onJoinVerifier.checkIsValidName(name);
|
||||
@@ -120,6 +123,7 @@ public class PlayerListener implements Listener {
|
||||
event.setKickMessage(messages.retrieveSingle(name, e.getReason(), e.getArgs()));
|
||||
event.setLoginResult(AsyncPlayerPreLoginEvent.Result.KICK_OTHER);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/*
|
||||
|
||||
@@ -125,6 +125,9 @@ public final class RestrictionSettings implements SettingsHolder {
|
||||
public static final Property<String> ALLOWED_NICKNAME_CHARACTERS =
|
||||
newProperty("settings.restrictions.allowedNicknameCharacters", "[a-zA-Z0-9_]*");
|
||||
|
||||
@Comment("Allow FloodGatePlayer Join Without checkIsValidName()")
|
||||
public static final Property<Boolean> HOOK_FLOODGATE_PLAYER =
|
||||
newProperty("settings.restrictions.hookFloodGatePlayer", false);
|
||||
@Comment({
|
||||
"How far can unregistered players walk?",
|
||||
"Set to 0 for unlimited radius"
|
||||
|
||||
@@ -15,6 +15,7 @@ softdepend:
|
||||
- Essentials
|
||||
- EssentialsSpawn
|
||||
- ProtocolLib
|
||||
- floodgate
|
||||
commands:
|
||||
authme:
|
||||
description: AuthMe op commands
|
||||
|
||||
Reference in New Issue
Block a user