MCPcopy Create free account
hub / github.com/DGVPSH/SlackOpen / canBlockFreeze

Method canBlockFreeze

src/main/java/net/minecraft/world/World.java:2698–2732  ·  view source on GitHub ↗

Checks to see if a given block is both water and cold enough to freeze. @param pos The block coordinates @param noWaterAdj If true, this method will only return true if there is a non-water block immediately adjacent to the specified block

(BlockPos pos, boolean noWaterAdj)

Source from the content-addressed store, hash-verified

2696 * to the specified block
2697 */
2698 public boolean canBlockFreeze(BlockPos pos, boolean noWaterAdj)
2699 {
2700 BiomeGenBase biomegenbase = this.getBiomeGenForCoords(pos);
2701 float f = biomegenbase.getFloatTemperature(pos);
2702
2703 if (f > 0.15F)
2704 {
2705 return false;
2706 }
2707 else
2708 {
2709 if (pos.getY() >= 0 && pos.getY() < 256 && this.getLightFor(EnumSkyBlock.BLOCK, pos) < 10)
2710 {
2711 IBlockState iblockstate = this.getBlockState(pos);
2712 Block block = iblockstate.getBlock();
2713
2714 if ((block == Blocks.water || block == Blocks.flowing_water) && iblockstate.getValue(BlockLiquid.LEVEL) == 0)
2715 {
2716 if (!noWaterAdj)
2717 {
2718 return true;
2719 }
2720
2721 boolean flag = this.isWater(pos.west()) && this.isWater(pos.east()) && this.isWater(pos.north()) && this.isWater(pos.south());
2722
2723 if (!flag)
2724 {
2725 return true;
2726 }
2727 }
2728 }
2729
2730 return false;
2731 }
2732 }
2733
2734 private boolean isWater(BlockPos pos)
2735 {

Callers 2

canBlockFreezeWaterMethod · 0.95
canBlockFreezeNoWaterMethod · 0.95

Calls 12

getBiomeGenForCoordsMethod · 0.95
getFloatTemperatureMethod · 0.95
getLightForMethod · 0.95
getBlockStateMethod · 0.95
getBlockMethod · 0.95
getValueMethod · 0.95
isWaterMethod · 0.95
westMethod · 0.80
eastMethod · 0.80
northMethod · 0.80
southMethod · 0.80
getYMethod · 0.65

Tested by

no test coverage detected