Raytrace
Raytrace 是一个独立的、基于数据包层面的反透视(Anti-ESP)和反自由相机(Anti-freecam)插件,适用于 Paper、Folia
以及 Canvas 1.21.4+ / 26.x。它不会为玩家添加方块或命令,也不依赖其他库;它会重写已发送给每个客户端的数据包。
新用户? 请查阅 wiki -
了解网格的工作原理、配置、调优以及其他插件的 API 参考。
功能说明
- 地形遮蔽。 真实地表下方的方块在区块数据包中被替换为配置的假方块(石头、深板岩、下界岩、末地石)。玩家通过观察这些方块来“赚取”格子:一个小型的光线追踪模式会记录他们合法能看到的内容,并仅对这些格子发送真实的方块数据。自然地表层保持真实,因此海滩、海洋、冰层、树木和洞穴入口不会变成一片平坦的石头世界。在这个视觉表面缓冲区内的矿石、箱子、刷怪笼和其他贵重方块在被赚取之前仍然会被遮蔽。
- 实体隐藏。 当从眼睛到实体轮廓的所有采样光线都被墙壁或观察者仍视为虚假的地形阻挡时,生物、玩家、矿车(包括储物矿车、漏斗矿车、动力矿车和 TNT 矿车)、船、物品展示框、画作、盔甲架和掉落物将被隐藏。中心光线首先被检查,因此 plainly visible(明显可见)的实体只需消耗一条光线,而不是整个采样网格。每种类型的实体都有各自的开关(
hide-mobs、hide-players、hide-vehicles、hide-decorations、hide-items)。
- 无先创建后移除。 服务器将实体作为一个整体包(生成、元数据、装备、属性)引入客户端。Raytrace 会检查该包内部,因此如果实体在此刻被隐藏,则根本不会向客户端宣告该实体:没有生成数据包,之后也没有移除数据包。当它变得可见时,服务器自身的跟踪器会以当前状态将其引入。
- 效果和声音。 粒子、方块动画以及源自被隐藏位置的声音会被丢弃。重要声音(爆炸、末影龙、凋灵、末影水晶、传送门)始终允许播放,且爆炸保留其击退效果。隐藏的箱子和方块实体也会抑制其方块实体数据。
- 跨版本数据包访问。 通过反射机制访问服务器内部结构。如果查找失败,只会禁用该功能,而不会导致连接断开或插件崩溃。
兼容性
- Paper、Folia 或其分支 1.21.4+ / 26.x。
- Java 21+;Canvas 26.x 需要 Java 25。
- 不需要任何其他插件、库或协议库。内置的 jar 文件简洁且独立。
命令与权限
| 命令 |
权限 |
用途 |
/raytrace reload |
raytrace.admin |
重新加载 config.yml,清除缓存并重新扫描玩家。 |
raytrace.bypass 默认不授予管理员。拥有此权限的玩家可绕过遮蔽。
- 旁观者自动豁免。
hide-effects: true 控制粒子、动画和次要声音。
- 无论
hide-effects 设置如何,方块更新始终与地形掩码保持一致。
掩码构建原理
对于每一个加载的区块,Raytrace 根据配置的层带和实时高度图解析每列的天花板高度。低于该天花板的所有内容都编码为该 Y 层带的假方块。surface-buffer 使自然土壤顶部的几个方块保持真实,以实现平滑的海岸线和树线。第二个无缓冲的截止点用于矿石、箱子、刷怪笼和方块实体,因此使用精细网格(例如 grids.blocks.size: 2)时,即使周围泥土是真实的,地表下方四个方块的浅层矿石也会被隐藏。如果您想要更严格的地表处理,可以降低缓冲值。
当玩家观察某个格子时,光线行走会记录其穿过的网格格子。在遮挡允许范围内的格子会被标记为该玩家可见。这些格子的真实方块数据会通过正常的多方块变更数据包发送,从而确保客户端保持正确的碰撞检测,并在视线范围内不会看到假方块。
配置说明
worlds.<world>.surface-buffer 是截止线之上保持真实的自然土壤的方块数量。它不是半径。8 是一个良好的视觉默认值;较小的值隐藏更多,较大的值显示更多自然地表。缓冲区内的矿石和容器在被赚取格子前保持隐藏。负值将禁用地表感知。
grids.blocks.size 是地形单元格大小。10 计算成本低且粗糙;2 精确但更新频率高得多。当一个格子被赚取后完全变为真实,因此粗网格也会在玩家周围揭示更大的区域。当需要精确隐藏非常浅的矿石时,请使用 2。
grids.blocks.scan-ticks 是完整地形扫描之间的最小延迟。1 表示每个 tick。此配置中的所有时间单位均为 tick,而非毫秒。旧的 refresh-interval-millis 值会自动转换(50 ms = 1 tick)。
grids.entities.size 是实体轮廓采样网格:5 意味着最多 5x5 = 25 条细光线。中心光线会使可见实体短路(快速判断)。数值越小速度越快,但边缘越粗糙。
grids.entities.scan-ticks 是多久重新检查一次隐藏的活体实体。
grids.entities.scan-radius-blocks 应至少等于服务器的实体跟踪范围。
grids.entities.occlusion-blocks 是实体光线可以穿过的实心方块数量。1 表示隐藏在墙后;较高的值会使部分被遮挡的实体保持可见。
hide-effects 和 far-sound-distance 控制粒子、动画和次要声音。
性能:
- 反射结果(包括“字段不存在”的情况)会被缓存;在此之前,每个实体的每个移动数据包都会在 Netty 线程上引发带有堆栈跟踪的多个异常。
- 光线追踪直接从服务器区块读取方块数据(每步无需创建 Bukkit 方块对象)。
- 扫描设有时间预算(
max-scan-micros),并在停止处恢复执行;玩家静止时不会运行任何任务。
- 实体判定在没有任何实体移动时会被复用;实体列表在收集过程中即进行过滤;实体数据通过方法句柄读取。
- 已揭示的地形基于服务器方块状态构建,且与假方块匹配的部分不会被发送。单元格按区块列进行修剪,而非逐个扫描所有已获取的单元格。
- 未更改的区块部分逐字节复制,而非重新编码。
- 权限查找每 2 秒执行一次,而非每秒刻执行。
性能与带宽
- 带宽: 掩码为单值调色板,因此完全被掩蔽的区块部分通常比真实地形编码更小。区块仍会被发送;Raytrace 不会跳过它们。隐藏实体也会减少其生成、移动、装备和元数据包。在繁忙区域可预期有显著节省,但并非固定百分比,因为节省程度取决于地形与实体组合。
- 客户端/渲染负载: 隐藏实体不会被渲染,且统一的假区块比详细的地下区块更简单。客户端仍会接收并渲染这些区块本身。
- 服务器负载: 该插件增加了光线扫描和区块重写操作。地形扫描受
scan-ticks 限制和节流控制;实体检查则单独节流。在非常繁忙的服务器上,可提高 grids.blocks.scan-ticks 的值,降低 grids.entities.scan-ticks 的频率(数值更高),或使用稍小的实体网格。默认设置经过调优,偏向保守。
Raytrace
Raytrace is a self-contained packet-level anti-ESP and anti-freecam plugin for Paper, Folia
and Canvas 1.21.4+ / 26.x. It does not add blocks, commands for players, or dependencies; it
rewrites the packets already sent to each client.
New here? Check out the wiki -
how the grids work, configuration, tuning, and the API reference for other plugins.
What it does
- Terrain masking. Blocks below the real surface are replaced in chunk packets with
configured fake blocks (stone, deepslate, netherrack, end stone). A player earns cells by
looking at them: a small ray pattern traces what they can legitimately see and sends the real
blocks back for those cells only. The natural surface layer stays real so beaches, oceans,
ice, trees and cave entrances do not turn into a flat stone world. Ores, chests, spawners and
other valuable blocks inside that visual surface buffer are still masked until earned.
- Entity hiding. Mobs, players, minecarts (including chest, hopper, furnace and TNT
minecarts), boats, item frames, paintings, armor stands and dropped items are hidden when every
sampled ray from the eye to their silhouette is blocked by a wall or by terrain the viewer still
sees as fake. The centre ray is checked first, so a plainly visible entity costs one ray instead
of the full sample grid. Each kind has its own switch (
hide-mobs, hide-players,
hide-vehicles, hide-decorations, hide-items).
- No spawn-then-remove. The server introduces an entity to a client as one bundle (spawn,
metadata, equipment, attributes). Raytrace looks inside the bundle, so an entity that is hidden
at that moment is never announced to the client at all: no spawn packet, and no remove packet
later. When it becomes visible the server's own tracker introduces it with its current state.
- Effects and sounds. Particles, block animations and distant sounds whose origin is hidden
are dropped. Important sounds (explosions, ender dragon, wither, end crystal, portals) are
always allowed, and explosions keep their knockback. Hidden chests and other block entities
have their block-entity data suppressed as well.
- Cross-version packet access. Server internals are accessed reflectively. A missing lookup
disables only that feature instead of breaking the connection or the plugin.
Compatibility
- Paper, Folia or forks 1.21.4+ / 26.x.
- Java 21+; Canvas 26.x needs Java 25.
- No other plugin, library or protocol library is required. The built jar is plain and
self-contained.
Commands and permissions
| Command |
Permission |
Purpose |
/raytrace reload |
raytrace.admin |
Reload config.yml, clear caches and rescan players. |
raytrace.bypass is not granted to operators by default. Players with it bypass masking.
- Spectators are exempt automatically.
hide-effects: true controls particles, animations and minor sounds.
- Block updates are always kept consistent with the terrain mask, regardless of
hide-effects.
How the mask is built
For every loaded chunk, Raytrace resolves a per-column ceiling from the configured layer bands
and the live height map. Everything below that ceiling is encoded as the fake block for that Y
band. surface-buffer keeps the top few blocks of natural soil real for a smooth coastline and
tree line. A second, un-buffered cutoff is used for ores, chests, spawners and block entities, so
with a fine grid (for example grids.blocks.size: 2) a shallow ore four blocks below the
surface is still hidden even when the surrounding dirt is real. Lower the buffer if you want an
even stricter surface.
When a player looks at a cell, the ray walk records the grid cells it passes through. Cells
within the occlusion allowance are marked visible for that player. The real block data for
those cells is sent with a normal multi-block change, so the client keeps correct collision and
does not see fake blocks where it has line of sight.
Configuration notes
worlds.<world>.surface-buffer is the number of blocks of natural soil above the cutoff
that stay real. It is not a radius. 8 is a good visual default; smaller values hide more,
larger values show more natural surface. Ores and containers inside the buffer remain hidden
until their cell is earned. Negative disables surface awareness.
grids.blocks.size is the terrain cell size. 10 is cheap and coarse; 2 is precise and
much more update-heavy. A cell becomes fully real when earned, so a coarse grid also reveals
a larger area around the player. Use 2 when precise hiding of very shallow ores matters.
grids.blocks.scan-ticks is the minimum delay between full terrain scans. 1 means every
tick. All timing in this config is in ticks, not milliseconds. Old
refresh-interval-millis values are converted automatically (50 ms = 1 tick).
grids.entities.size is the entity silhouette sample grid: 5 means up to 5x5 = 25 thin
rays. The centre ray short-circuits visible entities. Smaller is faster but has coarser edges.
grids.entities.scan-ticks is how often hidden living entities are rechecked.
grids.entities.scan-radius-blocks should be at least the server's entity tracking range.
grids.entities.occlusion-blocks is the number of solid blocks an entity ray may pass
through. 1 hides behind one wall; higher values keep partially covered entities visible.
hide-effects and far-sound-distance control particles, animations and minor sounds.
Performance:
- Reflection results (including "no such field") are cached; before, every movement packet of
every entity cost several exceptions with stack traces on the Netty threads.
- Rays read block data straight from the server chunk (no Bukkit block object per step).
- Scans have a time budget (
max-scan-micros) and resume where they stopped; nothing runs while
the player stands still.
- Entity verdicts are reused while nothing moved; the entity list is filtered while it is
collected; entity data is read through method handles.
- Revealed terrain is built from server block states and blocks that already match the fake block
are not sent. Cells are pruned per chunk column instead of by scanning every earned cell.
- Unchanged chunk sections are copied byte for byte instead of re-encoded.
- The permission lookup runs every 2 seconds instead of every tick.
Performance and bandwidth
- Bandwidth: masks are single-value palettes, so fully masked chunk sections usually encode
smaller than real terrain. Chunks are still sent; Raytrace does not skip them. Hidden entities
also drop their spawn, movement, equipment and metadata packets. Expect a useful reduction
in busy areas, not a fixed percentage, because the saving depends on terrain and entity mix.
- Client/render load: hidden entities are not rendered, and uniform fake sections are
simpler than detailed underground sections. The client still receives and renders the chunks
themselves.
- Server load: the plugin adds ray scans and chunk rewriting. Terrain scans are budgeted and
throttled by
scan-ticks; entity checks are throttled separately. On a very busy server,
raise grids.blocks.scan-ticks, lower grids.entities.scan-ticks frequency (higher number),
or use a slightly smaller entity grid. The defaults are tuned to be conservative.
评论 0
登录后参与评分
还没有评论,来抢沙发吧