Signed-off-by: yoyosource <yoyosource@nidido.de>
Dieser Commit ist enthalten in:
Ursprung
bae39e2921
Commit
13ec64a4fa
@ -49,7 +49,7 @@ public class StorageLib implements LuaLib {
|
||||
global.set("get", new OneArgFunction() {
|
||||
@Override
|
||||
public LuaValue call(LuaValue arg) {
|
||||
return GLOBAL_STORAGE.get(arg.checkjstring());
|
||||
return GLOBAL_STORAGE.getOrDefault(arg.checkjstring(), NIL);
|
||||
}
|
||||
});
|
||||
global.set("set", new TwoArgFunction() {
|
||||
@ -58,7 +58,6 @@ public class StorageLib implements LuaLib {
|
||||
return GLOBAL_STORAGE.put(arg1.checkjstring(), arg2);
|
||||
}
|
||||
});
|
||||
|
||||
storageLib.set("global", global);
|
||||
|
||||
LuaTable playerStorage = new LuaTable();
|
||||
@ -66,7 +65,7 @@ public class StorageLib implements LuaLib {
|
||||
playerStorage.set("get", new OneArgFunction() {
|
||||
@Override
|
||||
public LuaValue call(LuaValue arg) {
|
||||
return playerStorageMap.get(arg.checkjstring());
|
||||
return playerStorageMap.getOrDefault(arg.checkjstring(), NIL);
|
||||
}
|
||||
});
|
||||
playerStorage.set("set", new TwoArgFunction() {
|
||||
@ -82,7 +81,7 @@ public class StorageLib implements LuaLib {
|
||||
regionStorage.set("get", new OneArgFunction() {
|
||||
@Override
|
||||
public LuaValue call(LuaValue arg) {
|
||||
return regionStorageMap.get(arg.checkjstring());
|
||||
return regionStorageMap.getOrDefault(arg.checkjstring(), NIL);
|
||||
}
|
||||
});
|
||||
regionStorage.set("set", new TwoArgFunction() {
|
||||
|
In neuem Issue referenzieren
Einen Benutzer sperren