FriendGuard
FriendGuard 保护配置列表中的玩家,防止在 Paper 服务器上被意外或不必要的封禁(ban)和踢出(kick)。
受保护的玩家会在必要时自动保持在线并解除封禁,同时插件会定期检查服务器标准的封禁列表,以捕获针对离线玩家的封禁。
工作原理
FriendGuard 实时监控玩家的管理操作:
- 对处于在线状态的受保护玩家,踢出操作会被立即取消。
- 当封禁目标为当前在线的受保护玩家时,封禁操作会被立即取消。
- 被封禁的受保护玩家在尝试加入服务器时会自动获得赦免。
- 可配置的后台任务会定期检查离线封禁并将其移除。
- 解除封禁使用的是服务器管理员可用的
pardon / pardon-ip 命令,而不是直接依赖 Paper 底层的 BanList<T> API。
这种方法避免了对版本敏感的内部机制的依赖。在较新的 Paper 版本中,封禁列表 API 是强类型的,且 IP 条目使用 InetAddress 而非 String,这可能导致在不同构建版本之间直接使用 API 变得不必要地脆弱。
配置
config.yml 提供以下选项:
protected-players:
- PlayerName
protected-uuids:
- uuid-here
protected-ips:
- 127.0.0.1
settings:
log-to-console: true
check-interval-ticks: 20
配置选项
protected-players
需要保护的玩家名称。
protected-uuids
受保护玩家的 UUID。当您希望保护状态与玩家身份绑定而非其当前名称绑定时非常有用。
protected-ips
需要防止 IP 封禁的 IP 地址。
settings.log-to-console
控制是否将 FriendGuard 的保护操作报告记录到服务器控制台。
settings.check-interval-ticks
控制后台保护检查运行的频率。例如,20 tick 大约为一秒。
命令
/friendguard reload
重新加载配置文件。
/friendguard check
立即运行一次保护检查。
别名:
/fg
兼容性
FriendGuard 与标准的 Paper/Vanilla 封禁系统兼容——即 /ban、/ban-ip、/pardon 和 /pardon-ip 所使用的相同封禁列表。
第三方封禁插件
FriendGuard 不会自动与独立的封禁系统(如 LiteBans、AdvancedBan 或其他维护自己封禁数据库的插件)集成。
如果您的服务器使用的是自定义封禁系统而非标准的 Paper/Vanilla 封禁列表,FriendGuard 可能无法检测或移除这些封禁。在这种情况下,需要为该封禁插件提供专用的集成支持。
FriendGuard
FriendGuard protects a configurable list of players from accidental or unwanted bans and kicks on your Paper server.
Protected players are automatically kept online and unbanned when necessary, while the plugin periodically checks the standard server ban lists to catch offline bans as well.
How It Works
FriendGuard monitors player moderation actions in real time:
- Kicks are immediately cancelled for protected online players.
- Bans are immediately cancelled when they target a protected player who is currently online.
- Banned protected players are automatically pardoned when they attempt to join.
- A configurable background task periodically checks for offline bans and removes them as well.
- Unbanning is performed using the same
pardon / pardon-ip commands available to server administrators, rather than relying directly on Paper's low-level BanList<T> API.
This approach avoids depending on version-sensitive internals. In newer Paper versions, the ban-list API is strongly typed and IP entries use InetAddress instead of String, which can make direct API usage unnecessarily fragile between builds.
Configuration
config.yml provides the following options:
protected-players:
- PlayerName
protected-uuids:
- uuid-here
protected-ips:
- 127.0.0.1
settings:
log-to-console: true
check-interval-ticks: 20
Configuration Options
protected-players
Player names that should be protected.
protected-uuids
UUIDs of protected players. Useful when you want protection to remain tied to the player rather than their current name.
protected-ips
IP addresses that should be protected from IP bans.
settings.log-to-console
Controls whether FriendGuard reports protection actions to the server console.
settings.check-interval-ticks
Controls how often the background protection check runs. For example, 20 ticks is approximately one second.
Commands
/friendguard reload
Reload the configuration.
/friendguard check
Immediately run a protection check.
Alias:
/fg
Compatibility
FriendGuard works with the standard Paper/Vanilla ban system — the same ban lists used by:
/ban
/ban-ip
/pardon
/pardon-ip
Third-Party Ban Plugins
FriendGuard does not automatically integrate with separate ban systems such as LiteBans, AdvancedBan, or other plugins that maintain their own ban database.
If your server uses a custom ban system instead of the standard Paper/Vanilla ban lists, FriendGuard may not be able to detect or remove those bans. In that case, a dedicated integration for that ban plugin would be required.
评论 0
登录后参与评分
还没有评论,来抢沙发吧