Skip to content

Commit

Permalink
fix spawn block not being replaced by air when not ignoring air
Browse files Browse the repository at this point in the history
  • Loading branch information
MelanX committed Apr 22, 2024
1 parent 9a38a01 commit 51c489d
Showing 1 changed file with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
import net.minecraft.world.entity.player.Player;
import net.minecraft.world.level.Level;
import net.minecraft.world.level.block.Block;
import net.minecraft.world.level.block.Blocks;
import net.minecraft.world.level.block.entity.BlockEntity;
import net.minecraft.world.level.block.state.BlockState;
import net.minecraft.world.level.block.state.properties.BlockStateProperties;
Expand Down Expand Up @@ -111,7 +112,12 @@ public static Set<TemplatesConfig.Spawn> fillTemplateFromWorld(StructureTemplate
if (state.is(ModBlocks.spawnBlock)) {
WorldUtil.Directions direction = WorldUtil.Directions.fromDirection(state.getValue(BlockStateProperties.HORIZONTAL_FACING));
spawns.add(new TemplatesConfig.Spawn(relPos, direction));
continue;
// prevent spawn block being replaced by solid block in a cave
if (toIgnore.contains(Blocks.AIR)) {
continue;
}

state = Blocks.AIR.defaultBlockState();
}
BlockEntity blockEntity = level.getBlockEntity(actPos);
StructureTemplate.StructureBlockInfo blockInfo;
Expand Down

0 comments on commit 51c489d

Please sign in to comment.