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

Method canSnowAt

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

Checks to see if a given block can accumulate snow from it snowing @param pos The block coordinates @param checkLight If false, checking for the correct light values will be skipped

(BlockPos pos, boolean checkLight)

Source from the content-addressed store, hash-verified

2743 * @param checkLight If false, checking for the correct light values will be skipped
2744 */
2745 public boolean canSnowAt(BlockPos pos, boolean checkLight)
2746 {
2747 BiomeGenBase biomegenbase = this.getBiomeGenForCoords(pos);
2748 float f = biomegenbase.getFloatTemperature(pos);
2749
2750 if (f > 0.15F)
2751 {
2752 return false;
2753 }
2754 else if (!checkLight)
2755 {
2756 return true;
2757 }
2758 else
2759 {
2760 if (pos.getY() >= 0 && pos.getY() < 256 && this.getLightFor(EnumSkyBlock.BLOCK, pos) < 10)
2761 {
2762 Block block = this.getBlockState(pos).getBlock();
2763
2764 if (block.getMaterial() == Material.air && Blocks.snow_layer.canPlaceBlockAt(this, pos))
2765 {
2766 return true;
2767 }
2768 }
2769
2770 return false;
2771 }
2772 }
2773
2774 public boolean checkLight(BlockPos pos)
2775 {

Callers 3

canLightningStrikeMethod · 0.95
updateBlocksMethod · 0.80
populateMethod · 0.80

Calls 8

getBiomeGenForCoordsMethod · 0.95
getFloatTemperatureMethod · 0.95
getLightForMethod · 0.95
getBlockStateMethod · 0.95
getMaterialMethod · 0.95
getYMethod · 0.65
getBlockMethod · 0.65
canPlaceBlockAtMethod · 0.45

Tested by

no test coverage detected