FirmaChunkGen.java 文件源码

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

项目:Firma 作者:
public FirmaChunkGen(World worldIn, boolean mapFeaturesEnabledIn) {
    this.world = worldIn;
    this.mapFeaturesEnabled = mapFeaturesEnabledIn;
    this.rand = new Random(world.getSeed());
    this.rockStrataNoise = new VoronoiNoise(world.getSeed(), (short) 0);

    String customSetting = worldIn.getWorldInfo().getGeneratorOptions();
    if(customSetting.length()==0){
        customSetting = "{\"baseSize\":20.0,\"heightScale\":2.0,\"seaLevel\":151}";
    }
    this.settings = ChunkProviderSettings.Factory.jsonToFactory(customSetting).build();
    this.OCEAN = this.settings.useLavaOceans ? FirmaMod.lava.getBlock().getDefaultState() : OCEAN;
    this.heightMap = new double[825];

    this.biomeWeights = new float[25];

    for (int i = -2; i <= 2; ++i) {
        for (int j = -2; j <= 2; ++j) {
            float f = 10.0F / MathHelper.sqrt(i * i + j * j + 0.2F);
            this.biomeWeights[i + 2 + (j + 2) * 5] = f;
        }
    }

    this.minLimitPerlinNoise = new NoiseGeneratorOctaves(this.rand, 16);
    this.maxLimitPerlinNoise = new NoiseGeneratorOctaves(this.rand, 16);
    this.mainPerlinNoise = new NoiseGeneratorOctaves(this.rand, 8);
    this.depthNoise = new NoiseGeneratorOctaves(this.rand, 16);
}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号