隐藏坐标
一个用于 Fabric 的服务端模组,用于阻止向客户端发送真实坐标。基于并部分复制自 Spigot 版本的 CoordinateOffset,原作者为 Joshua Prince。 同时感谢 Patbox 提供了我从 Polymer 中使用的一小部分代码。
功能
- 玩家的坐标会被偏移,使得他们进入当前世界(加入、传送、通过传送门或重生)的位置在他们看来是 0, 0。
- 管理员可以使用
/coordoffset get查看自己的偏移量。 - 管理员可以使用
/coordoffset set [pos]更改自己的偏移量,使得指定的位置对他们来说位于 0,0 区块,或者使用/coordoffset set none来禁用偏移。 - 只有当玩家能够看到时,世界边界墙才会发送给玩家。这是为了防止客户端模组利用世界边界中心信息瞬间计算出偏移量。
为什么?
游戏内规则 reducedDebugInfo 会从调试屏幕中隐藏坐标,但这可以很容易地通过客户端模组绕过。此模组通过偏移所有发送给客户端的坐标来真正隐藏坐标。
希望在不依赖荣誉制度的情况下真正强制执行 reducedDebugInfo 规则的服务器需要像这样的模组。这是我的实现尝试 :)
免责声明
我是一个新晋的模组开发者。我需要它用于我正在开发的服务器,并将其作为一个学习机会制作而成。因此,该模组并不具备所有功能,代码相当杂乱,可能存在错误或崩溃问题。但我仍然认为它对其他人可能有用。请随意使用代码,欢迎提供改进建议! 已知问题:
- 与 CoordinateOffset 相比,这里缺少的主要功能是大量的配置选项。偏移量始终设置为你在 0,0 区块出生,并在死亡和维度切换时重置。
- 世界边界的扩大或缩小看起来非常奇怪。
- 有可能我遗漏了一些需要偏移的数据包,请告诉我!
Hide Coordinates
Server-side Fabric mod to prevent sending real coordinates to the client. Based on and partly copied from the Spigot version CoordinateOffset by Joshua Prince. Credit also goes to Patbox for a small sample of code I used from Polymer!
Features
- Players' coordinates are offset so that the location they entered the current world (join, teleport, portal or respawn) is shown to them as 0, 0.
- Admins can use
/coordoffset getto find their own offset. - Admins can use
/coordoffset set [pos]to change their own offset such that the specified pos is in the 0,0 chunk for them, or/coordoffset set noneto disable the offset. - Any worldborder wall is only sent to players who can see it. This is to prevent client-side mods from instantly figuring out the offset from world border center information.
Why?
The gamerule reducedDebugInfo hides coordinates from the debug screen, but this can be easily circumvented using a client-side mod. This mod hides the coordinates for real by offsetting all coordinates sent to the client.
A server that wants to actually enforce the gamerule reducedDebugInfo without an honour system will need a mod like this. This is my attempt at an implementation :)
Disclaimer
I'm a new modder. I needed this for a server I'm working on and made it as a learning opportunity. Therefore the mod doesn't have all the features, the code is quite messy, and there could be bugs or crashes. But I still figured it might be useful to some others. Feel free to use the code as you please, and improvement suggestions are welcome! Known issues:
- The main feature missing here from CoordinateOffset are the vast configuration options. Offsets are always set so you spawn in chunk 0,0 and this resets on death and dimension change.
- Worldborder growing or shrinking looks really weird.
- It's possible that I missed some packets that need the offset, let me know!
下载 Hide Coordinates
下载 Hide Coordinates
下载 Hide Coordinates
下载 Hide Coordinates
下载 Hide Coordinates
下载 Hide Coordinates
下载 Hide Coordinates
下载 Hide Coordinates
下载 Hide Coordinates
下载 Hide Coordinates
虽然花了不少时间,但我还在呢 :)
- 将 Minecraft 版本更新至 26.3
*修复了某些偏移量更改后区块未能正确加载的问题
关于这个资源的讨论、问题反馈与使用心得
还没有讨论,来发第一帖吧
你是这个资源的作者?登录后可认领此资源。
相似资源
模组
显示你正在注视的方块的信息。(适用于 Minecraft 1.16+ 的 Hwyla/Waila 分支)
模组
在游戏画面角落显示附近世界地形、玩家、生物和实体的地图。可创建路径点,帮助你找到标记过的位置。
模组
查看物品与配方
模组
使用 JavaScript 编辑配方、添加自定义物品、编写世界事件!
模组
AE2:一款流行的自动化与存储模组
模组
那是什么?一个 Waila/Hwyla 的分支。
评论 0
登录后参与评分
还没有评论,来抢沙发吧