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)
| 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 | { |
no test coverage detected