Universal Tweaks替代attributefix属性修复后经常在击杀怪物尤其是大范围杀伤怪物时闪退,例如使用星源拔刀剑MOD的银翼大范围吸怪必跳出,报错信息为:
java.util.ConcurrentModificationException
at java.util.ArrayList$Itr.checkForComodification(Unknown Source)
毫无头绪地排查摸索了好几天后,赫然发现这段错误报告下面的(MixinBooter) Mixins in Stacktrace中是大段的mod.acgaming.universaltweaks.bugfixes.各种变量。包括但不限于bugfixes.entities.maxhealth.mixin.UTMaxHealthMixin之类,遂怀疑是Universal Tweaks通用修改的问题。而且发现其替代的OverpoweredMending模组与热力膨胀等模组的前置CoFH核心冲突。
关掉经验修补模块方法:
在config文件夹下的UniversalTweaks.cfg和Universal Tweaks - Tweaks.cfg文件中各有一段“B:"[1] Mending Toggle"=true”,将末尾的“true”改为“false”即可。
至于属性修复的问题
研究后发现attributefix与Universal Tweaks在配置文件上的不同之处,attributefix的配置文件attributefix.cfg中
armor {
# The maximum amount for the armor attribute. [range: -3.4028235E38 ~ 3.4028235E38, default: 65536.0]
S:max=65536.0
# The minimum amount for the armor attribute. [range: -3.4028235E38 ~ 3.4028235E38, default: 0.0]
S:min=0.0
可以看到护甲值最高为65536,最低为0
armortoughness {
# The maximum amount for the armorToughness attribute. [range: -3.4028235E38 ~ 3.4028235E38, default: 65536.0]
S:max=65536.0
# The minimum amount for the armorToughness attribute. [range: -3.4028235E38 ~ 3.4028235E38, default: 0.0]
S:min=0.0
盔甲韧性也是最高为65536,最低为0
后面attackdamage和attackspeed还有flyingspeed以及followrange、knockbackresistance、movementspeed都类似,luck稍有不同,最低为1024而不是0,但maxhealth倒是可以为负,最低可达-3.4028235E38。
而Universal Tweaks里关于属性修复的内容,在在config文件夹下的UniversalTweaks.cfg和Universal Tweaks - Tweaks.cfg文件中各有一段:
attributes {
# Sets custom ranges for entity attributes
B:"[01] Attributes Toggle"=true
D:"[02] Max Health Min"=-65536.0
D:"[03] Max Health Max"=65536.0
D:"[04] Follow Range Min"=-65536.0
D:"[05] Follow Range Max"=65536.0
D:"[06] Knockback Resistance Min"=-65536.0
D:"[07] Knockback Resistance Max"=65536.0
D:"[08] Movement Speed Min"=-65536.0
D:"[09] Movement Speed Max"=65536.0
D:"[10] Flying Speed Min"=-65536.0
D:"[11] Flying Speed Max"=65536.0
D:"[12] Attack Damage Min"=-65536.0
D:"[13] Attack Damage Max"=65536.0
D:"[14] Attack Speed Min"=-65536.0
D:"[15] Attack Speed Max"=65536.0
D:"[16] Armor Min"=-65536.0
D:"[17] Armor Max"=65536.0
D:"[18] Armor Toughness Min"=-65536.0
D:"[19] Armor Toughness Max"=65536.0
D:"[20] Luck Min"=-65536.0
D:"[21] Luck Max"=65536.0
}
可以看到从护甲值、盔甲韧性到幸运值和移动速度,全都可以为负,猜测可能会造成BUG,例如有人就反映速度可以为负,结果一些僵尸中了缓慢100,反而跑得比田径选手还快:
因此果断将所有最小值改为0.0:
attributes {
# Sets custom ranges for entity attributes
B:"[01] Attributes Toggle"=true
D:"[02] Max Health Min"=1.0
D:"[03] Max Health Max"=65536.0
D:"[04] Follow Range Min"=0.0
D:"[05] Follow Range Max"=65536.0
D:"[06] Knockback Resistance Min"=0.0
D:"[07] Knockback Resistance Max"=65536.0
D:"[08] Movement Speed Min"=0.0
D:"[09] Movement Speed Max"=65536.0
D:"[10] Flying Speed Min"=0.0
D:"[11] Flying Speed Max"=65536.0
D:"[12] Attack Damage Min"=0.0
D:"[13] Attack Damage Max"=65536.0
D:"[14] Attack Speed Min"=0.0
D:"[15] Attack Speed Max"=65536.0
D:"[16] Armor Min"=0.0
D:"[17] Armor Max"=65536.0
D:"[18] Armor Toughness Min"=0.0
D:"[19] Armor Toughness Max"=65536.0
D:"[20] Luck Min"=-1024.0
D:"[21] Luck Max"=65536.0
}
修改后再没有
Description: Ticking entity
java.util.ConcurrentModificationException
at java.util.ArrayList$Itr.checkForComodification(Unknown Source)
导致的闪退跳出现象了,可以放心使用拔刀剑了。