Skip to content

Commit

Permalink
lester spawning
Browse files Browse the repository at this point in the history
  • Loading branch information
gemsb committed Jan 7, 2024
1 parent 6636233 commit 0e3381d
Showing 1 changed file with 6 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,7 @@ public LesterSpawningBlock(Settings settings) {
@Override
public void onBroken(WorldAccess world, BlockPos pos, BlockState state) {
if(world.isClient())return;
SculkDepths.LOGGER.info(pos.toString());
pos = checkForRoof(world,pos, "Up",0,300);
SculkDepths.LOGGER.info(pos.toString());
int count = MathHelper.nextInt(Random.create(), 4, 9);

for(;count > 0; count--){
Expand Down Expand Up @@ -65,20 +63,21 @@ BlockPos checkForRoof(WorldAccess world, BlockPos pos, String op, int min, int m
BlockPos pos2 = pos;
if(op == "Up"){
do{
if(i > max) return null;
pos2 = pos2.up(1);
i++;
SculkDepths.LOGGER.info(pos2.toString());
}while(world.getBlockState(pos2).isIn(ModTags.Blocks.LESTER_SPAWN_AIR_BLOCKS) && i <= max);
}while(world.getBlockState(pos2).isIn(ModTags.Blocks.LESTER_SPAWN_AIR_BLOCKS));
}

if(op == "Down"){
do{
if(i > max) return null;
pos2 = pos2.down(1);
i++;
}while(! world.getBlockState(pos2).isIn(ModTags.Blocks.LESTER_SPAWN_AIR_BLOCKS) && i <= max);
}while(! world.getBlockState(pos2).isIn(ModTags.Blocks.LESTER_SPAWN_AIR_BLOCKS));
}
if (i < min){return null;}
if (pos2 == pos){return null;}
if (i < min) return null;
if (pos2 == pos) return null;
return pos2;

}
Expand Down

0 comments on commit 0e3381d

Please sign in to comment.