[Fix] Some End-Features can spawn under/on water (#12)
This commit is contained in:
parent
8ca4331c6d
commit
0ec39fa2da
2 changed files with 6 additions and 2 deletions
|
@ -2,6 +2,7 @@ package org.betterx.betterend.world.features;
|
||||||
|
|
||||||
|
|
||||||
import org.betterx.bclib.util.StructureHelper;
|
import org.betterx.bclib.util.StructureHelper;
|
||||||
|
import org.betterx.worlds.together.tag.v3.CommonBlockTags;
|
||||||
|
|
||||||
import net.minecraft.core.BlockPos;
|
import net.minecraft.core.BlockPos;
|
||||||
import net.minecraft.util.RandomSource;
|
import net.minecraft.util.RandomSource;
|
||||||
|
@ -33,7 +34,9 @@ public class ListFeature extends NBTFeature {
|
||||||
protected boolean canSpawn(WorldGenLevel world, BlockPos pos, RandomSource random) {
|
protected boolean canSpawn(WorldGenLevel world, BlockPos pos, RandomSource random) {
|
||||||
int cx = pos.getX() >> 4;
|
int cx = pos.getX() >> 4;
|
||||||
int cz = pos.getZ() >> 4;
|
int cz = pos.getZ() >> 4;
|
||||||
return ((cx + cz) & 1) == 0 && pos.getY() > 58;// && world.getBlockState(pos.below()).is(EndTags.GEN_TERRAIN);
|
return ((cx + cz) & 1) == 0 && pos.getY() > 58
|
||||||
|
&& world.getBlockState(pos).isAir()
|
||||||
|
&& world.getBlockState(pos.below()).is(CommonBlockTags.TERRAIN);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -31,7 +31,8 @@ public class FallenPillarFeature extends DefaultFeature {
|
||||||
world,
|
world,
|
||||||
new BlockPos(pos.getX() + random.nextInt(16), pos.getY(), pos.getZ() + random.nextInt(16))
|
new BlockPos(pos.getX() + random.nextInt(16), pos.getY(), pos.getZ() + random.nextInt(16))
|
||||||
);
|
);
|
||||||
if (!world.getBlockState(pos.below(5)).is(CommonBlockTags.GEN_END_STONES)) {
|
if (!world.getBlockState(pos.below(5)).is(CommonBlockTags.GEN_END_STONES)
|
||||||
|
|| !world.getBlockState(pos).isAir()) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue