From 080fdeeef6bcd891a7b5df2bb0ac95a335cd3f6d Mon Sep 17 00:00:00 2001 From: Melledy <52122272+Melledy@users.noreply.github.com> Date: Mon, 25 Apr 2022 13:59:42 -0700 Subject: [PATCH] Synchronize scene entity map --- src/main/java/emu/grasscutter/game/GenshinScene.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/main/java/emu/grasscutter/game/GenshinScene.java b/src/main/java/emu/grasscutter/game/GenshinScene.java index 955d42d1c..25e2f195a 100644 --- a/src/main/java/emu/grasscutter/game/GenshinScene.java +++ b/src/main/java/emu/grasscutter/game/GenshinScene.java @@ -38,6 +38,7 @@ import emu.grasscutter.server.packet.send.PacketSceneEntityAppearNotify; import emu.grasscutter.server.packet.send.PacketSceneEntityDisappearNotify; import emu.grasscutter.utils.Utils; import it.unimi.dsi.fastutil.ints.Int2ObjectMap; +import it.unimi.dsi.fastutil.ints.Int2ObjectMaps; import it.unimi.dsi.fastutil.ints.Int2ObjectOpenHashMap; public class GenshinScene { @@ -58,7 +59,7 @@ public class GenshinScene { this.world = world; this.sceneData = sceneData; this.players = Collections.synchronizedList(new ArrayList<>()); - this.entities = new Int2ObjectOpenHashMap<>(); + this.entities = Int2ObjectMaps.synchronize(new Int2ObjectOpenHashMap<>()); this.time = 8 * 60; this.climate = ClimateType.CLIMATE_SUNNY;