Make desertShrubs check for waterlogged blocks instead of just water blocks (#1388)

This commit is contained in:
altrisi authored and GitHub committed 2022-04-03 13:06:29 +02:00
1 parent 4db1c9540a
commit 330fd6f466
2 files changed
+22 -27

No files matched your search

@@ -1,22 +0,0 @@
package carpet.helpers;
import net.minecraft.core.BlockPos;
import net.minecraft.world.level.LevelAccessor;
import net.minecraft.world.level.material.Material;
public class BlockSaplingHelper
{
// Added code for checking water for dead shrub rule
public static boolean hasWater(LevelAccessor worldIn, BlockPos pos)
{
for (BlockPos blockpos$mutableblockpos : BlockPos.betweenClosed(pos.offset(-4, -4, -4), pos.offset(4, 1, 4)))
{
if (worldIn.getBlockState(blockpos$mutableblockpos).getMaterial() == Material.WATER)
{
return true;
}
}
return false;
}
}