!!! 请阅读说明 | 需要进行少量配置。 !!!
FloodGuard
针对 Paper 服务器的服务端防护,用于抵御自动化的流体、TNT、红石、飞行机器、爆炸及方块类恶意破坏行为。
FloodGuard 监控可疑的自动化操作,并提供可配置的检测、遏制、警报以及可选的回滚功能,无需安装客户端模组。
平台: Paper 1.21+
Java: 21+
环境: 服务端
许可证: GPL-3.0
特性
FloodGuard 结合了事件监控、机器检测、行为分析、可配置限制、员工警报以及可选的回滚功能。
支持的防护领域包括:
- 飞行机器
- TNT 机器及自动化 TNT 系统
- TNT 复制机制
- TNT 矿车
- 基于水的机器及洪水泛滥
- 基于熔岩的机器及熔岩浇筑
- 细雪
- 活塞及移动方块结构
- 发射器及自动化触发器
- 红石时钟及重复激活
- 大规模或异常的方块移动
- 重复爆炸
- 其他可配置的破坏模式
检测机制不会将普通玩家活动视为恶意行为。管理员可以配置阈值、检测类别、世界范围以及响应措施。
飞行机器
FloodGuard 可以监控基于活塞的移动结构,并识别通常与自动化机器相关的模式。
检测可以使用以下因素:
- 活塞活动
- 黏液块和蜂蜜块的连接
- 侦测器控制的移动
- 重复的移动模式
- 移动方块结构
- 机器尺寸
- 机器移动频率
- 附近的爆炸载荷
- 附近的流体源
当超过配置的阈值时,FloodGuard 可以遏制该机器,取消相关激活,通知工作人员,并记录检测结果。
TNT 防护
FloodGuard 可以监控自动化 TNT 系统及可疑的爆炸结构。
示例包括:
- 附着在移动机器上的 TNT
- 自动化 TNT 发射器
- 重复 TNT 系统
- 基于 TNT 的破坏机器
- 可疑的 TNT 发射器
- 自动化爆炸机制
- TNT 矿车系统
可能的响应措施包括:
- 取消危险激活
- 阻止机器继续运行
- 移除配置的危險方块或实体
- 防止配置的爆炸发生
- 通知工作人员
- 记录检测结果
TNT 复制
FloodGuard 可以检测与自动化 TNT 复制及自动化 TNT 生产相关的可配置模式。
检测可能会考虑以下组合:
- 活塞
- 黏液块
- 蜂蜜块
- TNT
- 侦测器
- 红石时钟
- 重复激活模式
- 机器移动
检测基于行为而非依赖单个方块或布局。这允许管理员根据其服务器调整保护阈值。
TNT 矿车
FloodGuard 可以监控可疑的 TNT 矿车活动。
防护可以涵盖:
- TNT 矿车炮台
- 自动化爆炸轨道系统
- 重复的 TNT 矿车攻击
- 红石控制的 TNT 矿车系统
根据配置,FloodGuard 可以取消危险激活,移除爆炸实体,停止关联机器,并警告工作人员。
水防护
FloodGuard 可以限制基于水的自动化破坏行为。
防护可以检测或响应以下内容:
- 自动化水机器
- 飞行水机器
- 基于发射器的洪水
- 大型自动化瀑布
- 重复的水源放置
- 移动机器周围的流体活动
管理员可以配置检测半径和传播限制。
示例:
water:
enabled: true
detection-radius: 5
spread-limit: 2
FloodGuard 可以选择停止关联机器,限制进一步扩散,移除配置的水源方块,并通知工作人员。
熔岩防护
由于大型自动化熔岩系统会损坏建筑并产生大量的方块更新活动,因此可以单独监控熔岩。
可能的检测内容包括:
- 熔岩机器
- 自动化熔岩浇筑
- 熔岩洪水系统
- 基于发射器的熔岩系统
- 附着在移动机器上的熔岩
- 异常的熔岩传播
配置的响应措施可能包括限制传播、停止关联机器活动、移除选定的水源方块,并警告工作人员。
细雪
细雪可以作为独立的防护类别进行处理。
检测系统设计为可扩展的,以便在不重写整个防护系统的情况下集成额外的基于方块的流体或传播机制。
自定义流体
FloodGuard 可以为兼容的其他插件或服务器 API 提供的自定义流体暴露配置选项。
示例:
fluids:
custom:
ExamplePlugin:
- ExampleFluid
自定义流体支持取决于已安装的服务器和插件所暴露的 API 和事件。FloodGuard 不应假设每个第三方流体的行为都与原版水或熔岩完全相同。
方块防护
FloodGuard 可以监控通常用作自动化破坏机器组件的基于方块的机制。
支持的监控内容可能包括:
- 活塞
- 侦测器
- 发射器
- 投掷器
- 中继器
- 比较器
- 红石激活
- 移动结构
- 自动化方块放置
- 自动化方块交互
目标是在不干扰正常农场、门、运输系统或其他合法红石建筑的前提下,识别破坏性行为。
红石检测
FloodGuard 可以监控高频红石活动,而无需将每个红石电路都视为恶意行为。
潜在信号包括:
- 快速活塞激活
- 侦测器循环
- 中继器时钟
- 比较器时钟
- 重复的发射器激活
- 重复的机器周期
- 异常的激活频率
- 大型自动化机制
除非超过配置的检测阈值,否则正常的农场和红石建筑应保持功能正常。
机器分析
FloodGuard 应在采取破坏性保护动作之前评估多个信号。
可能的输入包括:
结构
移动
红石
流体
爆炸物
频率
尺寸
重复次数
潜在伤害
随后可为机器分配一个可配置的风险评分。
示例:
[FloodGuard]
检测到威胁
玩家:ExamplePlayer
类型:自动化 TNT 机器
风险:95
操作:机器已遏制
世界:生存模式
位置:1250, 72, -430
风险评分旨在通过结合多个指标而非依赖单一规则来减少误报。
防护操作
防护响应是可配置的。
根据检测到的威胁,FloodGuard 可以:
取消激活
停止机器活动
限制流体传播
阻止配置的爆炸
移除配置的爆炸方块
移除配置的爆炸实体
通知工作人员
记录事件
排队支持的回滚操作
每个防护模块应在可行情况下暴露其自身的配置。
警报
FloodGuard 提供可配置的工作人员通知。
警报可发送至:
控制台
操作员
拥有 floodguard.notify 权限的用户
支持的外部集成
示例:
[FloodGuard]
检测到威胁
玩家:ExamplePlayer
类型:飞行 TNT 机器
风险:95
操作:机器已禁用
位置:生存模式 1250 72 -430
统计信息
FloodGuard 可以维护有界统计信息以记录检测到的活动。
可能的统计项包括:
总检测次数
TNT 检测次数
飞行机器检测次数
流体检测次数
爆炸检测次数
已遏制的机器数量
发送的警报数量
回滚操作次数
使用以下命令查看统计信息:
/floodguard stats
回滚
FloodGuard 可选择性地跟踪由检测到的威胁引起的受支持的方块变更。
可使用可配置项限制回滚存储:
时间窗口
区块限制
存储限制
保留设置
回滚应针对大型服务器进行优化,且不应存储无限的历史数据。
仍需定期维护服务器备份。
管理
FloodGuard 通过命令和可选的仅限管理员的 GUI 提供管理控制。
命令
命令 描述
/floodguard status 显示防护状态
/floodguard stats 显示检测统计信息
/floodguard reload 重新加载配置
/floodguard toggle 切换配置的防护
/fg 命令别名
权限
权限 描述
floodguard.admin 完全管理访问权限
floodguard.notify 接收防护警报
floodguard.bypass 绕过配置的防护
仅信任的管理员应获得 floodguard.bypass 权限。
管理员 GUI
可选的 GUI 仅限于拥有所需管理权限的用户使用。
GUI 可暴露以下控件:
防护模块
检测类别
检测阈值
机器半径
TNT 半径
流体半径
风险设置
世界排除项
警报设置
回滚设置
性能限制
统计信息
调试模式
通过 GUI 进行的更改应使用与手动配置编辑相同的经过验证的配置系统。
敏感操作在执行前应要求确认。
清理积水
FloodGuard 可为仅管理员使用的命令提供支持,用于移除指定 Y 轴高度上方的水源方块。
示例:
/floodguard remove-water <height>
该实现应满足以下要求:
- 需要管理员权限
- 需要有效的 Y 轴高度参数
- 仅在允许的世界中生效
- 根据配置规则定位水源方块
- 避免无限制的整个世界扫描
- 提供进度或完成反馈
- 遵守服务器性能限制
具体命令行为可能因最终实现而有所不同。
世界控制
可以为选定的世界禁用保护功能。
示例:
worlds:
disabled:
- creative
- testing
这允许服务器在生产世界中保持保护启用,同时在专用的测试世界中解除限制。
配置
示例配置如下:
enabled: true
debug: false
protection:
flying-machines: true
tnt: true
tnt-duplication: true
tnt-minecarts: true
water: true
lava: true
powder-snow: true
explosions: true
redstone-machines: true
detection:
machine-radius: 5
tnt-radius: 5
fluid-radius: 5
actions:
stop-machine: true
cancel-explosion: true
notify-staff: true
rollback: true
worlds:
disabled: []
fluids:
custom: {}
实际配置可能包含更多选项,具体取决于已安装的版本。```
性能
FloodGuard 旨在适用于多人在线服务器,包括玩家数量较多且自动化程度较高的服务器。
该实现应优先采用:
- 基于事件驱动的检测机制
- 缓存的机器数据
- 有界集合(Bounded collections)
- 有限的区块访问
- 在 API 安全的前提下进行异步处理
- 计划性清理任务
- 可配置的扫描限制
- 有界的回滚存储
FloodGuard 应避免持续扫描整个世界或仅为后台检测而加载区块。
保护逻辑还应避免不必要的:
- 同步重型计算
- 重复的方块搜索
- 无界的内存增长
- 线程创建
- 持久化存储的增长
兼容性
FloodGuard 针对以下环境:
Minecraft Java Edition
Paper 1.21+
Java 21+
FloodGuard 是一个 Paper 插件,不提供原生的 Bedrock 服务器支持。
与第三方插件的兼容性取决于这些插件所暴露的 API 和事件。
安装
- 安装 Paper 1.21+。
- 安装 Java 21 或更高版本。
- 将 FloodGuard.jar 放入服务器的 plugins 目录中。
- 启动服务器一次。
- 停止服务器。
- 编辑 plugins/FloodGuard/config.yml 文件。
- 再次启动服务器。
建议在向生产世界部署激进的保护或回滚设置之前,先在服务器副本上测试配置。
局限性
FloodGuard 使用可配置的检测和行为分析机制。它不能保证完美检测每一种可能的红石机器、漏洞利用、恶意破坏设计或未来的 Minecraft 机制。
检测准确性取决于以下因素:
- Minecraft 版本
- Paper API 的行为
- 机器设计
- 插件交互
- 配置的阈值
- 可用的事件和服务器数据
新的 Minecraft 机制可能需要更新检测模块。
因此,在实时服务器上启用限制性设置之前,应使用现有的农场、红石系统、运输系统和其他自动化设施对 FloodGuard 进行测试。
隐私
FloodGuard 仅应保留配置的保护、日志记录、统计和回滚功能所需的信息。
保留期限应可配置。
除非服务器管理员明确启用并配置此类功能,否则插件不得将服务器数据传输到外部服务。
开发
FloodGuard 旨在采用模块化架构,以便在不替换整个检测引擎的情况下扩展各个保护模块。
实现应优先考虑:
- 可维护性
- 可测试性
- 清晰的模块边界
- 防御性错误处理
- 受限的资源使用
- 版本感知的 Minecraft 集成
- 清晰的配置验证
项目状态
FloodGuard 旨在成为:
- 生产就绪
- 模块化
- 可扩展
- 完全可配置
- 文档完善
- 抗错误
- 针对多人游戏环境优化
随着 Minecraft 和 Paper 机制的演进,未来版本可能会扩展功能。
许可证
FloodGuard 根据 GNU 通用公共许可证 v3.0 (GPL-3.0) 授权。
您可以根据 GPL-3.0 使用、修改和重新分发 FloodGuard。
完整许可证文本:
!!! READ THE DESCRIPTION PLEASE | THERE WILL BE A LITTLE BIT OF CONFIGURATION. !!!
FloodGuard
Server-side protection for Paper servers against automated fluid, TNT, redstone, flying-machine, explosion, and block-based griefing.
FloodGuard monitors suspicious automation and provides configurable detection, containment, alerts, and optional rollback functionality without requiring a client-side mod.
Platform: Paper 1.21+
Java: 21+
Environment: Server-side
License: GPL-3.0
Features
FloodGuard combines event monitoring, machine detection, behavior analysis, configurable limits, staff alerts, and optional rollback features.
Supported protection areas include:
- Flying machines
- TNT machines and automated TNT systems
- TNT duplication mechanisms
- TNT minecarts
- Water-based machines and flooding
- Lava-based machines and lava casting
- Powder snow
- Pistons and moving block structures
- Dispensers and automated triggers
- Redstone clocks and repetitive activation
- Large or abnormal block movement
- Repeated explosions
- Other configurable grief patterns
Detection does not need to treat ordinary player activity as malicious. Administrators can configure thresholds, detection categories, worlds, and responses.
Flying Machines
FloodGuard can monitor piston-based moving structures and identify patterns commonly associated with automated machines.
Detection can use factors such as:
- Piston activity
- Slime and honey block connections
- Observer-controlled movement
- Repeated movement patterns
- Moving block structures
- Machine size
- Machine movement frequency
- Nearby explosive payloads
- Nearby fluid sources
When configured thresholds are exceeded, FloodGuard can contain the machine, cancel relevant activation, notify staff, and record the detection.
TNT Protection
FloodGuard can monitor automated TNT systems and suspicious explosive structures.
Examples include:
- TNT attached to moving machines
- Automated TNT launchers
- Repeating TNT systems
- TNT-based grief machines
- Suspicious TNT dispensers
- Automated explosive mechanisms
- TNT minecart systems
Possible responses include:
- Cancelling dangerous activation
- Preventing continued machine operation
- Removing configured dangerous blocks or entities
- Preventing configured explosions
- Notifying staff
- Logging the detection
TNT Duplication
FloodGuard can detect configurable patterns associated with automated TNT duplication and automated TNT production.
Detection may consider combinations of:
- Pistons
- Slime blocks
- Honey blocks
- TNT
- Observers
- Redstone clocks
- Repeated activation patterns
- Machine movement
Detection is behavior-based rather than relying on a single block or layout. This allows administrators to tune protection thresholds for their server.
TNT Minecarts
FloodGuard can monitor suspicious TNT minecart activity.
Protection can cover:
- TNT minecart cannons
- Automated explosive rail systems
- Repeating TNT minecart attacks
- Redstone-controlled TNT minecart systems
Depending on configuration, FloodGuard can cancel dangerous activation, remove explosive entities, stop associated machines, and alert staff.
Water Protection
FloodGuard can limit automated water-based griefing.
Protection can detect or respond to:
- Automated water machines
- Flying water machines
- Dispenser-based flooding
- Large automated waterfalls
- Repeated source placement
- Fluid activity around moving machines
Administrators can configure detection radius and propagation limits.
Example:
water:
enabled: true
detection-radius: 5
spread-limit: 2
FloodGuard can optionally stop the associated machine, limit further spreading, remove configured source blocks, and notify staff.
Lava Protection
Lava can be monitored separately because large automated lava systems can damage builds and generate significant block-update activity.
Possible detections include:
Lava machines
Automated lava casting
Lava flood systems
Dispenser-based lava systems
Lava attached to moving machines
Abnormal lava propagation
Configured responses can include limiting propagation, stopping associated machine activity, removing selected source blocks, and alerting staff.
Powder Snow
Powder snow can be handled as a separate protection category.
The detection system is intended to be extensible so additional block-based fluid or propagation mechanics can be integrated without rewriting the entire protection system.
Custom Fluids
FloodGuard can expose configuration for compatible custom fluids provided by other plugins or server APIs.
Example:
fluids:
custom:
ExamplePlugin:
- ExampleFluid
Custom-fluid support depends on the APIs and events exposed by the installed server and plugins. FloodGuard should not assume that every third-party fluid behaves identically to vanilla water or lava.
Block Protection
FloodGuard can monitor block-based mechanisms commonly used as components of automated grief machines.
Supported monitoring can include:
Pistons
Observers
Dispensers
Droppers
Repeaters
Comparators
Redstone activation
Moving structures
Automated block placement
Automated block interaction
The goal is to identify destructive behavior without unnecessarily interfering with normal farms, doors, transportation systems, or other legitimate redstone builds.
Redstone Detection
FloodGuard can monitor high-frequency redstone activity without requiring every redstone circuit to be treated as malicious.
Potential signals include:
Rapid piston activation
Observer loops
Repeater clocks
Comparator clocks
Repeated dispenser activation
Repeated machine cycles
Abnormal activation frequency
Large automated mechanisms
Normal farms and redstone builds should remain functional unless configured detection thresholds are exceeded.
Machine Analysis
FloodGuard should evaluate multiple signals before taking a destructive protection action.
Possible inputs include:
Structure
Movement
Redstone
Fluids
Explosives
Frequency
Size
Repetition
Potential damage
A machine can then be assigned a configurable risk score.
Example:
[FloodGuard]
Threat detected
Player: ExamplePlayer
Type: Automated TNT Machine
Risk: 95
Action: Machine contained
World: survival
Location: 1250, 72, -430
Risk scoring is intended to reduce false positives by combining multiple indicators instead of relying on a single rule.
Protection Actions
Protection responses are configurable.
Depending on the detected threat, FloodGuard can:
Cancel an activation
Stop machine activity
Limit fluid propagation
Prevent configured explosions
Remove configured explosive blocks
Remove configured explosive entities
Notify staff
Log the event
Queue supported rollback operations
Each protection module should expose its own configuration where practical.
Alerts
FloodGuard provides configurable staff notifications.
Alerts can be sent to:
Console
Operators
Users with floodguard.notify
Supported external integrations
Example:
[FloodGuard]
Threat detected
Player: ExamplePlayer
Type: Flying TNT Machine
Risk: 95
Action: Machine Disabled
Location: survival 1250 72 -430
Statistics
FloodGuard can maintain bounded statistics for detected activity.
Possible statistics include:
Total detections
TNT detections
Flying-machine detections
Fluid detections
Explosion detections
Machines contained
Alerts sent
Rollback operations
View statistics with:
/floodguard stats
Rollback
FloodGuard can optionally track supported block changes caused by detected threats.
Rollback storage can be limited using configurable:
Time windows
Chunk limits
Storage limits
Retention settings
Rollback should be optimized for large servers and should not store unlimited historical data.
Regular server backups should still be maintained.
Administration
FloodGuard provides administrative controls through commands and an optional operator-only GUI.
Commands
Command Description
/floodguard status Display protection status
/floodguard stats Display detection statistics
/floodguard reload Reload configuration
/floodguard toggle Toggle configured protection
/fg Command alias
Permissions
Permission Description
floodguard.admin Full administrative access
floodguard.notify Receive protection alerts
floodguard.bypass Bypass configured protection
Only trusted administrators should receive floodguard.bypass.
Admin GUI
The optional GUI is restricted to users with the required administrative permission.
The GUI can expose controls for:
Protection modules
Detection categories
Detection thresholds
Machine radius
TNT radius
Fluid radius
Risk settings
World exclusions
Alert settings
Rollback settings
Performance limits
Statistics
Debug mode
Changes made through the GUI should use the same validated configuration system as manual configuration edits.
Sensitive actions should require confirmation before execution.
Water Cleanup
FloodGuard can provide an operator-only command for removing water source blocks above a specified Y-level.
Example:
/floodguard remove-water <height>
The implementation should:
Require administrator permission
Require a valid height
Operate only in allowed worlds
Target water source blocks according to configured rules
Avoid unnecessary unrestricted world scanning
Provide progress or completion feedback
Respect server performance limits
The exact command behavior may vary with the final implementation.
World Controls
Protection can be disabled for selected worlds.
Example:
worlds:
disabled:
- creative
- testing
This allows servers to keep protection enabled in production worlds while leaving dedicated testing worlds unrestricted.
Configuration
Example configuration:
enabled: true
debug: false
protection:
flying-machines: true
tnt: true
tnt-duplication: true
tnt-minecarts: true
water: true
lava: true
powder-snow: true
explosions: true
redstone-machines: true
detection:
machine-radius: 5
tnt-radius: 5
fluid-radius: 5
actions:
stop-machine: true
cancel-explosion: true
notify-staff: true
rollback: true
worlds:
disabled: []
fluids:
custom: {}
The actual configuration can contain additional options depending on the installed version.```
Performance
FloodGuard is intended for multiplayer servers, including servers with significant player counts and automation.
The implementation should prefer:
Event-driven detection
Cached machine data
Bounded collections
Limited chunk access
Asynchronous processing where API-safe
Scheduled cleanup
Configurable scan limits
Bounded rollback storage
FloodGuard should avoid continuously scanning entire worlds or loading chunks solely for background detection.
Protection logic should also avoid unnecessary:
Synchronous heavy computation
Repeated block searches
Unbounded memory growth
Thread creation
Persistent storage growth
Compatibility
FloodGuard targets:
Minecraft Java Edition
Paper 1.21+
Java 21+
FloodGuard is a Paper plugin and does not provide native Bedrock server support.
Compatibility with third-party plugins depends on the APIs and events exposed by those plugins.
Installation
Install Paper 1.21+.
Install Java 21 or newer.
Place FloodGuard.jar in the server's plugins directory.
Start the server once.
Stop the server.
Edit plugins/FloodGuard/config.yml.
Start the server again.
It is recommended to test the configuration on a copy of the server before deploying aggressive protection or rollback settings to a production world.
Limitations
FloodGuard uses configurable detection and behavioral analysis. It does not guarantee perfect detection of every possible redstone machine, exploit, griefing design, or future Minecraft mechanic.
Detection accuracy depends on:
Minecraft version
Paper API behavior
Machine design
Plugin interactions
Configured thresholds
Available events and server data
New Minecraft mechanics may require updates to the detection modules.
FloodGuard should therefore be tested with existing farms, redstone systems, transport systems, and other automation before restrictive settings are enabled on a live server.
Privacy
FloodGuard should only retain information necessary for configured protection, logging, statistics, and rollback functionality.
Retention limits should be configurable.
The plugin should not transmit server data to external services unless the server administrator explicitly enables and configures such functionality.
Development
FloodGuard is intended to use a modular architecture so individual protection modules can be expanded without replacing the entire detection engine.
The implementation should prioritize:
Maintainability
Testability
Clear module boundaries
Defensive error handling
Bounded resource usage
Version-aware Minecraft integration
Clear configuration validation
Project Status
FloodGuard is intended to be:
Production-ready
Modular
Expandable
Fully configurable
Well documented
Error resistant
Optimized for multiplayer environments
Features may be expanded in future releases as Minecraft and Paper mechanics evolve.
License
FloodGuard is licensed under the GNU General Public License v3.0 (GPL-3.0).
You may use, modify, and redistribute FloodGuard in accordance with the GPL-3.0.
Full license text:
https://www.gnu.org/licenses/gpl-3.0.html****
评论 0
登录后参与评分
还没有评论,来抢沙发吧