ShieldSync
ShieldSync 是一款 Paper 插件,用于在不同延迟下保持盾牌举起的时机一致。
原版游戏中,盾牌有固定的 5 tick(250 毫秒)举起延迟,与玩家延迟无关。然而,当你的延迟较高时,盾牌的举起延迟会变成 5 tick 延迟加上你的实际延迟。本模组的作用是从这 5 tick 延迟中减去你的延迟值,从而使盾牌的延迟尽可能接近 250 毫秒,模拟低延迟下的盾牌效果。
注意:本模组仅在 1.21.11 版本上经过测试。使用此版本可获得最佳效果。如需其他服务器版本的定制,请在 Discord 上私信我 (pheological)。
功能说明
- 通过
keepAlive 数据包获取玩家的延迟。
- 将延迟转换为盾牌补偿的 tick 数。
- 由于游戏计时系统的工作原理,延迟必须换算为 tick 数。这意味着延迟只能以 50 毫秒的倍数进行减少。例如,如果玩家延迟为 80 毫秒,则只能减少 50 毫秒(1 tick),因此盾牌的感觉会类似于 30 毫秒延迟时的状态,而非 0 毫秒。如果延迟为 180 毫秒,则会减少 150 毫秒(3 tick),感觉就像只有 30 毫秒延迟一样。
- 如果延迟超过 250 毫秒,则移除全部 5 tick 延迟。
减去 150 ms 后,盾牌手感将与 30 ms 延迟的玩家相当。
安装方法
- 将
ShieldSync.jar 放入服务器的 plugins/ 文件夹中。
- 确保 PacketEvents 也位于该文件夹中。
- 启动或重启服务器。
命令
/shieldsync enable - 启用 ShieldSync。
/shieldsync disable - 禁用 ShieldSync。
/shieldsync status - 显示 ShieldSync 是否已启用。
/shieldsync debug - 切换所有玩家的调试输出。
/shieldsync debug <player> - 切换指定单个玩家的调试输出。
备注
- 本插件不使用 NMS 或反射技术。
- PacketEvents 作为外部依赖插件使用(未打包进阴影 jar)。
- 调试输出主要用于测试和调整,可能会产生大量日志。
致谢
- xSweetJapan 提供创意(Discord ID: sweetjapan)
- Axionize 负责延迟获取功能的实现,代码参考自 Knockback Sync。
ShieldSync
ShieldSync is a Paper plugin that keeps shield raise timing consistent across different pings.
In vanilla, shields have a 5 tick (250 ms) raise delay built in, regardless of ping. However, when you are higher ping, the delay that raises your shield will be the 5 tick delay + your ping. What this mod does is subtract your ping from the 5 tick delay, which reduces the shield delay closer to 250 ms regardless of ping, simulating how shielding would be on lower ping.
NOTE: This mod has only been tested on 1.21.11. Use this version for the best results. DM me on discord (pheological) if you want another version for your server.
What It Does
- Fetches a players ping using
keepAlive packets.
- Converts ping into shield compensation ticks.
- Due to how the ticking system works, the ping must be calculated into ticks. This means that the delay can only be reduced by multiples of 50 ms. For example, if a player is 80 ms, it can only reduce the delay by 50 ms (1 tick), so the shields will feel like what it would on 30 ms, not 0. If they are 180 ms, itll reduce it by 150 ms (3 ticks), and it'll feel like 30 ms.
- If ping is over 250 ms, it'll remove all 5 ticks.
150 ms is subtracted so shielding will feel synonymous to someone who's 30 ms.
Installation
- Put
ShieldSync jar in your server plugins/ folder.
- Ensure PacketEvents is also in the folder.
- Start/restart the server.
Commands
/shieldsync enable - Enable ShieldSync.
/shieldsync disable - Disable ShieldSync.
/shieldsync status - Show whether ShieldSync is enabled.
/shieldsync debug - Toggle debug output for all players.
/shieldsync debug <player> - Toggle debug output filtered to one player.
Notes
- This plugin does not use NMS or reflection.
- PacketEvents is used as an external dependency plugin (not shaded).
- Debug output is intended for testing/tuning and can be noisy.
Credits
- xSweetJapan for idea (sweetjapan on discord)
- Axionize for ping fetching implementation, I used the code from Knockback Sync.
评论 0
登录后参与评分
还没有评论,来抢沙发吧