WorldGenOre.java 文件源码

java
阅读 26 收藏 0 点赞 0 评论 0

项目:customstuff4 作者:
@Override
public void generate(Random random, int chunkX, int chunkZ, World world, IChunkGenerator chunkGenerator, IChunkProvider chunkProvider)
{
    if (world.provider.getDimension() != dimension)
    {
        return;
    }

    BlockPos chunkPos = new BlockPos(chunkX * 16, 0, chunkZ * 16);

    if (maxHeight < minHeight)
    {
        int i = minHeight;
        minHeight = maxHeight;
        maxHeight = i;
    } else if (maxHeight == minHeight)
    {
        if (minHeight < 255)
        {
            ++maxHeight;
        } else
        {
            --minHeight;
        }
    }

    for (int j = 0; j < count; ++j)
    {
        BlockPos blockpos = chunkPos.add(random.nextInt(16), random.nextInt(maxHeight - minHeight) + minHeight, random.nextInt(16));
        gen.generate(world, random, blockpos);
    }
}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号