fix: fix config read

This commit is contained in:
Tsubasa6848
2024-02-23 21:43:39 +08:00
Unverified
parent 7a19e82fb5
commit a161b23d55
2 changed files with 13 additions and 1 deletions
+11 -1
View File
@@ -29,7 +29,17 @@ void ListenEvents() {
return;
}
}
item.lifeTime() = ConfigFile::mItemDespawnTicks;
if (Config->getValue<bool>({"ItemDespawn", "Enabled"}, true)) {
item.lifeTime() = ConfigFile::mItemDespawnTicks;
auto list = Config->getValue<std::vector<std::string>>({"ItemDespawn", "WhiteList"}, {});
auto type = item.item().getTypeName();
for (auto& key : list) {
if (isMatch(type, key)) {
return;
}
}
item.lifeTime() = ConfigFile::mItemDespawnTicks;
}
}
);
// MobTakeItemEvent