版本 1.0.0-rc2:去掉反射,清单不再声明能力

This commit is contained in:
ZHU MINCHAO committed 2026-11-04 23:11:11 +08:00
1 parent 3a97e3701b
commit e8532f9e1b
5 files changed
+8 -13

No files matched your search

+1 -10
View File
@@ -515,18 +515,9 @@ namespace Decentralized
{
try
{
var directories = (System.Collections.IDictionary)typeof(DirectoryMaster).GetField("singletonInstance", System.Reflection.BindingFlags.NonPublic | System.Reflection.BindingFlags.Static)?.GetValue(null);
var list = directories?[typeof(GameItem)] as System.Collections.IList;
if (list == null) { Log.Warn("[Rig] 找不到原版物品目录,电子元件不能升级矿架"); return; }
foreach (var id in new[] { "common_electronic", "rare_electronic" })
{
Func<GameItem> vanilla = null;
foreach (var d in list)
{
if (d is ModItemDirectory) continue;
var fd = d.GetType().GetProperty("factoryDictionary")?.GetValue(d) as Dictionary<string, Func<GameItem>>;
if (fd != null && fd.TryGetValue(id, out var f)) { vanilla = f; break; }
}
var vanilla = DirectoryMaster.GetFactory<GameItem>(id);
if (vanilla == null) { Log.Warn($"[Rig] 找不到原版 {id}"); continue; }
var make = vanilla;
dir.Set(id, () =>