mirror of
https://github.com/Melledy/Nebula.git
synced 2026-09-19 17:19:58 +02:00
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:
@@ -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);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user