|
30 | 30 | import java.util.stream.LongStream; |
31 | 31 | import java.util.stream.Stream; |
32 | 32 |
|
33 | | -import net.minecraft.core.BlockPos; |
34 | | -import net.minecraft.core.SectionPos; |
35 | | -import net.minecraft.world.level.ChunkPos; |
36 | | -import net.minecraft.world.level.Level; |
37 | | - |
38 | 33 | import org.jetbrains.annotations.NotNull; |
39 | 34 | import org.jetbrains.annotations.Nullable; |
40 | 35 |
|
|
44 | 39 | import it.unimi.dsi.fastutil.longs.LongLinkedOpenHashSet; |
45 | 40 | import it.unimi.dsi.fastutil.longs.LongSet; |
46 | 41 |
|
| 42 | +import net.minecraft.core.BlockPos; |
| 43 | +import net.minecraft.core.SectionPos; |
| 44 | +import net.minecraft.world.level.ChunkPos; |
| 45 | +import net.minecraft.world.level.Level; |
| 46 | + |
47 | 47 | import com.kneelawk.graphlib.api.graph.BlockGraph; |
48 | 48 | import com.kneelawk.graphlib.api.graph.GraphUniverse; |
49 | 49 | import com.kneelawk.graphlib.api.graph.GraphView; |
@@ -187,7 +187,10 @@ public boolean linkExistsAt(@NotNull LinkPos pos) { |
187 | 187 | SimpleBlockGraphChunk chunk = manager.getIfExists(SectionPos.of(pos)); |
188 | 188 | if (chunk == null) return LongStream.empty(); |
189 | 189 |
|
190 | | - return chunk.getGraphsAt(pos).longStream(); |
| 190 | + LongSet graphsAt = chunk.getGraphsAt(pos); |
| 191 | + if (graphsAt == null) return LongStream.empty(); |
| 192 | + |
| 193 | + return graphsAt.longStream(); |
191 | 194 | } |
192 | 195 |
|
193 | 196 | @Override |
|
0 commit comments