当前位置: 首页>>代码示例>>Java>>正文


Java World.getSeaLevel方法代码示例

本文整理汇总了Java中net.minecraft.world.World.getSeaLevel方法的典型用法代码示例。如果您正苦于以下问题:Java World.getSeaLevel方法的具体用法?Java World.getSeaLevel怎么用?Java World.getSeaLevel使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在net.minecraft.world.World的用法示例。


在下文中一共展示了World.getSeaLevel方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: StructureMineshaftStart

import net.minecraft.world.World; //导入方法依赖的package包/类
public StructureMineshaftStart(World p_i47149_1_, Random p_i47149_2_, int p_i47149_3_, int p_i47149_4_, MapGenMineshaft.Type p_i47149_5_)
{
    super(p_i47149_3_, p_i47149_4_);
    this.mineShaftType = p_i47149_5_;
    StructureMineshaftPieces.Room structuremineshaftpieces$room = new StructureMineshaftPieces.Room(0, p_i47149_2_, (p_i47149_3_ << 4) + 2, (p_i47149_4_ << 4) + 2, this.mineShaftType);
    this.components.add(structuremineshaftpieces$room);
    structuremineshaftpieces$room.buildComponent(structuremineshaftpieces$room, this.components, p_i47149_2_);
    this.updateBoundingBox();

    if (p_i47149_5_ == MapGenMineshaft.Type.MESA)
    {
        int i = -5;
        int j = p_i47149_1_.getSeaLevel() - this.boundingBox.maxY + this.boundingBox.getYSize() / 2 - -5;
        this.boundingBox.offset(0, j, 0);

        for (StructureComponent structurecomponent : this.components)
        {
            structurecomponent.offset(0, j, 0);
        }
    }
    else
    {
        this.markAvailableHeight(p_i47149_1_, p_i47149_2_, 10);
    }
}
 
开发者ID:sudofox,项目名称:Backmemed,代码行数:26,代码来源:StructureMineshaftStart.java

示例2: generateWaterBox

import net.minecraft.world.World; //导入方法依赖的package包/类
protected void generateWaterBox(World p_181655_1_, StructureBoundingBox p_181655_2_, int p_181655_3_, int p_181655_4_, int p_181655_5_, int p_181655_6_, int p_181655_7_, int p_181655_8_, boolean p_181655_9_)
{
    for (int i = p_181655_4_; i <= p_181655_7_; ++i)
    {
        for (int j = p_181655_3_; j <= p_181655_6_; ++j)
        {
            for (int k = p_181655_5_; k <= p_181655_8_; ++k)
            {
                if (!p_181655_9_ || this.getBlockStateFromPos(p_181655_1_, j, i, k, p_181655_2_).getMaterial() != Material.AIR)
                {
                    if (this.getYWithOffset(i) >= p_181655_1_.getSeaLevel())
                    {
                        this.setBlockState(p_181655_1_, Blocks.AIR.getDefaultState(), j, i, k, p_181655_2_);
                    }
                    else
                    {
                        this.setBlockState(p_181655_1_, WATER, j, i, k, p_181655_2_);
                    }
                }
            }
        }
    }
}
 
开发者ID:sudofox,项目名称:Backmemed,代码行数:24,代码来源:StructureOceanMonumentPieces.java

示例3: markAvailableHeight

import net.minecraft.world.World; //导入方法依赖的package包/类
/**
 * offsets the structure Bounding Boxes up to a certain height, typically 63 - 10
 */
protected void markAvailableHeight(World worldIn, Random rand, int p_75067_3_)
{
    int i = worldIn.getSeaLevel() - p_75067_3_;
    int j = this.boundingBox.getYSize() + 1;

    if (j < i)
    {
        j += rand.nextInt(i - j);
    }

    int k = j - this.boundingBox.maxY;
    this.boundingBox.offset(0, k, 0);

    for (StructureComponent structurecomponent : this.components)
    {
        structurecomponent.offset(0, k, 0);
    }
}
 
开发者ID:sudofox,项目名称:Backmemed,代码行数:22,代码来源:StructureStart.java

示例4: findNonSpikeSurface

import net.minecraft.world.World; //导入方法依赖的package包/类
@Nullable
public static BlockPos findNonSpikeSurface(World world, BlockPos start) {
	BlockPos pos = start;
	while (pos.getY()>world.getSeaLevel()) {
		if (isNonSpikeSurface(world, pos)) return pos;
		pos = pos.down();
	}
	
	return null;
}
 
开发者ID:elytra,项目名称:ThermionicsWorld,代码行数:11,代码来源:GeneratorMagmaSpike.java

示例5: findSurface

import net.minecraft.world.World; //导入方法依赖的package包/类
@Nullable
public static BlockPos findSurface(World world, BlockPos start) {
	BlockPos pos = start;
	while (pos.getY()>world.getSeaLevel()) {
		if (NeoHellGenerators.isSurface(world, pos)) return pos;
		pos = pos.down();
	}
	
	return null;
}
 
开发者ID:elytra,项目名称:ThermionicsWorld,代码行数:11,代码来源:NeoHellGenerators.java


注:本文中的net.minecraft.world.World.getSeaLevel方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。