Skip to content

Commit

Permalink
Fix MagmaBlock Crash
Browse files Browse the repository at this point in the history
  • Loading branch information
andi-makes committed Oct 1, 2022
1 parent ce10b0e commit d7f0496
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/main/java/dev/schmarrn/lighty/Compute.java
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
package dev.schmarrn.lighty;

import net.minecraft.block.Block;
import net.minecraft.block.BlockState;
import net.minecraft.block.CarpetBlock;
import net.minecraft.block.SnowBlock;
import net.minecraft.block.*;
import net.minecraft.client.world.ClientWorld;
import net.minecraft.entity.EntityType;
import net.minecraft.util.math.BlockPos;
Expand Down Expand Up @@ -42,8 +39,11 @@ public static List<OverlayData> computeCache(BlockPos playerPos, ClientWorld wor
BlockPos pos = new BlockPos(playerPos.getX() + x, playerPos.getY() + y, playerPos.getZ() + z);
BlockPos posUp = pos.up();
Block up = world.getBlockState(posUp).getBlock();

boolean validSpawn = world.getBlockState(pos).allowsSpawning(world, pos, type) && up.canMobSpawnInside();
BlockState block = world.getBlockState(pos);
boolean validSpawn = up.canMobSpawnInside();
if (!(block.getBlock() instanceof MagmaBlock)) {
validSpawn = validSpawn && block.allowsSpawning(world, pos, type);
}

if (!validSpawn) {
continue;
Expand Down

0 comments on commit d7f0496

Please sign in to comment.