Rework and optimize inventory

`GameItem`s and `GameResource`s are now deprecated, they are stored as regular `ItemParamMap`s in the `Inventory` class instead. This is to reduce database load when loading a player.
This commit is contained in:
Melledy
2026-04-15 03:01:31 -07:00
parent fa91ab0555
commit 9ba38d5a5e
7 changed files with 129 additions and 74 deletions
@@ -212,6 +212,14 @@ public final class DatabaseManager {
update(obj, uid, field2, value2);
}
public void updateUnset(Object obj, int uid, String field) {
var opt = new UpdateOptions().upsert(false);
getDatastore().find(obj.getClass())
.filter(Filters.eq("_id", uid))
.update(opt, UpdateOperators.unset(field));
}
public void updateNested(Object obj, int uid, String filter, int filterId, String field, Object item) {
var opt = new UpdateOptions().upsert(false);