NyxChunkProvider.java 文件源码

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

项目:IceAndShadow2 作者:
public NyxChunkProvider(World par1World, long seed, boolean par4) {
    final Random rand = new Random(~seed);
    ablock = new Block[1 << 16];
    abyte = new byte[1 << 16];
    worldObj = par1World;
    noiseGen = new NoiseGeneratorOctaves[4];
    noiseGen[0] = new NoiseGeneratorOctaves(rand, 16);
    noiseGen[1] = new NoiseGeneratorOctaves(rand, 16);
    noiseGen[2] = new NoiseGeneratorOctaves(rand, 8);
    noiseGen[3] = new NoiseGeneratorOctaves(rand, 16);
    // noiseGenStone = new NoiseGeneratorPerlin(rand, 4);
    // this.noiseGenPublic = new NoiseGeneratorOctaves(this.rand, 10);
    densitymap = new double[magic*magic*33];

    parabolicField = new float[radius*radius*4];
    for (int j = -radius; j <= radius; ++j) {
        for (int k = -radius; k <= radius; ++k) {
            final boolean corner = Math.abs(j) >= radius-1 && Math.abs(k) >= radius-1;
            final float f = corner?0:1f / MathHelper.sqrt_float(j * j + k * k + 0.5f);
            parabolicField[j + radius + (k + radius) * radius] = f;
        }
    }
}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号