Send packet after scene load & Directly send back entity ID to clients

This commit is contained in:
KingRainbow44
2023-07-14 21:22:45 -04:00
parent fecf83cfa4
commit f0775f70f3
2 changed files with 12 additions and 4 deletions

View File

@@ -527,11 +527,9 @@ public class ScriptLib {
if (scriptManager == null) return 1;
var scene = scriptManager.getScene();
var entity = scene.getEntityById(entityId);
if (entity == null) return 2;
scene.broadcastPacket(
new PacketServerGlobalValueChangeNotify(entity, sgvName, value));
scene.runWhenFinished(() -> scene.broadcastPacket(
new PacketServerGlobalValueChangeNotify(entityId, sgvName, value)));
return 0;
}