? 依赖项
本模组不依赖任何其他模组。
? 简介
这是一个修复实体数据因极端伤害(或更广义地说,“假死”)而被 NaN 污染的模组。
当实体受到无限大或 NaN 伤害时,其部分属性(如吸收值和生命值)在计算后会变为 NaN。
通常情况下,受到无限大伤害的实体应立即死亡,且被 NaN 污染的数据会被清理或重置。
然而,一些具有特殊机制的实体能够承受无限大伤害或继续执行其他操作——例如来自 Target Dummy 的 dummy 实体。以下描述主要基于该实体的特性。

? 什么是 NaN
NaN 是 "Not a Number"(非数字)的缩写——一个无意义且无法参与计算的值。在编程中,NaN 与任何数值的比较结果均为 False,且涉及 NaN 的任何运算都会产生 NaN,这使得 NaN 具有传染性。
? 发生原因及修复方式
在计算伤害效果时,如果伤害值为无限大,程序会计算 absorption before damage - absorption after damage(吸收前伤害 - 吸收后伤害)以得出吸收值减少量,同时应用伤害吸收。然而,无限大与任何有限值运算的结果始终为无限大,因此被减数和减数都是无限大,而 infinity - infinity(无限大 - 无限大)的结果为 NaN——导致吸收属性变为 NaN。
如上所述,NaN 具有传染性:任何后续使用 NaN 计算出的伤害也会变成 NaN,这就是为什么你会看到 dummy 显示造成的伤害为 NaN。
本模组并未尝试清理实体数据,而是从数学根源上解决问题——数学上,damage before absorption - damage after absorption(吸收前伤害 - 吸收后伤害)等价于 min(damage before absorption, current absorption)(取吸收前伤害与当前吸收值中的较小者)。后者消除了不必要的减法运算,因此不再出现 infinity - infinity(无限大 - 无限大)的情况,从而消除了 NaN 产生的可能性。

? 常见问题
问:这个模组需要安装在客户端吗? 答:如果是单人游戏则需要;否则仅安装在服务端即可。
问:这个模组只适用于 Target Dummy 吗? 答:不是。任何能受到伤害且具有生命值的实体都包含在此修复范围内。
问:支持其他 Minecraft 版本吗? 答:其他主流版本将随时间逐步更新,主要侧重于 Minecraft 1.20.1。欢迎第三方移植。
问:NeoForge / Quilt 版本? 答:NeoForge 将单独提供支持;Quilt 不会单独提供支持,但欢迎第三方移植。
ℹ️ 杂项
本模组还包含对无限护甲值和无限护甲韧性的兼容性处理,其行为可通过名为 qed.json5 的配置文件进行配置。
模组缩写 "QED" 代表 "Quite Enough Damage"(足够多的伤害),但也可能代表 "Quod Erat Demonstrandum"(意为“证明完毕”或“证毕”)。
? Dependencies
This mod does not depend on any other mod.
? Introduction
This is a mod that fixes entity data being contaminated with NaN due to extreme damage — or, more broadly speaking, "fake death".
When an entity takes infinite or NaN damage, some of its attributes, such as absorption and health, become NaN after calculation.
Normally, an entity hit by infinite damage is supposed to die outright, and the NaN-contaminated data would be cleaned up or reset.
However, some entities with special mechanics survive infinite damage or keep performing other operations — for example, the dummy entity from Target Dummy. The rest of this description is based on the characteristics of that entity.

? What is NaN
NaN stands for "Not a Number" — a value that has no meaning and cannot participate in calculations. In programming, any comparison between NaN and any number is False, and any operation involving NaN results in NaN, which makes NaN contagious.
? How it occurs and how it's fixed
When calculating damage effects, if the damage value is infinite, the program computes damage before absorption - damage after absorption to derive the absorption reduction while applying damage absorption. However, infinity operated on with any finite value always yields infinity, so both the minuend and the subtrahend are infinity, and infinity - infinity results in NaN — the absorption attribute thus becomes NaN.
As mentioned above, NaN is contagious: any subsequent damage calculated with NaN also becomes NaN, which is why you'll see the dummy displaying dealt damage as NaN.
This mod does not try to clean up entities; instead, it fixes the mathematical root cause — mathematically, damage before absorption - damage after absorption is equivalent to min(damage before absorption, current absorption). The latter removes the unnecessary subtraction, so infinity - infinity no longer occurs, eliminating the possibility of NaN.

? FAQ
Q: Does this mod need to be installed on the client? A: Yes if you're playing singleplayer; otherwise, installing it on the server only is enough.
Q: Does this mod only apply to Target Dummy? A: No. Any entity that can take damage and has health is covered by the fix.
Q: Other Minecraft versions? A: Other mainstream versions will be updated over time, with Minecraft 1.20.1 as the main focus. Third-party ports are welcome.
Q: NeoForge / Quilt versions? A: NeoForge will be supported separately; Quilt will not be supported separately, but third-party ports are welcome.
ℹ️ Misc
The mod also includes compatibility handling for infinite armor values and infinite armor toughness, whose behavior can be configured via the config file named qed.json5.
The mod abbreviation "QED" stands for "Quite Enough Damage", but can also stand for "Quod Erat Demonstrandum", meaning "that which was to be demonstrated".
下载 QED
下载 QED
下载 QED
下载 QED
下载 QED
下载 QED
下载 QED
下载 QED
下载 QED
下载 QED
暂无更新日志
关于这个资源的讨论、问题反馈与使用心得
还没有讨论,来发第一帖吧
你是这个资源的作者?登录后可认领此资源。
相似资源
模组
缓冲的原始输入和线程化的事件轮询
模组
显示你正在注视的方块的信息。(适用于 Minecraft 1.16+ 的 Hwyla/Waila 分支)
模组
查看物品与配方
模组
原版世界生成优化模组
模组
使用 JavaScript 编辑配方、添加自定义物品、编写世界事件!
模组
在游戏画面角落显示附近世界地形、玩家、生物和实体的地图。可创建路径点,帮助你找到标记过的位置。
评论 0
登录后参与评分
还没有评论,来抢沙发吧