mirror of
https://github.com/Melledy/Grasscutter.git
synced 2024-11-26 14:17:58 +00:00
Fix NullPointerException when trying to find gadgets in a group suite
This commit is contained in:
parent
e8bfdc3c01
commit
5441094e47
@ -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();
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user