diff --git a/src/main/java/emu/grasscutter/scripts/SceneScriptManager.java b/src/main/java/emu/grasscutter/scripts/SceneScriptManager.java index 8e692670f..d8e9361f3 100644 --- a/src/main/java/emu/grasscutter/scripts/SceneScriptManager.java +++ b/src/main/java/emu/grasscutter/scripts/SceneScriptManager.java @@ -1,7 +1,5 @@ package emu.grasscutter.scripts; -import static emu.grasscutter.scripts.constants.EventType.EVENT_TIMER_EVENT; - import com.github.davidmoten.rtreemulti.RTree; import com.github.davidmoten.rtreemulti.geometry.Geometry; import emu.grasscutter.Grasscutter; @@ -21,17 +19,20 @@ import emu.grasscutter.server.packet.send.PacketGroupSuiteNotify; import emu.grasscutter.utils.*; import io.netty.util.concurrent.FastThreadLocalThread; import it.unimi.dsi.fastutil.ints.*; +import kotlin.Pair; +import lombok.val; +import org.luaj.vm2.*; +import org.luaj.vm2.lib.jse.CoerceJavaToLua; + +import javax.annotation.*; import java.io.*; import java.nio.file.Files; import java.util.*; import java.util.concurrent.*; import java.util.concurrent.atomic.AtomicInteger; import java.util.stream.Collectors; -import javax.annotation.*; -import kotlin.Pair; -import lombok.val; -import org.luaj.vm2.*; -import org.luaj.vm2.lib.jse.CoerceJavaToLua; + +import static emu.grasscutter.scripts.constants.EventType.EVENT_TIMER_EVENT; public class SceneScriptManager { private final Scene scene; @@ -681,8 +682,8 @@ public class SceneScriptManager { || !groupInstance.getDeadEntities().contains(m.config_id)); }) .map(g -> createGadget(group.id, group.block_id, g, groupInstance.getCachedGadgetState(g))) - .peek(g -> groupInstance.cacheGadgetState(g.getMetaGadget(), g.getState())) .filter(Objects::nonNull) + .peek(g -> groupInstance.cacheGadgetState(g.getMetaGadget(), g.getState())) .toList(); }