本文整理了Java中net.minecraft.world.World.getSeaLevel()
方法的一些代码示例,展示了World.getSeaLevel()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。World.getSeaLevel()
方法的具体详情如下:
包路径:net.minecraft.world.World
类名称:World
方法名:getSeaLevel
暂无
代码示例来源:origin: SleepyTrousers/EnderIO
@Override
public int getSeaLevel() {
return wrapped.getSeaLevel();
}
代码示例来源:origin: Alex-the-666/Ice_and_Fire
public boolean getCanSpawnHere() {
return this.posY > 30 && this.posY < (double) this.world.getSeaLevel();
}
代码示例来源:origin: jabelar/ExampleMod-1.12
@Override
public int getMinimumSpawnHeight(World world)
{
return world.getSeaLevel() + 1;
}
代码示例来源:origin: lawremi/CustomOreGen
@Override
public int getHeight(World world, int x, int z) {
return world.getSeaLevel();
}
代码示例来源:origin: Vazkii/Botania
if(startCenter.getY() < world.getSeaLevel()) // Not below sea level
return;
代码示例来源:origin: amadornes/MCMultiPart
@Override
public int getSeaLevel() {
return getActualWorld().getSeaLevel();
}
代码示例来源:origin: gegy1000/Terrarium
@Override
protected void composeDecoration(IChunkGenerator generator, World world, int chunkX, int chunkZ, Biome biome) {
int globalX = chunkX << 4;
int globalZ = chunkZ << 4;
BlockPos pos = new BlockPos(globalX, 0, globalZ);
if (this.random.nextInt(8) == 0) {
if (TerrainGen.populate(generator, world, this.random, globalX, globalZ, false, PopulateChunkEvent.Populate.EventType.LAVA)) {
int offsetX = this.random.nextInt(16) + 8;
int offsetY = this.random.nextInt(this.random.nextInt(world.getHeight() - 8) + 8);
int offsetZ = this.random.nextInt(16) + 8;
if (offsetY < world.getSeaLevel() || this.random.nextInt(10) == 0) {
(new WorldGenLakes(Blocks.LAVA)).generate(world, this.random, pos.add(offsetX, offsetY, offsetZ));
}
}
}
}
}
代码示例来源:origin: jabelar/ExampleMod-1.12
else if (i2 * 8 + j2 < world.getSeaLevel())
代码示例来源:origin: P3pp3rF1y/AncientWarfare2
int minY = Math.max(0, world.getSeaLevel() - 3);
代码示例来源:origin: Glitchfiend/FamiliarFauna
@Override
public boolean getCanSpawnHere()
{
BlockPos blockpos = new BlockPos(this.posX, this.getEntityBoundingBox().minY, this.posZ);
if (blockpos.getY() <= this.world.getSeaLevel())
{
return false;
}
else
{
if (blockpos.getY() >= 90)
{
return false;
}
else
{
int light = this.world.getLightFromNeighbors(blockpos);
return light > 8 && super.getCanSpawnHere();
}
}
}
代码示例来源:origin: Glitchfiend/FamiliarFauna
@Override
public boolean getCanSpawnHere()
{
BlockPos blockpos = new BlockPos(this.posX, this.getEntityBoundingBox().minY, this.posZ);
if (blockpos.getY() <= this.world.getSeaLevel())
{
return false;
}
else
{
if (blockpos.getY() >= 90)
{
return false;
}
else
{
int light = this.world.getLightFromNeighbors(blockpos);
return light > 8 && super.getCanSpawnHere();
}
}
}
代码示例来源:origin: Alex-the-666/Ice_and_Fire
public final void generateGlacierBiome(World worldIn, Random rand, ChunkPrimer chunkPrimerIn, int x, int z, double noiseVal) {
int i = worldIn.getSeaLevel();
IBlockState iblockstate = this.topBlock;
IBlockState iblockstate1 = rand.nextInt(5) == 0 ? Blocks.ICE.getDefaultState() : this.fillerBlock;
代码示例来源:origin: Glitchfiend/FamiliarFauna
@Override
public boolean getCanSpawnHere()
{
BlockPos blockpos = new BlockPos(this.posX, this.getEntityBoundingBox().minY, this.posZ);
if (blockpos.getY() <= this.world.getSeaLevel())
{
return false;
}
else
{
if (blockpos.getY() >= 90)
{
return false;
}
else
{
int light = this.world.getLightFromNeighbors(blockpos);
return light > 8 && super.getCanSpawnHere();
}
}
}
代码示例来源:origin: joshiejack/Mariculture
@Override
protected void digBlock(ChunkPrimer data, int x, int y, int z, int chunkX, int chunkZ, boolean foundTop) {
Biome biome = worldObj.getBiome(new BlockPos(x + chunkX * 16, 0, z + chunkZ * 16));
if (biome == Biomes.OCEAN || biome == Biomes.DEEP_OCEAN || biome == Biomes.FROZEN_OCEAN) {
IBlockState state = data.getBlockState(x, y, z);
if (state.getBlock() == Blocks.STONE || state == OCEAN_SURFACE || state == OCEAN_FILLER || (state == BEDROCK && y > 1)) {
if (y - 1 < 4) {
data.setBlockState(x, y, z, OCEAN_SURFACE);
} else {
if (y < worldObj.getSeaLevel())
data.setBlockState(x, y, z, WATER);
else data.setBlockState(x, y, z, AIR);
if (y < 6 && y > 1) {
data.setBlockState(x, y - 1, z, OCEAN_FILLER);
}
}
}
}
}
代码示例来源:origin: joshiejack/Mariculture
int i = worldIn.getSeaLevel();
IBlockState iblockstate = this.topBlock;
IBlockState iblockstate1 = this.fillerBlock;
代码示例来源:origin: joshiejack/Mariculture
private void genSandyOceans(World worldIn, Random rand, ChunkPrimer chunkPrimerIn, int x, int z, double noiseVal) {
int i = worldIn.getSeaLevel();
IBlockState iblockstate = Abyssal.OCEAN_SURFACE;
IBlockState iblockstate1 = Abyssal.OCEAN_FILLER;
代码示例来源:origin: TeamLapen/Vampirism
public static boolean canBlockSeeSun(World world, BlockPos pos) {
if (pos.getY() >= world.getSeaLevel()) {
return world.canSeeSky(pos);
} else {
BlockPos blockpos = new BlockPos(pos.getX(), world.getSeaLevel(), pos.getZ());
if (!world.canSeeSky(blockpos)) {
return false;
} else {
int liquidBlocks = 0;
for (blockpos = blockpos.down(); blockpos.getY() > pos.getY(); blockpos = blockpos.down()) {
IBlockState iblockstate = world.getBlockState(blockpos);
if (iblockstate.getBlock().getLightOpacity(iblockstate, world, blockpos) > 0) {
if (iblockstate.getMaterial().isLiquid()) {
liquidBlocks++;
if (liquidBlocks >= Balance.vp.SUNDAMAGE_WATER_BLOCKS) {
return false;
}
} else {
return false;
}
}
}
return true;
}
}
}
代码示例来源:origin: P3pp3rF1y/AncientWarfare2
@Override
protected void borderLeveling(World world, int x, int z, StructureTemplate template, StructureBB bb) {
if (getMaxLeveling() <= 0) {
return;
}
int topFilledY = Math.max(world.getSeaLevel(), WorldStructureGenerator.getTargetY(world, x, z, true));
int topNonAirBlock = BlockTools.getTopFilledHeight(world.getChunkFromBlockCoords(new BlockPos(x, 1, z)), x, z, false);
int step = WorldStructureGenerator.getStepNumber(x, z, bb.min.getX(), bb.max.getX(), bb.min.getZ(), bb.max.getZ());
int startY = Math.min(bb.min.getY() + template.getOffset().getY() + step, topFilledY + 1);
for (int y = topNonAirBlock; y >= startY; y--) {
handleClearAction(world, new BlockPos(x, y, z), template, bb);
}
Biome biome = world.provider.getBiomeForCoords(new BlockPos(x, 1, z));
IBlockState fillBlock = biome.topBlock;
int y = bb.min.getY() + template.getOffset().getY() + step - 1;
BlockPos pos = new BlockPos(x, y, z);
IBlockState state = world.getBlockState(pos);
Block block = state.getBlock();
if (block != Blocks.FLOWING_WATER && block != Blocks.WATER && !AWStructureStatics.isSkippable(state)) {
world.setBlockState(pos, fillBlock);
}
}
}
代码示例来源:origin: Alex-the-666/Ice_and_Fire
blockpos = worldIn.getTopSolidOrLiquidBlock(blockpos).down();
if (blockpos.getY() < worldIn.getSeaLevel()) {
blockpos = new BlockPos(blockpos.getX(), worldIn.getSeaLevel() - 1, blockpos.getZ());
while (blockpos.getY() >= worldIn.getSeaLevel() - 1) {
IBlockState iblockstate4 = worldIn.getBlockState(blockpos);
代码示例来源:origin: Alex-the-666/Ice_and_Fire
blockpos = worldIn.getTopSolidOrLiquidBlock(blockpos).down();
if (blockpos.getY() < worldIn.getSeaLevel()) {
blockpos = new BlockPos(blockpos.getX(), worldIn.getSeaLevel() - 1, blockpos.getZ());
while (blockpos.getY() >= worldIn.getSeaLevel() - 1) {
IBlockState iblockstate4 = worldIn.getBlockState(blockpos);
内容来源于网络,如有侵权,请联系作者删除!