[main/FATAL] [net.minecraftforge.fml.ModLoader/LOADING]: Failed to complete lifecycle event CONSTRUCT, 17 errors found
[main/FATAL] [net.minecraft.server.Main/FATAL]: Failed to start the minecraft server
net.minecraftforge.fml.LoadingFailedException: Loading errors encountered: [
Create (create) has failed to load correctly
java.lang.NoClassDefFoundError: Could not initialize class com.simibubi.create.api.contraption.storage.item.MountedItemStorageType,
Bookshelf (bookshelf) has failed to load correctly
java.lang.ClassCastException: class net.minecraft.world.item.MobBucketItem cannot be cast to class net.darkhax.bookshelf.mixin.accessors.item.AccessorItem,
Pufferfish's Skills (puffish_skills) has failed to load correctly
java.lang.AssertionError: null,
ModernFix (modernfix) has failed to load correctly
java.lang.NullPointerException: Cannot invoke "org.embeddedt.modernfix.core.ModernFixMixinPlugin.isOptionEnabled(String)",
...
]
第一反应是模组冲突,但 Create、Bookshelf、Puffish、ModernFix 这些互相没什么关系的模组一起挂,而且报错都是 AssertionError、cannot be cast to xxxAccessor 这种,不像是版本不兼容,更像是这些模组的 Mixin 都没起作用。
先排除了几个常见问题
一是文件损坏。把服务器上的 mods/ 和官方 zip 逐个比了 CRC32,280 个文件全部一致。
python3 - <<'EOF'
import os
MODS = "/opt/app/mcsmanager/daemon/data/InstanceData/<实例ID>/mods"
def conv(name: bytes) -> bytes:
try:
return name.decode("gbk").encode("utf-8")
except Exception:
return bytes(c for c in name if 32 <= c < 127) or b"unnamed"
for root, dirs, files in os.walk(MODS):
for f in files:
old = os.path.join(os.fsencode(root), os.fsencode(f))
try:
old.decode("utf-8")
continue
except UnicodeDecodeError:
pass
new = os.path.join(os.fsencode(root), conv(os.fsencode(f)))
i = 2
while os.path.lexists(new):
stem, dot, ext = new.rpartition(b".")
new = os.path.join(os.fsencode(root), stem + b"-" + str(i).encode() + b"." + ext)
i += 1
os.rename(old, new)
EOF
这套包 zip 里的名字本身就是 GBK 和坏字节混着的,有些字符在打包的时候就被换成了 +,想还原成正确中文基本没戏,直接全转 ASCII 最省事。
改完再启动:
1
2
[main/INFO] [Puzzles Lib/]: Loading 313 mods:
[Server thread/INFO] [minecraft/DedicatedServer]: Done (17.176s)! For help, type "help"
Registering mixin config 也回到了 319 条,17 个模组全好了。
另外两个小问题
关掉正版验证之后,用 whitelist add 玩家名 加白名单,玩家还是进不来,日志是 You are not white-listed on this server!。因为原版 whitelist add 写的是正版 UUID,离线模式玩家登录用的是离线 UUID,名字一样也没用。离线 UUID 可以这样算: