mirror of
https://github.com/Melledy/Grasscutter.git
synced 2024-11-23 03:37:38 +00:00
Optimize 71a8ca2a
This commit is contained in:
parent
97f74d9d55
commit
7bac95098a
@ -511,14 +511,18 @@ public class ScriptLib {
|
||||
return 0;
|
||||
}
|
||||
|
||||
public int SetEntityServerGlobalValueByConfigId(int cfgId, String sgvName, int value){
|
||||
public int SetEntityServerGlobalValueByConfigId(int cfgId, String sgvName, int value) {
|
||||
logger.debug("[LUA] Call SetEntityServerGlobalValueByConfigId with {}, {}, {}",
|
||||
cfgId, sgvName, value);
|
||||
|
||||
var scriptManager = this.getSceneScriptManager();
|
||||
if (scriptManager == null) return 1;
|
||||
|
||||
var entity = scriptManager.getScene().getEntityByConfigId(cfgId);
|
||||
var scene = scriptManager.getScene();
|
||||
var entity = scene.getEntityByConfigId(cfgId);
|
||||
if (entity == null) return 2;
|
||||
|
||||
scriptManager.getScene().getWorld().broadcastPacket(
|
||||
scene.broadcastPacket(
|
||||
new PacketServerGlobalValueChangeNotify(entity, sgvName, value));
|
||||
return 0;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user