当特定玩家因低 TPS 或高延迟(ping)导致服务器卡顿而死亡时,此插件会保留其物品栏。
例如,如果配置中设置的 TPS 阈值为 15,而服务器实际 TPS 因卡顿降至 12,此时若玩家死亡,其物品栏将被保留且不会掉落。
对于延迟(ping)的情况也是如此,但请注意,玩家可能会滥用此机制,例如使用程序人为提高自己的延迟以逃避战斗挂机(combat logging)。
因为该插件在满足条件时,通常会忽略其他插件的物品掉落处理并强制保留物品。它也会尽量忽略其他管理物品栏的自定义插件,只要满足条件就会保留物品。
本插件已在 CombatLogX 上经过测试,确实能在玩家登出时,因其延迟较高而保留玩家的物品栏。如果你担心这种情况,请禁用相关选项。
此外,在卡顿恢复后还有一个“宽限期”(可配置),这主要是为了防止玩家在卡顿结束后立即死亡,因为很多时候玩家都是在卡顿缓解后才死亡的。
推荐安装此插件,因为它能减少玩家的挫败感,尤其是当你只启用了 TPS 物品保护时,即使服务器偶尔卡顿也能提供保障。
注意/须知:
-
支持从 1.16 到最新版本,已测试版本包括 1.21.4、1.21.1、1.18.2、1.17、1.16。
-
与其他插件(如战斗类插件)相比,本插件通常非常轻量。
-
然而,服务器上死亡的玩家越多,占用的资源也越多。以下是关于资源占用的一些估算数据:
-
该插件在 1.16 以下版本也能运行,但不完善且可能存在 bug(不推荐)。
示例:Paper 1.20.4 服务器,配备 4GB RAM 和 4 核 CPU
性能与玩家数量对比
| 玩家数 |
CPU 占用率 (平均) |
内存占用 |
每分钟死亡事件数 |
备注 |
| 20 |
0.5-1% |
2-5MB |
5-10 |
几乎无感知 |
| 50 |
1-2% |
5-10MB |
15-30 |
影响极小 |
| 100 |
2-3% |
10-15MB |
30-60 |
在计时器中开始显现 |
| 200 |
4-5% |
20-25MB |
60-120 |
同上,但在后续版本中将进行优化 |
Config.yml
# InventoryProtect 配置
# TPS 阈值(1分钟平均值),低于此值时将保留物品栏
tps-threshold: 15.0
# Ping 阈值(毫秒),高于此值时将保留物品栏
ping-threshold: 400
# 恢复后的宽限期(秒)
# 在此时间之后,即使卡顿结束,物品栏仍会被保存
# 这是为了防止玩家在卡顿结束后受到惊吓而死,大多数玩家通常在卡顿缓解后死亡
grace-period: 7
# 启用保护类型
# 无论是基于 TPS 还是 Ping 保留物品,你都可以禁用其中一种或全部禁用
enable-tps-protection: true
enable-ping-protection: true
# 忽略其他插件
# 这将尝试忽略大多数管理物品栏的插件,并强制保留物品
# 然而,玩家可能会滥用这一点,在战斗中提高 ping 以逃脱并自行战斗挂机,如果是这样,请禁用 ignore-other-plugins-on-ping
ignore-other-plugins-on-tps: true
ignore-other-plugins-on-ping: true
# 如果你担心玩家可能滥用此功能来通过程序提高 ping 从而在战斗挂机中存活并保存物品,请禁用 ignore-other-plugins-on-ping。
# XP 保护设置
xp-protection:
enabled: true
prevent-duplication: true # 额外的安全检查
# 保持启用以防止可能被此插件滥用的经验值复制漏洞,如果你愿意,可以将其禁用。
请不要将此插件据为己有
请仅从此处下载此插件
如果你修改了插件,请不要删除我的名字
下一步目标:
优化以支持服务器中更多玩家
添加 /reload 功能
This plugin keep inventory during lag from either low tps or high ping for specific player when they die.
So for example if set tps is 15 in config and server tps was lagging and low on 12tps and a player dies then their inventory is kept and will not drop.
Same thing for the ping, however keep in mind players may abuse this like using programs to raise their ping to escape combat logging.
As this plugin will mostly IGNORE combat drop and will keep it regardless.
And will mostly try to ignore any custom inventory plugins and will keep regardless when conditions met.
this was tested on combatlogx and indeed it kept player's inventory when player's ping is high when they logged out
so disable this option if your worried about this.
There is also a grace period after lag "can be configured" this mostly to prevent players dying after lag ends as because players die after lag.
This plugin is recommended as it will reduce frustrations of players especially when your sever lags even if you enabled only TPS inventory protection.
Notes/ Keep in mind.
1 Works from 1.16 up to latest version tested 1.21.4, 1.21.1, 1.18.2, 1.17, 1.16
2 The plugin is generally lightweight than other plugins like combat plugins
3 However the more people in server die the more resources it will take, here are some estimations calculations of resources
4 the plugin works below 1.16 but not properly and maybe buggy (not recommended)
Paper 1.20.4 server with 4GB RAM and a 4-core CPU as an example
Performance vs Player Count
Players CPU Usage (Avg) Memory Usage Death Events/Min Notes
20 0.5-1% 2-5MB 5-10 Barely noticeable
50 1-2% 5-10MB 15-30 Minimal impact
100 2-3% 10-15MB 30-60 Starts showing in timings
200 4-5% 20-25MB 60-120 same thing as above, however will be noted in next versions for optimizations
Config.yml
# Configuration for InventoryProtect
# TPS threshold (1m average) below which inventory is kept
tps-threshold: 15.0
# Ping threshold (ms) above which inventory is kept
ping-threshold: 400
# Grace period in seconds after recovery
# time after that inventory will still be saved even after lag
# this to prevent players get jump scared after lag, most players usually die after lag
grace-period: 7
# Enable protection types
# whenever keep inventory based either tps or ping, you can disable one or both of them
enable-tps-protection: true
enable-ping-protection: true
# Ignore other plugins when
# this will try to ignore most plugins that manage inventory and will keep it regardless of what
# however players may abuse this and rise their ping during combat to escape and combat log them selfs if so disable ignore-other-plugins-on-ping
ignore-other-plugins-on-tps: true
ignore-other-plugins-on-ping: true
# disable ignore-other-plugins-on-ping if you worry that players may abuse this to survive combat logging and save their stuff, by using programs to raise their ping.
# XP Protection Settings
xp-protection:
enabled: true
prevent-duplication: true # Extra safety check
# keep this enabled to prevent xp duplication exploit that may be abused from this plugin, you can disable it if you want.
please don't reclaim this plugin as yours
please download this plugin only from here
If your modifying plugin dont remove my name from it
Next goals:
optimize for more players in server
add a /reload function for this
评论 0
登录后参与评分
还没有评论,来抢沙发吧