本文整理匯總了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;
}
}
示例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;
}
}
示例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;
}
}
示例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;
}
}
示例5: getFloatTemperature
import net.minecraft.world.biome.Biome; //導入方法依賴的package包/類
public float getFloatTemperature(Biome biome, BlockPos pos) {
return biome.getFloatTemperature(pos);
}
示例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);
}