WorldGenMoonFlower.java 文件源码

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

项目:KalStuff 作者:
@Override
public void generate(Random random, int chunkX, int chunkZ, World world, IChunkGenerator chunkGenerator, IChunkProvider chunkProvider) {
    if (random.nextInt(200) == 1) {
        ArrayList<BlockPos> somePos = this.getValidLocationsInArea(random, chunkX * 16 + random.nextInt(16), chunkZ * 16 + random.nextInt(16), 8, world);

        if (somePos != null) {
            for (int i = 0; i < somePos.size(); i ++)
                if (somePos.get(i) != null)
                    world.setBlockState(somePos.get(i).up(), KalStuffBlocks.moon_flower.getDefaultState());
        }
    }
}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号