use of net.minecraft.world.level.block.SnowLayerBlock in project SpongeCommon by SpongePowered.
the class DefaultTeleportHelperFilter method isSafeBodyMaterial.
@Override
public boolean isSafeBodyMaterial(BlockState blockState) {
net.minecraft.world.level.block.state.BlockState state = (net.minecraft.world.level.block.state.BlockState) blockState;
Material material = state.getMaterial();
// Deny blocks that suffocate
if (state.isSuffocating(EmptyBlockGetter.INSTANCE, BlockPos.ZERO)) {
return false;
}
// Deny dangerous lava
if (material == Material.LAVA) {
return false;
}
// Deny non-passable non "full" blocks
return !(state.getBlock() instanceof SlabBlock || state.getBlock() instanceof CauldronBlock || state.getBlock() instanceof AnvilBlock || state.getBlock() instanceof FenceBlock || state.getBlock() instanceof ChorusPlantBlock || state.getBlock() instanceof SnowLayerBlock || material == Material.GLASS || material == Material.LEAVES);
}
Aggregations