Lightning Grim Anticheat
本项目是 GrimAC 的一个分支,实现了显著的性能提升以及更优越的 Reach(击退距离)、方块放置和交互检测。如果您希望获得 Bug 修复或功能增强但无法赞助该工作,欢迎提交拉取请求。
GrimAC 是一款专为 Minecraft 1.21.5 设计的开源反作弊系统,支持 1.8-1.21.5 版本。它可在 1.8-1.21.5 服务器上运行,并完全支持通过 ViaVersion 连接的玩家(无论服务器原生版本如何,涵盖 1.7-1.21.x 客户端)。Geyser 玩家完全不受影响。
上游尚未包含的当前更改(包括但不限于)
- WallHit - 检测穿透墙壁进行的攻击
- EntityPierce - 检测穿透其他实体进行的攻击
- Bukkit Event Piston Optimizations - 活塞优化
- Optimized Hitbox/Collision Boxes - 优化的碰撞箱/碰撞区域
- Optimized Reach calculations - 优化的击退距离计算
- Checks for PacketOrder (patches lots of noslow, autoblocks, etc...) - 数据包顺序检查(修复了大量 noslow、自动阻挡等问题...)
- Checks for Inventory interactions (prevents using crafting slots as extra storage, moving while having inventory open, etc...) - 物品栏交互检查(防止将合成槽用作额外存储空间、打开物品栏时移动等...)
LineOfSightPlace - checks if blocks placements/container interactions were within line of sight of player. Stops placing blocks and opening chests through walls or in directions players aren't looking at.视线内放置 - 检测方块放置/容器交互是否在玩家视野范围内。阻止透过墙壁或在玩家未看向的方向放置方块及打开箱子。
通过终端/命令提示符编译
- git clone (或点击绿色 Code 按钮,下载 ZIP 文件,然后解压。)
- cd LightningGrim
- gradlew build
- 最终的 jar 文件位于 build/libs 中
API 信息
Grim 的 API 允许您将 Grim 集成到您自己的插件中。更多信息,请查看 API 的 GitHub 仓库 这里。
Grim 的统治地位
以下是使 Grim 区别于其他反作弊系统的核心特性:
运动模拟引擎
- 我们对玩家可能的运动进行了 1:1 的复制
- 这涵盖了从基本行走、游泳、击退、蛛网到气泡柱的所有内容
- 它还涵盖了骑乘生物,从船到猪再到炽足兽
- 基于对边缘情况的覆盖以确保准确性
- 1.13+ 客户端在 1.13+ 服务器上,1.12- 客户端在 1.13+ 服务器上,1.13+ 客户端在 1.12- 服务器上,以及 1.12- 客户端在 1.12- 服务器上均受支持,无论这些版本之间的大型技术变化如何。
- 碰撞的顺序取决于客户端版本且是正确的
- 考虑了版本之间微小的边界框差异,例如:
- 对于 1.7-1.8 玩家,单个玻璃板呈现为 + 形状,而对于 1.9+ 玩家则为 * 形状
- 1.13+ 客户端在 1.8 服务器上由于 ViaVersion 会看到 + 形的玻璃板碰撞箱
- 许多其他方块也具有这种极致的细节关注。
- 对于 1.12 或更低版本的玩家,不存在被水浸没的方块
- 客户端版本中不存在的方块使用 ViaVersion 的替换方块
- 无法翻译到早期版本的数据会被正确替换
- 所有原版碰撞箱均已实现
完全异步和多线程设计
- 所有运动检查和绝大多数监听器都在 netty 线程上运行
- 如果可能,反作弊系统可以扩展到数百名玩家,甚至更多
- 线程安全性经过仔细考虑
- 下一个核心特性使得这种设计成为可能
完整的世界复制
- 反作弊系统为每个玩家维护一个世界副本
- 副本是通过监听数据包、方块放置和方块变化创建的
- 在所有版本上,块数据使用调色板压缩至每个区块 16-64 kb
- 利用此缓存,反作弊系统可以安全地访问世界状态
- 针对每个玩家的缓存允许多线程设计
- 向玩家发送带有数据包的假方块是安全的,不会导致误报
- 为世界为每个玩家重新创建以实现延迟补偿
- 客户端侧的方块不会与基于数据包的方块产生问题。方块故障不会导致反作弊误报。
延迟补偿
- 世界更改会排队直到它们到达玩家
- 这意味着在玩家下方破坏方块不会导致反作弊误报
- 从飞行状态到移动速度的所有内容都将进行延迟补偿
物品栏补偿
- 跟踪玩家的物品栏以防止高延迟下的幽灵方块和其他错误
安全由设计保证,而非隐蔽性
- 所有系统设计为高度安全,且在数学上不可能被绕过
- 例如,预测引擎知道所有可能的运动,因此无法被绕过
Lightning Grim Anticheat
This project is a fork of GrimAC implementing substantial performance improvements and superiour reach, block placement, and interact checks. If you would like a bugfix or enhancement and cannot sponsor the work, pull requests are welcome.
GrimAC is an open source Minecraft anticheat designed for 1.21.5 and supports 1.8-1.21.5. It can run on 1.8-1.21.5 and fully supports players connecting through ViaVersion on 1.7-1.21.x no matter the native server version. Geyser players are fully exempt.
Current changes that upstream does not have (includes but is not limited to)
- WallHit - checks for hitting through walls
- EntityPierce - checks for hitting through other entities
- Bukkit Event Piston Optimizations
- Optimized Hitbox/Collision Boxes
- Optimized Reach calculations
- Checks for PacketOrder (patches lots of noslow, autoblocks, etc...)
- Checks for Inventory interactions (prevents using crafting slots as extra storage, moving while having inventory open, etc...)
LineOfSightPlace - checks if blocks placements/container interactions were within line of sight of player. Stops placing blocks and opening chests through walls or in directions players aren't looking at.
Compiling through terminal/command prompt
- git clone (or click the green code button, download ZIP, then unzip it.)
- cd LightningGrim
- gradlew build
- The final jar is located in build/libs
API Information
Grim's API allows you to integrate Grim into your own plugins. For more information, check out the API's GitHub repository here.
Grim supremacy
Here are the main cores that make Grim stand out against other anticheats
Movement Simulation Engine
- We have a 1:1 replication of the player's possible movements
- This covers everything from basic walking, swimming, knockback, cobwebs, to bubble columns
- It even covers riding entities from boats to pigs to striders
- Built upon covering edge cases to confirm accuracy
- 1.13+ clients on 1.13+ servers, 1.12- clients on 1.13+ servers, 1.13+ clients on 1.12- servers, and 1.12- clients on 1.12- servers are all supported regardless of the large technical changes between these versions.
- The order of collisions depends on the client version and is correct
- Accounts for minor bounding box differences between versions, for example:
- Single glass panes will be a + shape for 1.7-1.8 players and * for 1.9+ players
- 1.13+ clients on 1.8 servers see the + glass pane hitbox due to ViaVersion
- Many other blocks have this extreme attention to detail.
- Waterlogged blocks do not exist for 1.12 or below players
- Blocks that do not exist in the client's version use ViaVersion's replacement block
- Block data that cannot be translated to previous versions is replaced correctly
- All vanilla collision boxes have been implemented
Fully asynchronous and multithreaded design
- All movement checks and the overwhelming majority of listeners run on the netty thread
- The anticheat can scale to many hundreds of players, if not more
- Thread safety is carefully thought out
- The next core allows for this design
Full world replication
- The anticheat keeps a replica of the world for each player
- The replica is created by listening to chunk data packets, block places, and block changes
- On all versions, chunks are compressed to 16-64 kb per chunk using palettes
- Using this cache, the anticheat can safely access the world state
- Per player, the cache allows for multithreaded design
- Sending players fake blocks with packets is safe and does not lead to falses
- The world is recreated for each player to allow lag compensation
- Client sided blocks cause no issues with packet based blocks. Block glitching does not false the anticheat.
Latency compensation
- World changes are queued until they reach the player
- This means breaking blocks under a player does not false the anticheat
- Everything from flying status to movement speed will be latency compensated
Inventory compensation
- The player's inventory is tracked to prevent ghost blocks at high latency, and other errors
Secure by design, not obscurity
- All systems are designed to be highly secure and mathematically impossible to bypass
- For example, the prediction engine knows all possible movements and cannot be bypassed
下载 Lightning Grim Anticheat
需要联机服务器吗?
稳定流畅、一键部署,几分钟即可和朋友联机开服
最低仅需 8 元/月 即可畅快联机
下载 Lightning Grim Anticheat
需要联机服务器吗?
稳定流畅、一键部署,几分钟即可和朋友联机开服
最低仅需 8 元/月 即可畅快联机
下载 Lightning Grim Anticheat
需要联机服务器吗?
稳定流畅、一键部署,几分钟即可和朋友联机开服
最低仅需 8 元/月 即可畅快联机
下载 Lightning Grim Anticheat
需要联机服务器吗?
稳定流畅、一键部署,几分钟即可和朋友联机开服
最低仅需 8 元/月 即可畅快联机
下载 Lightning Grim Anticheat
需要联机服务器吗?
稳定流畅、一键部署,几分钟即可和朋友联机开服
最低仅需 8 元/月 即可畅快联机
下载 Lightning Grim Anticheat
需要联机服务器吗?
稳定流畅、一键部署,几分钟即可和朋友联机开服
最低仅需 8 元/月 即可畅快联机
下载 Lightning Grim Anticheat
需要联机服务器吗?
稳定流畅、一键部署,几分钟即可和朋友联机开服
最低仅需 8 元/月 即可畅快联机
下载 Lightning Grim Anticheat
需要联机服务器吗?
稳定流畅、一键部署,几分钟即可和朋友联机开服
最低仅需 8 元/月 即可畅快联机
下载 Lightning Grim Anticheat
需要联机服务器吗?
稳定流畅、一键部署,几分钟即可和朋友联机开服
最低仅需 8 元/月 即可畅快联机
下载 Lightning Grim Anticheat
需要联机服务器吗?
稳定流畅、一键部署,几分钟即可和朋友联机开服
最低仅需 8 元/月 即可畅快联机
本构建的变更(自上次推送以来)
杂项
- 若方块实际发生更改,则执行方块更新 (#2932)
-
若方块实际发生更改,则执行方块更新
-
通过 ID 而非对象进行检查
-
检查方块的碰撞 - by thelema1337 (
f929c20)
- 在 Modrinth 工作流中表明对 Bukkit 的 26.3 支持 - by SamB440 (
ec98bec) - 在 < 1.21.2 服务器版本上使用玩家输入。(#2931) - by thelema1337 (
3bc8959) - 使用自包含的 Floodgate API 编译工件 - by Axionize WS2 (
60ccd5d) - 合并远程跟踪分支 'origin/2.0' 到 fix/datastore-lease-reconnect-2.0 - by Axionize WS2 (
4ce5ef9) - 合并来自 GrimAnticheat/fix/datastore-lease-reconnect-2.0 的拉取请求 #2953
恢复数据库日志记录而不分割玩家会话 - by Axionize (8027cff)
- 修复蜂蜜滑行读取上一个刻的 x/z 坐标 (#2948) - by Aidan Valero (
cff07d9) - 更新 PacketEvents 以修复 Adventure 转换器打包问题 - by Axionize WS2 (
bcdec20) - 将 Y 轴传送阈值限制为 1.7 (#2943)
-
将 Y 轴传送阈值限制为 1.7
-
传送中的地面状态 - by Cyramek (
e6eda79)
- 修复 Fabric Adventure 5 消息使用 PacketEvents 序列化器的问题 (#52)
使用修复后的 PacketEvents Adventure 4/5 序列化器,同时保留现有的快速聊天绕过功能。解码 PE 组件数据用于原生 Fabric 发送,并启用 Fabric 26.3。
感谢 tumo07 在 GrimAnticheat/Grim#2925 中对 Adventure 5 的初始调查及 Fabric 兼容性工作:
已验证 Fabric 26.2/26.3、两种发送路径、Via、Paper 以及旧版 Fabric。1.20.1 的检查需要兼容的外部 Cloud 依赖;其现有的捆绑 Cloud 打包问题仍单独存在。
更新仅编译使用的 Floodgate 依赖,并声明 Gson/Guava 编译依赖以恢复可重现构建。本地 Fabric 和 Bukkit 构建已通过;审查仓库的 CI 运行在任务开始前失败。
Co-authored-by: tumo07 63636528+tumo07@users.noreply.github.com - by Axionize (2edeb21)
- 将 Fabric Adventure 5 和 26.3 支持应用到公共 2.0 版本 - by Axionize WS2 (
8b39f29) - 通过 Minecraft 26.3 发布 Fabric 构建 - by Axionize WS2 (
8897f37) - 在服务元数据修复后刷新 PacketEvents 快照 - by Axionize WS2 (
b23b7f3) - 更新 PacketEvents 服务提供者兼容性桥接 - by Axionize WS2 (
d490dc9) - 修复 Fabric 序列化器和 Bukkit Adventure 提供程序着色 - by Axionize WS2 (
5e15e98) - 从客户端方块操作数据包追踪活塞 (#2958)
- 从客户端方块操作数据包追踪活塞
将客户端侧数据包活塞建模移植到 Grim 2.0,包括客户端世界结构解析和补偿性活塞移动追踪。
-
移除遗留的 Fabric 活塞追踪路径
-
根据当前 PacketEvents API 更新活塞模型 - by Axionize (
39d7eb1)
- 避免在 ix 运行时重写 Gradle 缓存 (#2959) - by Axionize (
f31ba92) - 将开发版本提升至 2.3.75 - by Axionize WS2 (
419a3d7) - 修复跨 Minecraft 版本的旋转包裹问题
规范化服务器旋转角度,并使用每个客户端版本验证传送旋转角度。 - by Cyramek (8baa16f)
- 修复 SneakingEstimator 双重应用空气阻力 (#2960)
Co-authored-by: 6a0 87043474+6a0@users.noreply.github.com - by Aidan Valero (3ce23a)
- 修复空闲刻数下蹲姿态过时的问题 (#2957) - by Aidan Valero (
1ae2d5f) - 使用官方的 Fabric Loom 配置缓存修复方案 - by Axionize (
6c8c5c4) - 依赖种子化的 Gradle 缓存用于 Loom (#2970) - by Axionize (
3c20eb7) - 泥浆具有完整的下落流体面 - by Aidan Valero (
4df0187) - 在 getFlow 中使用自身的流体高度 - by Aidan Valero (
76dfbab) - 验证无密钥的 Forks (#2971) - by Axionize (
a746445) - 使用 IX 进行默认分支运行 - by Axionize (
26fddfd) - 要求 Check 类上必须使用 @CheckData - by ManInMyVan (
d8b8ae4) - 验证玩家输入 - by cyramek (
4907ea8) - 在处理前验证移动数据包 - by cyramek (
1299a2a) - 在点击合成结果后重新发送物品栏 (#2986) - by Aidan Valero (
c12f107) - 添加可配置的 FastBreak 阈值 (#2992)
新增 FastBreak.break-threshold 和 FastBreak.delay-threshold,以便服务器调整在检查标记之前允许多少挖掘优势。 两者默认值均为 1000,即之前的硬编码值。平衡钳制现在使用配置的阈值,因此高于 1000 的值仍可被标记。
关闭 #2919 - by Almost (9940a5d)
- 修复导致模拟误报的 ClientBoundRotation 数据包 (#2990) - by Gogolinolett (
41f6f6e) - 跳过骑乘生物的隐藏反弹容限 (#2974) - by Aidan Valero (
d3fbf34) - 首次攀爬刻时缓慢下落 (#2975) - by Aidan Valero (
9ae250b) - 平局时跳过三角投票 (#2988) - by Aidan Valero (
2d9da74) - 将通过 Via 提供给旧客户端的方块添加到同步方块标签中 (#3001)
- 将通过 Via 提供给旧客户端的方块添加到同步方块标签中
Via 将服务器中可开采/镐子的铜箱子转换为 1.21.8 及更早客户端的箱子,因此在客户端层面,箱子位于该标签内。FastBreak 检查开始挖掘时客户端看到的方块,但标签中仅有服务器的铜箱子,因此它期望的是手部速度,且所有用镐子挖掘的箱子都被标记了。当客户端版本早于服务器时,方块标签条目也会获得 Via 将其转换成的方块。如果 pollData 尚未查找,getViaTranslatedClientBlockID 会自行查找 Via 连接,配置标签可能先进入
- 返回标签重映射器的两个方块
客户端区块现在从基础重映射器中移除,而不是使用第二个,而服务器区块保留在原位,因为 PointThreeEstimator 和 Collisions 检查可攀爬性时使用的是世界中的区块。版本检查使用 isNewerThanOrEquals,pollData 通过 getViaUserConnection 处理 - by Aidan Valero (d8d7b37)
- 清理代码 - by ManInMyVan (
01af39b) - 为旧版客户端使用末地石砖和受侵染方块的老硬度值 (#3005)
在 1.14.4 及之前,末地石砖以及 1.14 添加的楼梯/台阶/墙块的硬度值为 0.8;1.15 将其改为 3,而 grim 对所有客户端都使用 3,导致 1.14 及更早版本对每个方块都标记 FastBreak(快速破坏)。受侵染方块在 1.13 - 1.16.5 中瞬间破碎,在此之前硬度为 0.75。两者都归入活塞覆盖逻辑 - by Aidan Valero (85d931f)
- 按照 config.yml 的拼写读取 cancelvl (#3010)
BlockPlaceCheck 原本读取 getConfigName() + ".cancelVL",但 config.yml 中是 cancelvl,且 configuralize 区分大小写,因此所有放置检查都运行其默认值。现在优先读取 cancelvl,并仍接受以该方式编写的配置中的 cancelVL - by Aidan Valero (1bf0c62)
- 检查玩家当前位置的回退方块 (#3004) - by Aidan Valero (
dc753da) - 在下挖时计算 FastBreak 中的落地刻 (#2987)
-
在下挖时计算 FastBreak 中的落地刻
-
将 FastBreak 移回 post-via 数据包监听器
ManInMyVan 表示可以移回去。post-via 飞行数据包在 CheckManagerListener 应用 onGround 之后到达,因此下挖时的落地再次被计入,且末尾所需的额外伤害判定不再需要,因此也去除了 - by Aidan Valero (e457d55)
- 减少冗余向量对象分配 - by ManInMyVan (
2f785fd) - 修复 Reach 比较平方距离的问题 (#3017) - by Aidan Valero (
a10bbf8) - 修复 SneakingEstimator 双重应用滑翔阻力 (#3016) - by Aidan Valero (
f9b801a) - 在过滤移动候选项时使用实体步高
修复鹦鹉螺壳步进问题 - by cyramek (cee1f0b)
-
匹配原版移动和射线追踪计算
-
在输入预测和 fastmath 检测中保留 1.9 之前的偏航角舍入
-
针对方块射线追踪使用特定版本的朝向向量
-
为桶和睡莲保留 1.20.4 之前的物品使用射线方向
-
旋转前缩放双精度输入向量
-
根据客户端版本匹配鞘翅升力精度和计算 - by cyramek (
73eee60) -
基于水的存在添加混凝土粉末硬化逻辑
修复: - by cyramek (7d6eca0)
- 根据客户端版本调整船只插值步骤 - by cyramek (
c3d02d7) - 测试 0.03 时应用移动阈值 (#2944) - by Cyramek (
60784bf) - 根据客户端版本调整矿车插值步骤 - by cyramek (
6055c50) - 切换载具时使用正确的摩擦力 - by cyramek (
cdf0a28) - 角落楼梯对于下落流体获取错误的完整面 (#3015) - by Aidan Valero (
81ef894) - 在 1.21+ 中使用使用物品自身的旋转放置睡莲和桶 (#3018)
-
在 1.21+ 中使用使用物品自身的旋转放置睡莲和桶
-
将使用物品的俯仰角限制在 -90..90 之间 - by Aidan Valero (
dc8a48e)
- 修复 #3021 - by SamB440 (
8aa1478) - 合并上游 Grim 2.0 到 LightningGrim
同步至 8aa1478ae,包括载具输入验证和嵌套载具碰撞修复。将 Lightning 的距离检查适配至上游射线追踪,使用数据包活塞模型,并保留 GitHub 托管发布。增加载具碰撞回归测试覆盖。 - by Axionize WS2 (71f4e44)
🐛 修复
- 修复 canGlide 拒绝非鞘翅滑翔者 (#2915)
packetevents 现在通过组件 ID 解码可装备槽位,因此用于补偿旧序数解码的偏移量导致所有非鞘翅滑翔者检查失败。 - by Rishabh Venu (cfc080b)
- 修复 ViaBackwards 模拟 tick 结束时 Reach 和 Hitboxes 误报
isUpdate 曾将 CLIENT_TICK_END 视为每个玩家的 tick 标记。ViaBackwards 为早于 1.21.2 的客户端模拟该数据包,并且自 5.12.0 起,在其攻击数据包与移动数据包之间发送,导致 Reach 在新朝向到达之前评估了攻击。 - by Rishabh Venu (f5bbe9c)
- 修复硫磺尖刺方块的放置 - by cyramek (
c09d840) - 修复粉雪自 1.21.5 以来导致的误报 - by cyramek (
3a9cdf1) - 防止压缩后 1.8.8 PacketEvents 踢出 - by Axionize WS2 (
2016370) - 防止压缩后 1.8.8 PacketEvents 踢出 - by Axionize (
68bc457) - 修复乘骑自己载具的潜影盒导致的 boatfly 问题 (#2942) - by GuFFy12 (
43850df) - 当缺少或不兼容 Cloud command lib 时不崩溃启动 (#2761) (#2882) - by aquip (
8d1811d) - 恢复所有权租约过期后的日志记录 - by Axionize WS2 (
8a2d8ba) - 在恢复过程中保持会话和元数据持久化 - by Axionize WS2 (
27689c4) - 确保玩家会话路径不包含监视器锁 - by Axionize WS2 (
4bb6104) - 在恢复重试期间保留待处理的断开连接 - by Axionize WS2 (
0f56c96) - 在正常续期之前重试不完整的会话恢复 - by Axionize WS2 (
032f513) - 检测带 Location 参数的 teleportAsync (#2952) - by Axionize (
4e4ba1d) - 使 git-cliff 变更日志离线 (#2955) - by Axionize (
be58cbe) - 接受带引号的历史玩家名称 - by Axionize WS2 (
b08e9b1) - 修复 BadPacketsR 在 1.21.2+ 服务器上标记乘客 (#2921)
对于处于载具中的玩家,检查仅统计 STEER_VEHICLE 和 VEHICLE_MOVE。1.21.2 用玩家输入数据包替换了转向数据包,该数据包仅在输入改变时发送,因此不控制载具的乘客不会发送任何被检查统计的内容,导致每两秒标记一次。旋转是乘客每个 tick 发送的内容,因此在这些服务器上会被统计。 - by Rishabh Venu (3dc139b)
-
修复 NoSlow 跨物品使用保留失败 tick 的问题 (#2917)
-
flaggedLastTick仅在玩家受到物品减速效果时才会更新,因此一个异常 tick 会在物品效果结束后仍被记录,导致下一次使用物品时在其第一个异常 tick 处就被标记。 - by Rishabh Venu (eb4c657) -
修复多种投射物的碰撞箱 - by ManInMyVan (
dc9f37c) -
修复 #2998、#2996 - by ManInMyVan (
408031f) -
修复 26.3 版本中过期的回退机制(#2966)
我们看看情况如何 - by Cyramek (0ea9b5a)
- 修复 viabackwards 向量重写器
修复: - by cyramek (0f03811)
🚀 新功能
- 区块去重优化(#2914) - by echo (
52787c6)
关于这个资源的讨论、问题反馈与使用心得
还没有讨论,来发第一帖吧
你是这个资源的作者?登录后可认领此资源。
相似资源
模组
缓冲的原始输入和线程化的事件轮询
模组
一个用于收集生物掉落物的多区块模组。
模组
显示你正在注视的方块的信息。(适用于 Minecraft 1.16+ 的 Hwyla/Waila 分支)
模组
原版世界生成优化模组
模组
在游戏画面角落显示附近世界地形、玩家、生物和实体的地图。可创建路径点,帮助你找到标记过的位置。
模组
查看物品与配方
评论 0
登录后参与评分
还没有评论,来抢沙发吧