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


Java Biome.getFloatTemperature方法代码示例

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


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

示例1: canBlockFreeze

import net.minecraft.world.biome.Biome; //导入方法依赖的package包/类
/**
 * Checks to see if a given block is both water and cold enough to freeze.
 */
public boolean canBlockFreeze(BlockPos pos, boolean noWaterAdj)
{
    Biome biome = this.getBiome(pos);
    float f = biome.getFloatTemperature(pos);

    if (f >= 0.15F)
    {
        return false;
    }
    else
    {
        if (pos.getY() >= 0 && pos.getY() < 256 && this.getLightFor(EnumSkyBlock.BLOCK, pos) < 10)
        {
            IBlockState iblockstate = this.getBlockState(pos);
            Block block = iblockstate.getBlock();

            if ((block == Blocks.WATER || block == Blocks.FLOWING_WATER) && ((Integer)iblockstate.getValue(BlockLiquid.LEVEL)).intValue() == 0)
            {
                if (!noWaterAdj)
                {
                    return true;
                }

                boolean flag = this.isWater(pos.west()) && this.isWater(pos.east()) && this.isWater(pos.north()) && this.isWater(pos.south());

                if (!flag)
                {
                    return true;
                }
            }
        }

        return false;
    }
}
 
开发者ID:sudofox,项目名称:Backmemed,代码行数:39,代码来源:World.java

示例2: canSnowAt

import net.minecraft.world.biome.Biome; //导入方法依赖的package包/类
/**
 * Checks to see if a given block can accumulate snow from it snowing
 */
public boolean canSnowAt(BlockPos pos, boolean checkLight)
{
    Biome biome = this.getBiome(pos);
    float f = biome.getFloatTemperature(pos);

    if (f >= 0.15F)
    {
        return false;
    }
    else if (!checkLight)
    {
        return true;
    }
    else
    {
        if (pos.getY() >= 0 && pos.getY() < 256 && this.getLightFor(EnumSkyBlock.BLOCK, pos) < 10)
        {
            IBlockState iblockstate = this.getBlockState(pos);

            if (iblockstate.getMaterial() == Material.AIR && Blocks.SNOW_LAYER.canPlaceBlockAt(this, pos))
            {
                return true;
            }
        }

        return false;
    }
}
 
开发者ID:sudofox,项目名称:Backmemed,代码行数:32,代码来源:World.java

示例3: canBlockFreezeBody

import net.minecraft.world.biome.Biome; //导入方法依赖的package包/类
public boolean canBlockFreezeBody(BlockPos pos, boolean noWaterAdj)
{
    Biome biome = this.getBiome(pos);
    float f = biome.getFloatTemperature(pos);

    if (f > 0.15F)
    {
        return false;
    }
    else
    {
        if (pos.getY() >= 0 && pos.getY() < 256 && this.getLightFor(EnumSkyBlock.BLOCK, pos) < 10)
        {
            IBlockState iblockstate = this.getBlockState(pos);
            Block block = iblockstate.getBlock();

            if ((block == Blocks.WATER || block == Blocks.FLOWING_WATER) && ((Integer)iblockstate.getValue(BlockLiquid.LEVEL)).intValue() == 0)
            {
                if (!noWaterAdj)
                {
                    return true;
                }

                boolean flag = this.isWater(pos.west()) && this.isWater(pos.east()) && this.isWater(pos.north()) && this.isWater(pos.south());

                if (!flag)
                {
                    return true;
                }
            }
        }

        return false;
    }
}
 
开发者ID:F1r3w477,项目名称:CustomWorldGen,代码行数:36,代码来源:World.java

示例4: canSnowAtBody

import net.minecraft.world.biome.Biome; //导入方法依赖的package包/类
public boolean canSnowAtBody(BlockPos pos, boolean checkLight)
{
    Biome biome = this.getBiome(pos);
    float f = biome.getFloatTemperature(pos);

    if (f > 0.15F)
    {
        return false;
    }
    else if (!checkLight)
    {
        return true;
    }
    else
    {
        if (pos.getY() >= 0 && pos.getY() < 256 && this.getLightFor(EnumSkyBlock.BLOCK, pos) < 10)
        {
            IBlockState iblockstate = this.getBlockState(pos);

            if (iblockstate.getBlock().isAir(iblockstate, this, pos) && Blocks.SNOW_LAYER.canPlaceBlockAt(this, pos))
            {
                return true;
            }
        }

        return false;
    }
}
 
开发者ID:F1r3w477,项目名称:CustomWorldGen,代码行数:29,代码来源:World.java

示例5: getFloatTemperature

import net.minecraft.world.biome.Biome; //导入方法依赖的package包/类
public float getFloatTemperature(Biome biome, BlockPos pos) {
    return biome.getFloatTemperature(pos);
}
 
开发者ID:stuebz88,项目名称:modName,代码行数:4,代码来源:ChunkProviderBasic.java

示例6: getSkyColor

import net.minecraft.world.biome.Biome; //导入方法依赖的package包/类
/**
 * Calculates the color for the skybox
 */
public Vec3d getSkyColor(Entity entityIn, float partialTicks)
{
    float f = this.getCelestialAngle(partialTicks);
    float f1 = MathHelper.cos(f * ((float)Math.PI * 2F)) * 2.0F + 0.5F;
    f1 = MathHelper.clamp(f1, 0.0F, 1.0F);
    int i = MathHelper.floor(entityIn.posX);
    int j = MathHelper.floor(entityIn.posY);
    int k = MathHelper.floor(entityIn.posZ);
    BlockPos blockpos = new BlockPos(i, j, k);
    Biome biome = this.getBiome(blockpos);
    float f2 = biome.getFloatTemperature(blockpos);
    int l = biome.getSkyColorByTemp(f2);
    float f3 = (float)(l >> 16 & 255) / 255.0F;
    float f4 = (float)(l >> 8 & 255) / 255.0F;
    float f5 = (float)(l & 255) / 255.0F;
    f3 = f3 * f1;
    f4 = f4 * f1;
    f5 = f5 * f1;
    float f6 = this.getRainStrength(partialTicks);

    if (f6 > 0.0F)
    {
        float f7 = (f3 * 0.3F + f4 * 0.59F + f5 * 0.11F) * 0.6F;
        float f8 = 1.0F - f6 * 0.75F;
        f3 = f3 * f8 + f7 * (1.0F - f8);
        f4 = f4 * f8 + f7 * (1.0F - f8);
        f5 = f5 * f8 + f7 * (1.0F - f8);
    }

    float f10 = this.getThunderStrength(partialTicks);

    if (f10 > 0.0F)
    {
        float f11 = (f3 * 0.3F + f4 * 0.59F + f5 * 0.11F) * 0.2F;
        float f9 = 1.0F - f10 * 0.75F;
        f3 = f3 * f9 + f11 * (1.0F - f9);
        f4 = f4 * f9 + f11 * (1.0F - f9);
        f5 = f5 * f9 + f11 * (1.0F - f9);
    }

    if (this.lastLightningBolt > 0)
    {
        float f12 = (float)this.lastLightningBolt - partialTicks;

        if (f12 > 1.0F)
        {
            f12 = 1.0F;
        }

        f12 = f12 * 0.45F;
        f3 = f3 * (1.0F - f12) + 0.8F * f12;
        f4 = f4 * (1.0F - f12) + 0.8F * f12;
        f5 = f5 * (1.0F - f12) + 1.0F * f12;
    }

    return new Vec3d((double)f3, (double)f4, (double)f5);
}
 
开发者ID:sudofox,项目名称:Backmemed,代码行数:61,代码来源:World.java


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